Class ChainingClientInformationResolver
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
-
- net.shibboleth.oidc.metadata.impl.ChainingClientInformationResolver
-
- All Implemented Interfaces:
ClientInformationResolver,RefreshableClientInformationResolver,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,Resolver<com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation,CriteriaSet>
public class ChainingClientInformationResolver extends AbstractIdentifiableInitializableComponent implements RefreshableClientInformationResolver
A client information provider that uses registered resolvers, in turn, to answer queries. The Iterable of client informations returned is the first non-null and non-empty Iterable found while iterating over the registered resolvers in resolver list order.
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.private List<ClientInformationResolver>resolversRegistered resolvers.
-
Constructor Summary
Constructors Constructor Description ChainingClientInformationResolver()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcountClients(ClientInformationResolver resolver)Counts the clients found from the given resolver.protected voiddoDestroy()protected voiddoInitialize()InstantgetLastRefresh()Gets the time the last refresh cycle occurred.InstantgetLastUpdate()Get the time that the currently available client information was last updated.List<ClientInformationResolver>getResolvers()Get an immutable the list of currently registered resolvers.voidrefresh()Refresh the data exposed by the resolver.Iterable<com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation>resolve(CriteriaSet criteria)com.nimbusds.openid.connect.sdk.rp.OIDCClientInformationresolveSingle(CriteriaSet criteria)voidsetResolvers(List<? extends ClientInformationResolver> newResolvers)Set the registered client information resolvers.-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getId
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
resolvers
@Nonnull @NonnullElements private List<ClientInformationResolver> resolvers
Registered resolvers.
-
-
Method Detail
-
getResolvers
@Nonnull @NonnullElements @Unmodifiable @NotLive public List<ClientInformationResolver> getResolvers()
Get an immutable the list of currently registered resolvers.- Returns:
- list of currently registered resolvers
-
setResolvers
public void setResolvers(@Nullable @NonnullElements List<? extends ClientInformationResolver> newResolvers) throws ResolverException
Set the registered client information resolvers.- Parameters:
newResolvers- the client information resolvers to use- Throws:
ResolverException- thrown if there is a problem adding the client information resolvers
-
resolveSingle
@Nullable public com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation resolveSingle(@Nullable CriteriaSet criteria) throws ResolverException- Specified by:
resolveSinglein interfaceResolver<com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation,CriteriaSet>- Throws:
ResolverException
-
resolve
@Nonnull public Iterable<com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation> resolve(@Nullable CriteriaSet criteria) throws ResolverException
- Specified by:
resolvein interfaceResolver<com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation,CriteriaSet>- Throws:
ResolverException
-
refresh
public void refresh() throws ResolverExceptionRefresh 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 interfaceRefreshableClientInformationResolver- Throws:
ResolverException- if the refresh operation was unsuccessful
-
getLastUpdate
@Nullable public Instant getLastUpdate()
Get the time that the currently available client information was last updated. Note, this may be different than the time retrieved byRefreshableClientInformationResolver.getLastRefresh()is the client information was known not to have changed during the last refresh cycle.- Specified by:
getLastUpdatein interfaceRefreshableClientInformationResolver- Returns:
- time when the currently client information was last updated, null if it has never successfully been read in
-
getLastRefresh
@Nullable public Instant getLastRefresh()
Gets the time the last refresh cycle occurred.- Specified by:
getLastRefreshin interfaceRefreshableClientInformationResolver- Returns:
- time the last refresh cycle occurred
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
doDestroy
protected void doDestroy()
- Overrides:
doDestroyin classAbstractInitializableComponent
-
countClients
protected int countClients(ClientInformationResolver resolver)
Counts the clients found from the given resolver.- Parameters:
resolver- The resolver whose clients are counted.- Returns:
- The amount of resolvable clients.
-
-