org.opensaml.common.binding.artifact
Class BasicSAMLArtifactMap

java.lang.Object
  extended by org.opensaml.common.binding.artifact.BasicSAMLArtifactMap
All Implemented Interfaces:
SAMLArtifactMap

public class BasicSAMLArtifactMap
extends Object
implements SAMLArtifactMap

Basic artifact map implementation that uses a StorageService to store and retrieve artifacts.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.opensaml.common.binding.artifact.SAMLArtifactMap
SAMLArtifactMap.SAMLArtifactMapEntry, SAMLArtifactMap.SAMLArtifactMapEntryFactory
 
Field Summary
private  long artifactLifetime
          Lifetime of an artifact in milliseconds.
private  StorageService<String,SAMLArtifactMap.SAMLArtifactMapEntry> artifactStore
          Artifact mapping storage.
static String DEFAULT_STORAGE_PARTITION
          The default StorageService partition name to use.
private  SAMLArtifactMap.SAMLArtifactMapEntryFactory entryFactory
          Factory for SAMLArtifactMapEntry instances.
private  org.slf4j.Logger log
          Class Logger.
private  String partition
          Storage service partition used by this cache.
 
Constructor Summary
BasicSAMLArtifactMap(ParserPool parser, StorageService<String,SAMLArtifactMap.SAMLArtifactMapEntry> storage, long lifetime)
          Deprecated. replacement BasicSAMLArtifactMap(StorageService, long)
BasicSAMLArtifactMap(SAMLArtifactMap.SAMLArtifactMapEntryFactory factory, StorageService<String,SAMLArtifactMap.SAMLArtifactMapEntry> storage, long lifetime)
          Constructor.
BasicSAMLArtifactMap(SAMLArtifactMap.SAMLArtifactMapEntryFactory factory, StorageService<String,SAMLArtifactMap.SAMLArtifactMapEntry> storage, String storageParition, long lifetime)
          Constructor.
BasicSAMLArtifactMap(StorageService<String,SAMLArtifactMap.SAMLArtifactMapEntry> storage, long lifetime)
          Constructor.
BasicSAMLArtifactMap(StorageService<String,SAMLArtifactMap.SAMLArtifactMapEntry> storage, String storageParition, long lifetime)
          Constructor.
 
Method Summary
 boolean contains(String artifact)
          Checks if a given artifact has a map entry.
 SAMLArtifactMap.SAMLArtifactMapEntry get(String artifact)
          Gets the artifact entry for the given artifact.
 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 remove(String artifact)
          Removes the artifact from this map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STORAGE_PARTITION

public static final String DEFAULT_STORAGE_PARTITION
The default StorageService partition name to use.

See Also:
Constant Field Values

log

private final org.slf4j.Logger log
Class Logger.


artifactStore

private StorageService<String,SAMLArtifactMap.SAMLArtifactMapEntry> artifactStore
Artifact mapping storage.


partition

private String partition
Storage service partition used by this cache. default: artifact


artifactLifetime

private long artifactLifetime
Lifetime of an artifact in milliseconds.


entryFactory

private SAMLArtifactMap.SAMLArtifactMapEntryFactory entryFactory
Factory for SAMLArtifactMapEntry instances.

Constructor Detail

BasicSAMLArtifactMap

public BasicSAMLArtifactMap(ParserPool parser,
                            StorageService<String,SAMLArtifactMap.SAMLArtifactMapEntry> storage,
                            long lifetime)
Deprecated. replacement BasicSAMLArtifactMap(StorageService, long)

Constructor.

Parameters:
parser - parser pool used to parse serialized messages. (Note: ParserPool arg is deprecated and no longer used).
storage - artifact mapping storage
lifetime - lifetime of an artifact in milliseconds

BasicSAMLArtifactMap

public BasicSAMLArtifactMap(StorageService<String,SAMLArtifactMap.SAMLArtifactMapEntry> storage,
                            long lifetime)
Constructor.

Parameters:
storage - artifact mapping storage
lifetime - lifetime of an artifact in milliseconds

BasicSAMLArtifactMap

public BasicSAMLArtifactMap(StorageService<String,SAMLArtifactMap.SAMLArtifactMapEntry> storage,
                            String storageParition,
                            long lifetime)
Constructor.

Parameters:
storage - artifact mapping storage
storageParition - name of storage service partition to use
lifetime - lifetime of an artifact in milliseconds

BasicSAMLArtifactMap

public BasicSAMLArtifactMap(SAMLArtifactMap.SAMLArtifactMapEntryFactory factory,
                            StorageService<String,SAMLArtifactMap.SAMLArtifactMapEntry> storage,
                            long lifetime)
Constructor.

Parameters:
factory - the SAML artifact map entry factory to use
storage - artifact mapping storage
lifetime - lifetime of an artifact in milliseconds

BasicSAMLArtifactMap

public BasicSAMLArtifactMap(SAMLArtifactMap.SAMLArtifactMapEntryFactory factory,
                            StorageService<String,SAMLArtifactMap.SAMLArtifactMapEntry> storage,
                            String storageParition,
                            long lifetime)
Constructor.

Parameters:
factory - the SAML artifact map entry factory to use
storage - artifact mapping storage
storageParition - name of storage service partition to use
lifetime - lifetime of an artifact in milliseconds
Method Detail

contains

public boolean contains(String artifact)
Checks if a given artifact has a map entry.

Specified by:
contains in interface SAMLArtifactMap
Parameters:
artifact - the artifact to check
Returns:
true of this map has an entry for the given artifact, false it not

get

public SAMLArtifactMap.SAMLArtifactMapEntry get(String artifact)
Gets the artifact entry for the given artifact.

Specified by:
get in interface SAMLArtifactMap
Parameters:
artifact - the artifact to retrieve the entry for
Returns:
the entry or null if the artifact has already expired or did not exist

put

public void put(String artifact,
                String relyingPartyId,
                String issuerId,
                SAMLObject samlMessage)
         throws MarshallingException
Creates a mapping between a given artifact and the SAML message to which it maps.

Specified by:
put in interface SAMLArtifactMap
Parameters:
artifact - the artifact
relyingPartyId - ID of the party the artifact was sent to
issuerId - ID of the issuer of the artifact
samlMessage - the SAML message
Throws:
MarshallingException - thrown if the given SAML message can not be marshalled

remove

public void remove(String artifact)
Removes the artifact from this map.

Specified by:
remove in interface SAMLArtifactMap
Parameters:
artifact - artifact to be removed


Copyright © 1999-2012. All Rights Reserved.