Class ChainingProviderMetadataResolver
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.oidc.metadata.impl.ChainingProviderMetadataResolver
- All Implemented Interfaces:
ProviderMetadataResolver,RefreshableProviderMetadataResolver,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,Resolver<OIDCProviderMetadata,CriteriaSet>
public class ChainingProviderMetadataResolver
extends AbstractIdentifiableInitializableComponent
implements RefreshableProviderMetadataResolver
A provider metadata provider that uses registered resolvers, in turn, to answer queries.
The Iterable of provider metadata returned is the first non-null and non-empty Iterable found while iterating over
the registered resolvers in resolver list order.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.private List<ProviderMetadataResolver>Registered resolvers. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcountClients(ProviderMetadataResolver resolver) Counts the clients found from the given resolver.protected voidprotected voidGets the time the last refresh cycle occurred.Get the time that the currently available metadata was last updated.Get an immutable the list of currently registered resolvers.voidrefresh()Refresh the data exposed by the resolver.resolve(CriteriaSet criteria) resolveSingle(CriteriaSet criteria) voidsetResolvers(List<? extends ProviderMetadataResolver> newResolvers) Set the registered provider metadata resolvers.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. -
resolvers
Registered resolvers.
-
-
Constructor Details
-
ChainingProviderMetadataResolver
public ChainingProviderMetadataResolver()Constructor.
-
-
Method Details
-
getResolvers
@Nonnull @NonnullElements @Unmodifiable @NotLive public List<ProviderMetadataResolver> getResolvers()Get an immutable the list of currently registered resolvers.- Returns:
- list of currently registered resolvers
-
setResolvers
public void setResolvers(@Nullable @NonnullElements List<? extends ProviderMetadataResolver> newResolvers) throws ResolverException Set the registered provider metadata resolvers.- Parameters:
newResolvers- the provider metadata resolvers to use- Throws:
ResolverException- thrown if there is a problem adding the provider metadata resolvers
-
refresh
Refresh the data exposed by the resolver.An implementation of this method should typically be either
synchronizedor make use other locking mechanisms to protect against concurrent access.- Specified by:
refreshin interfaceRefreshableProviderMetadataResolver- Throws:
ResolverException- if the refresh operation was unsuccessful
-
getLastUpdate
Get the time that the currently available metadata was last updated. Note, this may be different than the time retrieved byRefreshableProviderMetadataResolver.getLastRefresh()if the metadata was known not to have changed during the last refresh cycle.- Specified by:
getLastUpdatein interfaceRefreshableProviderMetadataResolver- Returns:
- time when the currently metadata was last updated,
nullif it has never successfully been read
-
getLastRefresh
Gets the time the last refresh cycle occurred.- Specified by:
getLastRefreshin interfaceRefreshableProviderMetadataResolver- Returns:
- time the last refresh cycle occurred
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
doDestroy
protected void doDestroy()- Overrides:
doDestroyin classAbstractInitializableComponent
-
countClients
Counts the clients found from the given resolver.- Parameters:
resolver- The resolver whose clients are counted.- Returns:
- The amount of resolvable clients.
-