Class CollectionCredentialResolver

All Implemented Interfaces:
Resolver<Credential,CriteriaSet>, CredentialResolver
Direct Known Subclasses:
CollectionKeyInfoCredentialResolver

public class CollectionCredentialResolver extends AbstractCriteriaFilteringCredentialResolver
An implementation of CredentialResolver that uses a Collection as the underlying credential source.

The credentials returned are filtered based on any EvaluableCredentialCriterion that may have been present in the specified criteria set, or that are resolved by lookup in the EvaluableCredentialCriteriaRegistry.

  • Field Details

    • collection

      @Nonnull private final Collection<Credential> collection
      The collection of credentials which is the underlying store for the resolver.
  • Constructor Details

    • CollectionCredentialResolver

      public CollectionCredentialResolver()
      Constructor. An ArrayList is used as the underlying collection implementation.
    • CollectionCredentialResolver

      public CollectionCredentialResolver(@Nonnull @Live Collection<Credential> credentials)
      Constructor.
      Parameters:
      credentials - the credential collection which is the backing store for the resolver
  • Method Details

    • getCollection

      @Nonnull @Live public Collection<Credential> getCollection()
      Get the (modifiable) credential collection which is the backing store for the resolver.
      Returns:
      the credential collection backing store
    • resolveFromSource

      @Nonnull @Live protected 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.
      Specified by:
      resolveFromSource in class AbstractCriteriaFilteringCredentialResolver
      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