Package org.opensaml.saml.common.binding.artifact.impl

# Class StorageServiceSAMLArtifactMapEntryFactory

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.saml.common.binding.artifact.impl.StorageServiceSAMLArtifactMapEntryFactory

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `SAMLArtifactMap.SAMLArtifactMapEntryFactory`, `StorageSerializer<SAMLArtifactMap.SAMLArtifactMapEntry>`

public class StorageServiceSAMLArtifactMapEntryFactory extends AbstractInitializableComponent implements SAMLArtifactMap.SAMLArtifactMapEntryFactory, StorageSerializer<SAMLArtifactMap.SAMLArtifactMapEntry>
A factory and `StorageSerializer` for instances of `BasicSAMLArtifactMapEntry`.

This implements serialization of an entry by wrapping the XML-based message in a parent element that tracks the additional associated data.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.
`private ParserPool`
`parserPool`
XML parsing component.

## Constructor Summary

Constructors
Constructor
Description
`StorageServiceSAMLArtifactMapEntryFactory()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`SAMLArtifactMap.SAMLArtifactMapEntry`
`deserialize(long version, String context, String key, String value, Long expiration)`
Returns an object recovered from a string produced through the `StorageSerializer.serialize(Type)` method.
`ParserPool`
`getParserPool()`
Gets the parser pool used to parse serialized data.
`SAMLArtifactMap.SAMLArtifactMapEntry`
`newEntry(String artifact, String issuerId, String relyingPartyId, SAMLObject samlMessage)`
Factory method which produces a `SAMLArtifactMap.SAMLArtifactMapEntry`.
`String`
`serialize(SAMLArtifactMap.SAMLArtifactMapEntry instance)`
Returns a string representing the input object.
`void`
`setParserPool(ParserPool pool)`
Sets the parser pool used to parse serialized data.

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### parserPool

@Nonnull private ParserPool parserPool
XML parsing component.

## Constructor Details

### StorageServiceSAMLArtifactMapEntryFactory

public StorageServiceSAMLArtifactMapEntryFactory()
Constructor.

## Method Details

### getParserPool

@Nonnull public ParserPool getParserPool()
Gets the parser pool used to parse serialized data.

Returns:
  parser pool used to parse serialized data

### setParserPool

public void setParserPool(@Nonnull ParserPool pool)
Sets the parser pool used to parse serialized data.

Parameters:
  `pool` - parser pool used to parse serialized data

### newEntry

@Nonnull public SAMLArtifactMap.SAMLArtifactMapEntry newEntry(@Nonnull @NotEmpty String artifact, @Nonnull @NotEmpty String issuerId, @Nonnull @NotEmpty String relyingPartyId, @Nonnull SAMLObject samlMessage)
Factory method which produces a `SAMLArtifactMap.SAMLArtifactMapEntry`.

Specified by:
  `newEntry` in interface `SAMLArtifactMap.SAMLArtifactMapEntryFactory`
Parameters:
  `artifact` - the artifact
  `issuerId` - ID of the issuer of the artifact
  `relyingPartyId` - ID of the party the artifact was sent to
  `samlMessage` - the SAML message
Returns:
  the new map entry instance

### serialize

@Nonnull public String serialize(@Nonnull SAMLArtifactMap.SAMLArtifactMapEntry instance) throws IOException
Returns a string representing the input object.

Specified by:
  `serialize` in interface `StorageSerializer<SAMLArtifactMap.SAMLArtifactMapEntry>`
Parameters:
  `instance` - object to serialize
Returns:
  a string
Throws:
  `IOException` - if an error occurs during serialization

### deserialize

@Nonnull public SAMLArtifactMap.SAMLArtifactMapEntry deserialize(long version, @Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key, @Nonnull @NotEmpty String value, @Nullable Long expiration) throws IOException
Returns an object recovered from a string produced through the `StorageSerializer.serialize(Type)` method.

Specified by:
  `deserialize` in interface `StorageSerializer<SAMLArtifactMap.SAMLArtifactMapEntry>`
Parameters:
  `version` - record version
  `context` - context of record
  `key` - key of record
  `value` - data to deserialize
  `expiration` - expiration of record, if any
Returns:
  a deserialized object
Throws:
  `IOException` - if an error occurs during deserialization