Class AbstractOIDCEntityResolver<Key extends Identifier,Value>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.oidc.metadata.impl.AbstractOIDCEntityResolver<Key,Value>
- Type Parameters:
Key- The identifier type in the backing storeValue- The entity type in the backing store
- All Implemented Interfaces:
Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
- Direct Known Subclasses:
AbstractReloadingOIDCEntityResolver
public abstract class AbstractOIDCEntityResolver<Key extends Identifier,Value>
extends AbstractIdentifiableInitializableComponent
A base class for
Resolvers used for resolving entities containing identifiers based on Identifier.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classThe collection of data which provides the backing store for the processed metadata. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether problems during initialization should cause the provider to fail or go on without metadata.Backing store for runtime JSON data.private final org.slf4j.LoggerClass logger.private StringLogging prefix. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractOIDCEntityResolver<Key,Value>.JsonBackingStore Create a new backing store instance for entity data.protected voidprotected AbstractOIDCEntityResolver<Key,Value>.JsonBackingStore Get the entity backing store currently in use by the metadata resolver.protected StringReturn a prefix for logging messages for this component.protected voidindexEntityDescriptor(Value entityDescriptor, Key key, AbstractOIDCEntityResolver<Key, Value>.JsonBackingStore backingStore) Index the specified entity descriptor, updating the specified entity backing store instance as necessary.protected voidInitializes this resolver by creating a new backing store.booleanGets whether problems during initialization should cause the provider to fail or go on without metadata.lookupIdentifier(Key identifier) Get list of information matching a given identifier.lookupIndexedIdentifier(Key identifier) Lookup the specified identifier from the index.protected voidpreProcessEntityDescriptor(Value entityDescriptor, Key key, AbstractOIDCEntityResolver<Key, Value>.JsonBackingStore backingStore) Pre-process the specified entity descriptor, updating the specified entity backing store instance as necessary.protected voidremoveByIdentifier(Key identifier, AbstractOIDCEntityResolver<Key, Value>.JsonBackingStore backingStore) Remove from the backing store all metadata for the entity with the given identifier.protected voidsetBackingStore(AbstractOIDCEntityResolver<Key, Value>.JsonBackingStore newBackingStore) Set the entity backing store currently in use by the metadata resolver.voidsetFailFastInitialization(boolean failFast) Sets whether problems during initialization should cause the provider to fail or go on without metadata.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, doDestroy, 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. -
jsonBackingStore
@NonnullAfterInit private AbstractOIDCEntityResolver<Key extends Identifier,Value>.JsonBackingStore jsonBackingStoreBacking store for runtime JSON data. -
logPrefix
Logging prefix. -
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
-
AbstractOIDCEntityResolver
protected AbstractOIDCEntityResolver()Constructor.
-
-
Method Details
-
getLogPrefix
Return a prefix for logging messages for this component.- Returns:
- a string for insertion at the beginning of any log messages
-
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
-
initOIDCResolver
Initializes this resolver by creating a new backing store.- Throws:
ComponentInitializationException- If the initialization fails.
-
lookupIdentifier
@Nonnull @NonnullElements protected List<Value> lookupIdentifier(@Nonnull @NotEmpty Key identifier) throws ResolverException Get list of information matching a given identifier.- Parameters:
identifier- identifier to lookup- Returns:
- a list of information
- Throws:
ResolverException- if an error occurs
-
lookupIndexedIdentifier
@Nonnull @NonnullElements protected List<Value> lookupIndexedIdentifier(@Nonnull @NotEmpty Key identifier) Lookup the specified identifier from the index. The returned list will be a copy of what is stored in the backing index, and is safe to be manipulated by callers.- Parameters:
identifier- the identifier to lookup- Returns:
- list copy of indexed identifiers, may be empty, will never be null
-
preProcessEntityDescriptor
protected void preProcessEntityDescriptor(@Nonnull Value entityDescriptor, @Nonnull Key key, @Nonnull AbstractOIDCEntityResolver<Key, Value>.JsonBackingStore backingStore) Pre-process the specified entity descriptor, updating the specified entity backing store instance as necessary.- Parameters:
entityDescriptor- the target entity descriptor to processkey- key to entitybackingStore- the backing store instance to update
-
removeByIdentifier
protected void removeByIdentifier(@Nonnull Key identifier, @Nonnull AbstractOIDCEntityResolver<Key, Value>.JsonBackingStore backingStore) Remove from the backing store all metadata for the entity with the given identifier.- Parameters:
identifier- the identifier of the metadata to removebackingStore- the backing store instance to update
-
indexEntityDescriptor
protected void indexEntityDescriptor(@Nonnull Value entityDescriptor, @Nonnull Key key, @Nonnull AbstractOIDCEntityResolver<Key, Value>.JsonBackingStore backingStore) Index the specified entity descriptor, updating the specified entity backing store instance as necessary.- Parameters:
entityDescriptor- the target entity descriptor to processkey- key to entitybackingStore- the backing store instance to update
-
createNewBackingStore
Create a new backing store instance for entity data. Subclasses may override to return a more specialized subclass type. Note this method does not make the returned backing store the effective one in use. The caller is responsible for callingsetBackingStore(AbstractOIDCEntityResolver.JsonBackingStore)to make it the effective instance in use.- Returns:
- the new backing store instance
-
getBackingStore
@NonnullAfterInit protected AbstractOIDCEntityResolver<Key,Value>.JsonBackingStore getBackingStore()Get the entity backing store currently in use by the metadata resolver.- Returns:
- the current effective entity backing store
-
setBackingStore
protected void setBackingStore(@Nonnull AbstractOIDCEntityResolver<Key, Value>.JsonBackingStore newBackingStore) Set the entity backing store currently in use by the metadata resolver.- Parameters:
newBackingStore- the new entity backing store
-