Class AbstractCriteriaFilteringCredentialResolver

java.lang.Object
org.opensaml.security.credential.impl.AbstractCredentialResolver
org.opensaml.security.credential.impl.AbstractCriteriaFilteringCredentialResolver
All Implemented Interfaces:
Resolver<Credential,CriteriaSet>, CredentialResolver
Direct Known Subclasses:
BasicProviderKeyInfoCredentialResolver, CollectionCredentialResolver, FilesystemCredentialResolver, KeyStoreCredentialResolver, MetadataCredentialResolver

public abstract class AbstractCriteriaFilteringCredentialResolver extends AbstractCredentialResolver
An abstract implementation of CredentialResolver that filters the returned Credentials based on the instances of Predicate which are present in the set of criteria as instances of EvaluableCredentialCriterion, or which are obtained via lookup in the EvaluableCredentialCriteriaRegistry.
  • Field Details

    • satisfyAllPredicates

      private boolean satisfyAllPredicates
      Flag which determines whether predicates used in filtering are connected by a logical 'AND' or by logical 'OR'.
  • Constructor Details

    • AbstractCriteriaFilteringCredentialResolver

      public AbstractCriteriaFilteringCredentialResolver()
      Constructor.
  • Method Details

    • resolve

      @Nonnull public Iterable<Credential> resolve(@Nullable CriteriaSet criteriaSet) throws ResolverException
      Specified by:
      resolve in interface Resolver<Credential,CriteriaSet>
      Specified by:
      resolve in class AbstractCredentialResolver
      Throws:
      ResolverException
    • isSatisfyAllPredicates

      public boolean isSatisfyAllPredicates()
      Get the flag indicating whether resolved credentials must satisfy all predicates (i.e. connected by logical 'AND') or only one or more (connected by logical 'OR').
      Returns:
      true if must satisfy all, false otherwise
    • setSatisfyAllPredicates

      public void setSatisfyAllPredicates(boolean flag)
      Set the flag indicating whether resolved credentials must satisfy all predicates (i.e. connected by logical 'AND') or only one or more (connected by logical 'OR').
      Parameters:
      flag - true if must satisfy all, false otherwise
    • resolveFromSource

      @Nonnull protected abstract Iterable<Credential> resolveFromSource(@Nullable CriteriaSet criteriaSet) throws ResolverException
      Subclasses are required to implement this method to resolve credentials from the implementation-specific type of underlying credential source.
      Parameters:
      criteriaSet - the set of criteria used to resolve credentials from the credential source
      Returns:
      an Iterable for the resolved set of credentials
      Throws:
      ResolverException - thrown if there is an error resolving credentials from the credential source
    • getPredicates

      private Set<Predicate<Credential>> getPredicates(@Nullable CriteriaSet criteriaSet) throws ResolverException
      Construct a set of credential predicates based on the criteria set.
      Parameters:
      criteriaSet - the set of credential criteria to process.
      Returns:
      a set of Credential predicates
      Throws:
      ResolverException - thrown if there is an error obtaining an instance of EvaluableCredentialCriterion from the EvaluableCredentialCriteriaRegistry