Package net.shibboleth.oidc.metadata
Class RelyingPartyClientInformationProvider
- 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.ext.spring.service.AbstractServiceableComponent<ClientInformationResolver>
-
- net.shibboleth.oidc.metadata.RelyingPartyClientInformationProvider
-
- All Implemented Interfaces:
Comparable<RelyingPartyClientInformationProvider>,ClientInformationResolver,RefreshableClientInformationResolver,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,Resolver<com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation,CriteriaSet>,ServiceableComponent<ClientInformationResolver>,Aware,ApplicationContextAware
public class RelyingPartyClientInformationProvider extends AbstractServiceableComponent<ClientInformationResolver> implements RefreshableClientInformationResolver, Comparable<RelyingPartyClientInformationProvider>
This class exists primarily to allow the parsing of relying-party.xml to create a serviceable implementation ofClientInformationResolver. Based on net.shibboleth.idp.saml.metadata.RelyingPartyMetadataProvider.
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.private ClientInformationResolverresolverThe embedded resolver.private IntegersortKeyThe key by which we sort the provider.private static intsortKeyValueIf we autogenerate a sort key it comes from this count.
-
Constructor Summary
Constructors Constructor Description RelyingPartyClientInformationProvider()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(RelyingPartyClientInformationProvider other)protected voiddoInitialize()booleanequals(Object other).ClientInformationResolvergetComponent()ClientInformationResolvergetEmbeddedResolver()Return what we are build around.InstantgetLastRefresh()Gets the time the last refresh cycle occurred.InstantgetLastUpdate()Get the time that the currently available client information was last updated.inthashCode()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)voidsetEmbeddedResolver(ClientInformationResolver theResolver)Set theClientInformationResolverto embed.voidsetSortKey(int key)Set the sort key.-
Methods inherited from class net.shibboleth.ext.spring.service.AbstractServiceableComponent
doDestroy, getApplicationContext, pinComponent, setApplicationContext, unloadComponent, unpinComponent
-
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, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getId
-
-
-
-
Field Detail
-
sortKeyValue
private static int sortKeyValue
If we autogenerate a sort key it comes from this count.
-
log
private final org.slf4j.Logger log
Class logger.
-
resolver
@NonnullAfterInit private ClientInformationResolver resolver
The embedded resolver.
-
sortKey
@NonnullAfterInit private Integer sortKey
The key by which we sort the provider.
-
-
Method Detail
-
setSortKey
public void setSortKey(int key)
Set the sort key.- Parameters:
key- what to set
-
setEmbeddedResolver
@Nonnull public void setEmbeddedResolver(@Nonnull ClientInformationResolver theResolver)Set theClientInformationResolverto embed.- Parameters:
theResolver- TheClientInformationResolverto embed.
-
getEmbeddedResolver
@Nonnull public ClientInformationResolver getEmbeddedResolver()
Return what we are build around. Used for testing.- Returns:
- the parameter we got as a constructor
-
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
-
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
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractServiceableComponent<ClientInformationResolver>- Throws:
ComponentInitializationException
-
getComponent
@Nonnull public ClientInformationResolver getComponent()
- Specified by:
getComponentin interfaceServiceableComponent<ClientInformationResolver>- Specified by:
getComponentin classAbstractServiceableComponent<ClientInformationResolver>
-
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
-
getLastRefresh
public Instant getLastRefresh()
Gets the time the last refresh cycle occurred.- Specified by:
getLastRefreshin interfaceRefreshableClientInformationResolver- Returns:
- time the last refresh cycle occurred
-
getLastUpdate
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
-
compareTo
public int compareTo(RelyingPartyClientInformationProvider other)
- Specified by:
compareToin interfaceComparable<RelyingPartyClientInformationProvider>
-
equals
public boolean equals(Object other)
. We are within a spring context and so equality can be determined by ID, however we also test by sortKey just in case.
-
-