Class StorageServiceSAMLArtifactMap
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.saml.common.binding.artifact.impl.StorageServiceSAMLArtifactMap
-
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,SAMLArtifactMap
public class StorageServiceSAMLArtifactMap extends AbstractInitializableComponent implements SAMLArtifactMap
Artifact map implementation backed byStorageService
.
-
-
Nested Class Summary
-
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 Duration
artifactLifetime
Lifetime of an artifact.private StorageService
artifactStore
Artifact mapping storage.private int
artifactStoreKeySize
Maximum size of artifacts we can handle.private SAMLArtifactMap.SAMLArtifactMapEntryFactory
entryFactory
Factory for SAMLArtifactMapEntry instances.private org.slf4j.Logger
log
Class Logger.static String
STORAGE_CONTEXT
Storage context label.
-
Constructor Summary
Constructors Constructor Description StorageServiceSAMLArtifactMap()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(String artifact)
protected void
doInitialize()
SAMLArtifactMap.SAMLArtifactMapEntry
get(String artifact)
Duration
getArtifactLifetime()
Get the artifact entry lifetime.SAMLArtifactMap.SAMLArtifactMapEntryFactory
getEntryFactory()
Get the map entry factory.StorageService
getStorageService()
Get the artifact store.void
put(String artifact, String relyingPartyId, String issuerId, SAMLObject samlMessage)
void
remove(String artifact)
void
setArtifactLifetime(Duration lifetime)
Set the artifact entry lifetime.void
setEntryFactory(SAMLArtifactMap.SAMLArtifactMapEntryFactory factory)
Set the map entry factory.void
setStorageService(StorageService store)
Set the artifact store.-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
STORAGE_CONTEXT
@Nonnull @NotEmpty public static final String STORAGE_CONTEXT
Storage context label.
-
log
@Nonnull private final org.slf4j.Logger log
Class Logger.
-
artifactStore
@NonnullAfterInit private StorageService artifactStore
Artifact mapping storage.
-
artifactStoreKeySize
private int artifactStoreKeySize
Maximum size of artifacts we can handle.
-
artifactLifetime
@Nonnull private Duration artifactLifetime
Lifetime of an artifact.
-
entryFactory
@Nonnull private SAMLArtifactMap.SAMLArtifactMapEntryFactory entryFactory
Factory for SAMLArtifactMapEntry instances.
-
-
Method Detail
-
doInitialize
protected void doInitialize() throws ComponentInitializationException
- Overrides:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-
getStorageService
@NonnullAfterInit public StorageService getStorageService()
Get the artifact store.- Returns:
- the artifact store
-
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
-
setStorageService
public void setStorageService(@Nonnull StorageService store)
Set the artifact store.- Parameters:
store
- the artifact store
-
setArtifactLifetime
public void setArtifactLifetime(@Nonnull Duration lifetime)
Set the artifact entry lifetime.- Parameters:
lifetime
- artifact entry lifetime
-
setEntryFactory
public void setEntryFactory(@Nonnull SAMLArtifactMap.SAMLArtifactMapEntryFactory factory)
Set the map entry factory.In addition to implementing the
SAMLArtifactMap.SAMLArtifactMapEntryFactory
interface, the injected object must support theStorageSerializer
interface to enable entries to be stored via the injectedStorageService
instance.- Parameters:
factory
- map entry factory
-
contains
public boolean contains(@Nonnull @NotEmpty String artifact) throws IOException
- Specified by:
contains
in interfaceSAMLArtifactMap
- Throws:
IOException
-
get
@Nullable public SAMLArtifactMap.SAMLArtifactMapEntry get(@Nonnull @NotEmpty String artifact) throws IOException
- Specified by:
get
in 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:
put
in interfaceSAMLArtifactMap
- Throws:
IOException
-
remove
public void remove(@Nonnull @NotEmpty String artifact) throws IOException
- Specified by:
remove
in interfaceSAMLArtifactMap
- Throws:
IOException
-
-