Package org.opensaml.security.credential.impl

# Class CollectionCredentialResolver

java.lang.Object
org.opensaml.security.credential.impl.AbstractCredentialResolver
org.opensaml.security.credential.impl.AbstractCriteriaFilteringCredentialResolver
org.opensaml.security.credential.impl.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 Summary

Fields
Modifier and Type
Field
Description
`private final Collection<Credential>`
`collection`
The collection of credentials which is the underlying store for the resolver.

## Constructor Summary

Constructors
Constructor
Description
`CollectionCredentialResolver()`
Constructor.
`CollectionCredentialResolver(Collection<Credential> credentials)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Collection<Credential>`
`getCollection()`
Get the (modifiable) credential collection which is the backing store for the resolver.
`protected Iterable<Credential>`
`resolveFromSource(CriteriaSet criteriaSet)`
Subclasses are required to implement this method to resolve credentials from the implementation-specific type of underlying credential source.

### Methods inherited from class org.opensaml.security.credential.impl.AbstractCriteriaFilteringCredentialResolver

`isSatisfyAllPredicates, resolve, setSatisfyAllPredicates`

### Methods inherited from class org.opensaml.security.credential.impl.AbstractCredentialResolver

`resolveSingle`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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