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:
CollectionCredentialResolver,FilesystemCredentialResolver,KeyStoreCredentialResolver
public abstract class AbstractCriteriaFilteringCredentialResolver extends AbstractCredentialResolver
An abstract implementation ofCredentialResolverthat filters the returned Credentials based on the instances ofPredicatewhich are present in the set of criteria as instances ofEvaluableCredentialCriterion, or which are obtained via lookup in theEvaluableCredentialCriteriaRegistry.
-
-
Field Summary
Fields Modifier and Type Field Description private booleansatisfyAllPredicatesFlag which determines whether predicates used in filtering are connected by a logical 'AND' or by logical 'OR'.
-
Constructor Summary
Constructors Constructor Description AbstractCriteriaFilteringCredentialResolver()Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private Set<Predicate<Credential>>getPredicates(CriteriaSet criteriaSet)Construct a set of credential predicates based on the criteria set.booleanisSatisfyAllPredicates()Get the flag indicating whether resolved credentials must satisfy all predicates (i.e.Iterable<Credential>resolve(CriteriaSet criteriaSet)protected abstract Iterable<Credential>resolveFromSource(CriteriaSet criteriaSet)Subclasses are required to implement this method to resolve credentials from the implementation-specific type of underlying credential source.voidsetSatisfyAllPredicates(boolean flag)Set the flag indicating whether resolved credentials must satisfy all predicates (i.e.-
Methods inherited from class org.opensaml.security.credential.impl.AbstractCredentialResolver
resolveSingle
-
-
-
-
Method Detail
-
resolve
@Nonnull public Iterable<Credential> resolve(@Nullable CriteriaSet criteriaSet) throws ResolverException
- Specified by:
resolvein interfaceResolver<Credential,CriteriaSet>- Specified by:
resolvein classAbstractCredentialResolver- 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
-
-