Class AbstractOIDCMetadataResolver<MetadataIdentifier,MetadataType>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.oidc.metadata.impl.AbstractOIDCMetadataResolver<MetadataIdentifier,MetadataType>
- Type Parameters:
MetadataIdentifier- the type used to identify the metadataMetadataType- the metadata type
- All Implemented Interfaces:
OIDCMetadataResolver<MetadataType>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,Resolver<MetadataType,CriteriaSet>
- Direct Known Subclasses:
JSONMapMetadataResolver,OIDCMapBasedMetadataResolver,OIDCMetadataPolicyResolver,OIDCProviderMetadataResolver
public abstract class AbstractOIDCMetadataResolver<MetadataIdentifier,MetadataType>
extends AbstractIdentifiableInitializableComponent
implements OIDCMetadataResolver<MetadataType>
An abstract metadata resolver which supports any type of metadata.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MetadataCache<MetadataType>The metadata cache.private CriterionPredicateRegistry<MetadataType>Registry used in resolving predicates from criteria.private booleanWhether problems during initialization should cause the provider to fail or go on without metadata.private final org.slf4j.LoggerClass logger.private StringLogging prefix.private booleanFlag which determines whether predicates used in filtering are connected by a logical 'OR' (true) or by logical 'AND' (false). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractOIDCMetadataResolver(MetadataCache<MetadataType> metadataCache) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected final voidprotected MetadataCache<MetadataType>getCache()Get the metadata cache currently in use by the metadata resolver.Get the registry used in resolving predicates from criteria.protected StringReturn a prefix for logging messages for this component.protected abstract voidInitialise this metadata provider.booleanGets whether problems during initialization should cause the provider to fail or go on without metadata.booleanGet the flag indicating whether resolved credentials may satisfy any predicates (i.e.protected Iterable<MetadataType>predicateFilterCandidates(Iterable<MetadataType> candidates, CriteriaSet criteria, boolean onEmptyPredicatesReturnEmpty) Filter the supplied candidates by resolving predicates from the supplied criteria and applying the predicates to return a filteredIterable.resolve(CriteriaSet criteria) resolveSingle(CriteriaSet criteria) voidSet the registry used in resolving predicates from criteria.voidsetFailFastInitialization(boolean failFast) Sets whether problems during initialization should cause the provider to fail or go on without metadata.voidsetSatisfyAnyPredicates(boolean flag) Set the flag indicating whether resolved credentials may satisfy any predicates (i.e.Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
logPrefix
Logging prefix. -
cache
The metadata cache. -
satisfyAnyPredicates
private boolean satisfyAnyPredicatesFlag which determines whether predicates used in filtering are connected by a logical 'OR' (true) or by logical 'AND' (false). Defaults to false. -
criterionPredicateRegistry
Registry used in resolving predicates from criteria. -
failFastInitialization
private boolean failFastInitializationWhether problems during initialization should cause the provider to fail or go on without metadata. The assumption being that in most cases a provider will recover at some point in the future. Default: true.
-
-
Constructor Details
-
AbstractOIDCMetadataResolver
Constructor.- Parameters:
metadataCache- the metadata cache to use.
-
-
Method Details
-
getLogPrefix
Return a prefix for logging messages for this component.- Returns:
- a string for insertion at the beginning of any log messages
-
isSatisfyAnyPredicates
public boolean isSatisfyAnyPredicates()Get the flag indicating whether resolved credentials may satisfy any predicates (i.e. connected by logical 'OR') or all predicates (connected by logical 'AND').Defaults to false.
- Returns:
- true if must satisfy all, false otherwise
-
setSatisfyAnyPredicates
public void setSatisfyAnyPredicates(boolean flag) Set the flag indicating whether resolved credentials may satisfy any predicates (i.e. connected by logical 'OR') or all predicates (connected by logical 'AND').Defaults to false.
- Parameters:
flag- true if must satisfy all, false otherwise
-
getCriterionPredicateRegistry
Get the registry used in resolving predicates from criteria.- Returns:
- the effective registry instance used
-
getCache
Get the metadata cache currently in use by the metadata resolver.- Returns:
- the current effective entity backing store
-
isFailFastInitialization
public boolean isFailFastInitialization()Gets whether problems during initialization should cause the provider to fail or go on without metadata. The assumption being that in most cases a provider will recover at some point in the future.- Returns:
- whether problems during initialization should cause the provider to fail
-
setFailFastInitialization
public void setFailFastInitialization(boolean failFast) Sets whether problems during initialization should cause the provider to fail or go on without metadata. The assumption being that in most cases a provider will recover at some point in the future.- Parameters:
failFast- whether problems during initialization should cause the provider to fail
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
doDestroy
protected void doDestroy()- Overrides:
doDestroyin classAbstractInitializableComponent
-
initMetadataResolver
Initialise this metadata provider. Subclasses will need to override this method.- Throws:
ComponentInitializationException- if initialization fails.
-