public class BasicSAMLArtifactMap extends net.shibboleth.utilities.java.support.component.AbstractInitializableComponent implements SAMLArtifactMap
| Modifier and Type | Class and Description |
|---|---|
protected class |
BasicSAMLArtifactMap.Cleanup
A cleanup task that relies on the weakly consistent iterator support in the map implementation.
|
SAMLArtifactMap.SAMLArtifactMapEntry, SAMLArtifactMap.SAMLArtifactMapEntryFactory| Modifier and Type | Field and Description |
|---|---|
private long |
artifactLifetime
Lifetime of an artifact in milliseconds.
|
private java.util.Map<java.lang.String,ExpiringSAMLArtifactMapEntry> |
artifactStore
Artifact mapping storage.
|
private long |
cleanupInterval
Number of seconds between cleanup checks.
|
private java.util.TimerTask |
cleanupTask
Task that cleans up expired records.
|
private java.util.Timer |
cleanupTaskTimer
Timer used to schedule cleanup tasks.
|
private SAMLArtifactMap.SAMLArtifactMapEntryFactory |
entryFactory
Factory for SAMLArtifactMapEntry instances.
|
private org.slf4j.Logger |
log
Class Logger.
|
| Constructor and Description |
|---|
BasicSAMLArtifactMap()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.String artifact)
Checks if a given artifact has a map entry.
|
protected void |
doDestroy() |
protected void |
doInitialize() |
SAMLArtifactMap.SAMLArtifactMapEntry |
get(java.lang.String artifact)
Gets the artifact entry for the given artifact.
|
long |
getArtifactLifetime()
Get the artifact entry lifetime in milliseconds.
|
SAMLArtifactMap.SAMLArtifactMapEntryFactory |
getEntryFactory()
Get the map entry factory.
|
void |
put(java.lang.String artifact,
java.lang.String relyingPartyId,
java.lang.String issuerId,
SAMLObject samlMessage)
Creates a mapping between a given artifact and the SAML message to which it maps.
|
void |
remove(java.lang.String artifact)
Removes the artifact from this map.
|
void |
setArtifactLifetime(long lifetime)
Set the artifact entry lifetime in milliseconds.
|
void |
setCleanupInterval(long interval)
Set the cleanup interval in milliseconds, or 0 for none.
|
void |
setEntryFactory(SAMLArtifactMap.SAMLArtifactMapEntryFactory factory)
Set the map entry factory.
|
@Nonnull private final org.slf4j.Logger log
@NonnullAfterInit private java.util.Map<java.lang.String,ExpiringSAMLArtifactMapEntry> artifactStore
@Duration @Positive private long artifactLifetime
@Nonnull private SAMLArtifactMap.SAMLArtifactMapEntryFactory entryFactory
@Duration @NonNegative private long cleanupInterval
@NonnullAfterInit private java.util.Timer cleanupTaskTimer
@Nullable private java.util.TimerTask cleanupTask
protected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponentnet.shibboleth.utilities.java.support.component.ComponentInitializationExceptionprotected void doDestroy()
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent@Positive public long getArtifactLifetime()
@Nonnull public SAMLArtifactMap.SAMLArtifactMapEntryFactory getEntryFactory()
public void setArtifactLifetime(@Duration @Positive
long lifetime)
lifetime - artifact entry lifetime in millisecondspublic void setCleanupInterval(@Duration @NonNegative
long interval)
interval - cleanup interval in millisecondspublic void setEntryFactory(@Nonnull
SAMLArtifactMap.SAMLArtifactMapEntryFactory factory)
factory - map entry factorypublic boolean contains(@Nonnull @NotEmpty
java.lang.String artifact)
throws java.io.IOException
contains in interface SAMLArtifactMapartifact - the artifact to checkjava.io.IOException - if an error occurs retrieving the information@Nullable public SAMLArtifactMap.SAMLArtifactMapEntry get(@Nonnull @NotEmpty java.lang.String artifact) throws java.io.IOException
get in interface SAMLArtifactMapartifact - the artifact to retrieve the entry forjava.io.IOException - if an error occurs retrieving the informationpublic void put(@Nonnull @NotEmpty
java.lang.String artifact,
@Nonnull @NotEmpty
java.lang.String relyingPartyId,
@Nonnull @NotEmpty
java.lang.String issuerId,
@Nonnull
SAMLObject samlMessage)
throws java.io.IOException
put in interface SAMLArtifactMapartifact - the artifactrelyingPartyId - ID of the party the artifact was sent toissuerId - ID of the issuer of the artifactsamlMessage - the SAML messagejava.io.IOException - if an error occurs storing the informationpublic void remove(@Nonnull @NotEmpty
java.lang.String artifact)
throws java.io.IOException
remove in interface SAMLArtifactMapartifact - artifact to be removedjava.io.IOException - if an error occurs retrieving the information