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 by
StorageService
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensaml.saml.common.binding.artifact.SAMLArtifactMap
SAMLArtifactMap.SAMLArtifactMapEntry, SAMLArtifactMap.SAMLArtifactMapEntryFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Duration
Lifetime of an artifact.private StorageService
Artifact mapping storage.private int
Maximum size of artifacts we can handle.Factory for SAMLArtifactMapEntry instances.private final org.slf4j.Logger
Class Logger.static final String
Storage context label. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if a given artifact has a map entry.protected void
Gets the artifact entry for the given artifact.Get the artifact entry lifetime.Get the map entry factory.Get the artifact store.void
put
(String artifact, String relyingPartyId, String issuerId, SAMLObject samlMessage) Creates a mapping between a given artifact and the SAML message to which it maps.void
Removes the artifact from this map.void
setArtifactLifetime
(Duration lifetime) Set the artifact entry lifetime.void
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 Details
-
STORAGE_CONTEXT
Storage context label. -
log
@Nonnull private final org.slf4j.Logger logClass Logger. -
artifactStore
Artifact mapping storage. -
artifactStoreKeySize
private int artifactStoreKeySizeMaximum size of artifacts we can handle. -
artifactLifetime
Lifetime of an artifact. -
entryFactory
Factory for SAMLArtifactMapEntry instances.
-
-
Constructor Details
-
StorageServiceSAMLArtifactMap
public StorageServiceSAMLArtifactMap()Constructor.
-
-
Method Details
-
doInitialize
- Overrides:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-
getStorageService
Get the artifact store.- Returns:
- the artifact store
-
getArtifactLifetime
Get the artifact entry lifetime.- Returns:
- the artifact entry lifetime
-
getEntryFactory
Get the map entry factory.- Returns:
- the map entry factory
-
setStorageService
Set the artifact store.- Parameters:
store
- the artifact store
-
setArtifactLifetime
Set the artifact entry lifetime.- Parameters:
lifetime
- artifact entry lifetime
-
setEntryFactory
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
Checks if a given artifact has a map entry.- Specified by:
contains
in interfaceSAMLArtifactMap
- Parameters:
artifact
- the artifact to check- Returns:
- true iff this map has an entry for the given artifact
- Throws:
IOException
- if an error occurs retrieving the information
-
get
@Nullable public SAMLArtifactMap.SAMLArtifactMapEntry get(@Nonnull @NotEmpty String artifact) throws IOException Gets the artifact entry for the given artifact.- Specified by:
get
in interfaceSAMLArtifactMap
- Parameters:
artifact
- the artifact to retrieve the entry for- Returns:
- the entry, or null if the artifact has already expired or did not exist
- Throws:
IOException
- if an error occurs retrieving the information
-
put
public void put(@Nonnull @NotEmpty String artifact, @Nonnull @NotEmpty String relyingPartyId, @Nonnull @NotEmpty String issuerId, @Nonnull SAMLObject samlMessage) throws IOException Creates a mapping between a given artifact and the SAML message to which it maps.- Specified by:
put
in interfaceSAMLArtifactMap
- Parameters:
artifact
- the artifactrelyingPartyId
- ID of the party the artifact was sent toissuerId
- ID of the issuer of the artifactsamlMessage
- the SAML message- Throws:
IOException
- if an error occurs storing the information
-
remove
Removes the artifact from this map.- Specified by:
remove
in interfaceSAMLArtifactMap
- Parameters:
artifact
- artifact to be removed- Throws:
IOException
- if an error occurs retrieving the information
-