Class ServiceableProviderMetadataProvider
- 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<ProviderMetadataResolver>
-
- net.shibboleth.idp.plugin.oidc.op.metadata.resolver.ServiceableProviderMetadataProvider
-
- All Implemented Interfaces:
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 ofProviderMetadataResolver. Based on net.shibboleth.idp.saml.metadata.RelyingPartyMetadataProvider.
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.private ProviderMetadataResolverresolverThe 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 ServiceableProviderMetadataProvider()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ServiceableProviderMetadataProvider other)protected voiddoInitialize()booleanequals(Object other).ProviderMetadataResolvergetComponent()ProviderMetadataResolvergetEmbeddedResolver()Return what we are build around.InstantgetLastRefresh()Gets the time the last refresh cycle occurred.InstantgetLastUpdate()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.voidsetId(String componentId)Sets the ID of this component.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.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 ProviderMetadataResolver 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 ProviderMetadataResolver theResolver)Set theProviderMetadataResolverto embed.- Parameters:
theResolver- TheProviderMetadataResolverto embed.
-
getEmbeddedResolver
@Nonnull public ProviderMetadataResolver 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
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractServiceableComponent<ProviderMetadataResolver>- Throws:
ComponentInitializationException
-
setId
public void setId(@Nonnull @NotEmpty String componentId)
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
@Nonnull public ProviderMetadataResolver getComponent()
- Specified by:
getComponentin interfaceServiceableComponent<ProviderMetadataResolver>- Specified by:
getComponentin classAbstractServiceableComponent<ProviderMetadataResolver>
-
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 interfaceRefreshableProviderMetadataResolver- Throws:
ResolverException- if the refresh operation was unsuccessful
-
getLastRefresh
public Instant getLastRefresh()
Gets the time the last refresh cycle occurred.- Specified by:
getLastRefreshin interfaceRefreshableProviderMetadataResolver- Returns:
- time the last refresh cycle occurred
-
getLastUpdate
public Instant 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
public int compareTo(ServiceableProviderMetadataProvider other)
- Specified by:
compareToin interfaceComparable<ServiceableProviderMetadataProvider>
-
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.
-
-