Interface AlgorithmRegistry

All Known Implementing Classes:
AlgorithmRegistryImpl, AlgorithmRegistrySingleton, StaticAlgorithmRegistry

public interface AlgorithmRegistry
Interface representing an algorithm registry.

The interface offers a direct possibility to search for an algorithm based on its URI. To search based on other algorithm properties, use getAlgorithm(Predicate) or getAlgorithms(Predicate).

Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Method Details

    • getAlgorithm

      Algorithm getAlgorithm(String algorithmUri)
      Gets the algorithm based on its URI.
      Parameters:
      algorithmUri - the algorithm URI
      Returns:
      the algorithm, or null if none is found
    • getAlgorithm

      <T extends Algorithm> T getAlgorithm(String algorithmUri, Class<T> clazz)
      Gets an algorithm based on its URI and type.
      Type Parameters:
      T - the algorithm type
      Parameters:
      algorithmUri - the algorithm URI
      clazz - the type representing the algorithm
      Returns:
      the algorithm, or null if none is found
    • getAlgorithm

      Algorithm getAlgorithm(Predicate<Algorithm> predicate)
      Gets the first algorithm that matches the supplied predicate.

      If more than one algorithm matches the supplied predicate, the one with the lowest order is returned.

      Parameters:
      predicate - the predicate to apply
      Returns:
      an Algorithm or null if no algorithms in the registry matches
      See Also:
    • getAlgorithm

      <T extends Algorithm> T getAlgorithm(Predicate<Algorithm> predicate, Class<T> clazz)
      Gets the first algorithm that matches the given type and supplied predicate.

      If more than one algorithm matches the supplied predicate, the one with the lowest order is returned.

      Parameters:
      predicate - the predicate to apply
      clazz - the type representing the algorithm
      Returns:
      an Algorithm or null if no algorithms in the registry matches
      See Also:
    • getAlgorithms

      List<Algorithm> getAlgorithms(Predicate<Algorithm> predicate)
      Gets all algorithms that matches the supplied predicate.

      The list is sorted with the lowest algorithms with the lowest order index first.

      Parameters:
      predicate - the predicate to apply
      Returns:
      a (possibly empty) list of Algorithm objects
    • getAlgorithms

      <T extends Algorithm> List<T> getAlgorithms(Predicate<Algorithm> predicate, Class<T> clazz)
      Gets all algorithms that matches the given type and the supplied predicate.

      The list is sorted with the lowest algorithms with the lowest order index first.

      Parameters:
      predicate - the predicate to apply
      clazz - the type representing the algorithm
      Returns:
      a (possibly empty) list of Algorithm objects