Class ServiceableProviderMetadataProvider
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.shared.spring.service.AbstractServiceableComponent<ProviderMetadataResolver>
net.shibboleth.idp.plugin.oidc.op.metadata.resolver.ServiceableProviderMetadataProvider
- All Implemented Interfaces:
AutoCloseable,Comparable<ServiceableProviderMetadataProvider>,ProviderMetadataResolver,RefreshableProviderMetadataResolver,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,Resolver<com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata,,ProfileRequestContext> ServiceableComponent<ProviderMetadataResolver>,Aware,ApplicationContextAware
public class ServiceableProviderMetadataProvider
extends AbstractServiceableComponent<ProviderMetadataResolver>
implements RefreshableProviderMetadataResolver, Comparable<ServiceableProviderMetadataProvider>
A serviceable implementation of
ProviderMetadataResolver.
Based on net.shibboleth.idp.saml.metadata.RelyingPartyMetadataProvider.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.private ProviderMetadataResolverThe embedded resolver.private IntegerThe key by which we sort the provider.private static intIf we autogenerate a sort key it comes from this count. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintprotected voidboolean.Return what we are build around.Gets the time the last refresh cycle occurred.Get the time that the currently available metadata was last updated.inthashCode()voidrefresh()Refresh the data exposed by the resolver.Iterable<com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata>resolve(ProfileRequestContext profileRequestContext) com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadataresolveSingle(ProfileRequestContext profileRequestContext) voidsetEmbeddedResolver(ProviderMetadataResolver theResolver) Set theProviderMetadataResolverto embed.voidSets the ID of this component.voidsetSortKey(int key) Set the sort key.Methods inherited from class net.shibboleth.shared.spring.service.AbstractServiceableComponent
close, doDestroy, getApplicationContext, pinComponent, setApplicationContext, unloadComponent, unpinComponentMethods 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, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
sortKeyValue
private static int sortKeyValueIf we autogenerate a sort key it comes from this count. -
log
private final org.slf4j.Logger logClass logger. -
resolver
The embedded resolver. -
sortKey
The key by which we sort the provider.
-
-
Constructor Details
-
ServiceableProviderMetadataProvider
public ServiceableProviderMetadataProvider()Constructor.
-
-
Method Details
-
setSortKey
public void setSortKey(int key) Set the sort key.- Parameters:
key- what to set
-
setEmbeddedResolver
Set theProviderMetadataResolverto embed.- Parameters:
theResolver- TheProviderMetadataResolverto embed.
-
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.op.OIDCProviderMetadata> resolve(ProfileRequestContext profileRequestContext) throws ResolverException - Specified by:
resolvein interfaceResolver<com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata,ProfileRequestContext> - Throws:
ResolverException
-
resolveSingle
@Nullable public com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata resolveSingle(@Nullable ProfileRequestContext profileRequestContext) throws ResolverException - Specified by:
resolveSinglein interfaceResolver<com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata,ProfileRequestContext> - Throws:
ResolverException
-
doInitialize
- Overrides:
doInitializein classAbstractServiceableComponent<ProviderMetadataResolver>- Throws:
ComponentInitializationException
-
setId
Sets the ID of this component. The component must not yet be initialized.- Specified by:
setIdin interfaceIdentifiableComponent- Overrides:
setIdin classAbstractIdentifiableInitializableComponent- Parameters:
componentId- ID of the component
-
getComponent
- Specified by:
getComponentin interfaceServiceableComponent<ProviderMetadataResolver>- Specified by:
getComponentin classAbstractServiceableComponent<ProviderMetadataResolver>
-
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
-
getLastRefresh
Gets the time the last refresh cycle occurred.- Specified by:
getLastRefreshin interfaceRefreshableProviderMetadataResolver- Returns:
- time the last refresh cycle occurred
-
getLastUpdate
Get the time that the currently available metadata was last updated. Note, this may be different than the time retrieved byRefreshableProviderMetadataResolver.getLastRefresh()is 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, null if it has never successfully been read in
-
compareTo
- Specified by:
compareToin interfaceComparable<ServiceableProviderMetadataProvider>
-
equals
. We are within a spring context and so equality can be determined by ID, however we also test by sortKey just in case. -
hashCode
public int hashCode()
-