Class BasicSAMLArtifactMap
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.saml.common.binding.artifact.impl.BasicSAMLArtifactMap
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,SAMLArtifactMap
public class BasicSAMLArtifactMap extends AbstractInitializableComponent implements SAMLArtifactMap
Basic artifact map implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classBasicSAMLArtifactMap.CleanupA cleanup task that relies on the weakly consistent iterator support in the map implementation.-
Nested classes/interfaces inherited from interface org.opensaml.saml.common.binding.artifact.SAMLArtifactMap
SAMLArtifactMap.SAMLArtifactMapEntry, SAMLArtifactMap.SAMLArtifactMapEntryFactory
-
-
Field Summary
Fields Modifier and Type Field Description private DurationartifactLifetimeLifetime of an artifact.private Map<String,ExpiringSAMLArtifactMapEntry>artifactStoreArtifact mapping storage.private DurationcleanupIntervalTime between cleanup checks.private TimerTaskcleanupTaskTask that cleans up expired records.private TimercleanupTaskTimerTimer used to schedule cleanup tasks.private SAMLArtifactMap.SAMLArtifactMapEntryFactoryentryFactoryFactory for SAMLArtifactMapEntry instances.private org.slf4j.LoggerlogClass Logger.
-
Constructor Summary
Constructors Constructor Description BasicSAMLArtifactMap()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(String artifact)protected voiddoDestroy()protected voiddoInitialize()SAMLArtifactMap.SAMLArtifactMapEntryget(String artifact)DurationgetArtifactLifetime()Get the artifact entry lifetime.SAMLArtifactMap.SAMLArtifactMapEntryFactorygetEntryFactory()Get the map entry factory.voidput(String artifact, String relyingPartyId, String issuerId, SAMLObject samlMessage)voidremove(String artifact)voidsetArtifactLifetime(Duration lifetime)Set the artifact entry lifetime.voidsetCleanupInterval(Duration interval)Set the cleanup interval, or 0 for none.voidsetEntryFactory(SAMLArtifactMap.SAMLArtifactMapEntryFactory factory)Set the map entry factory.-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class Logger.
-
artifactStore
@NonnullAfterInit private Map<String,ExpiringSAMLArtifactMapEntry> artifactStore
Artifact mapping storage.
-
artifactLifetime
@Nonnull private Duration artifactLifetime
Lifetime of an artifact.
-
entryFactory
@Nonnull private SAMLArtifactMap.SAMLArtifactMapEntryFactory entryFactory
Factory for SAMLArtifactMapEntry instances.
-
cleanupInterval
@Nonnull private Duration cleanupInterval
Time between cleanup checks. Default value: (5 mins)
-
cleanupTaskTimer
@NonnullAfterInit private Timer cleanupTaskTimer
Timer used to schedule cleanup tasks.
-
cleanupTask
@Nullable private TimerTask cleanupTask
Task that cleans up expired records.
-
-
Method Detail
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doDestroy
protected void doDestroy()
- Overrides:
doDestroyin classAbstractInitializableComponent
-
getArtifactLifetime
@Nonnull public Duration getArtifactLifetime()
Get the artifact entry lifetime.- Returns:
- the artifact entry lifetime
-
getEntryFactory
@Nonnull public SAMLArtifactMap.SAMLArtifactMapEntryFactory getEntryFactory()
Get the map entry factory.- Returns:
- the map entry factory
-
setArtifactLifetime
public void setArtifactLifetime(@Nonnull Duration lifetime)Set the artifact entry lifetime.- Parameters:
lifetime- artifact entry lifetime
-
setCleanupInterval
public void setCleanupInterval(@Nonnull Duration interval)Set the cleanup interval, or 0 for none.- Parameters:
interval- cleanup interval
-
setEntryFactory
public void setEntryFactory(@Nonnull SAMLArtifactMap.SAMLArtifactMapEntryFactory factory)Set the map entry factory.- Parameters:
factory- map entry factory
-
contains
public boolean contains(@Nonnull @NotEmpty String artifact) throws IOException
- Specified by:
containsin interfaceSAMLArtifactMap- Throws:
IOException
-
get
@Nullable public SAMLArtifactMap.SAMLArtifactMapEntry get(@Nonnull @NotEmpty String artifact) throws IOException
- Specified by:
getin interfaceSAMLArtifactMap- Throws:
IOException
-
put
public void put(@Nonnull @NotEmpty String artifact, @Nonnull @NotEmpty String relyingPartyId, @Nonnull @NotEmpty String issuerId, @Nonnull SAMLObject samlMessage) throws IOException
- Specified by:
putin interfaceSAMLArtifactMap- Throws:
IOException
-
remove
public void remove(@Nonnull @NotEmpty String artifact) throws IOException
- Specified by:
removein interfaceSAMLArtifactMap- Throws:
IOException
-
-