Package net.shibboleth.idp.session.impl

# Class StorageBackedIdPSessionSerializer

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.session.impl.StorageBackedIdPSessionSerializer

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `StorageSerializer<StorageBackedIdPSession>`

@ThreadSafe public class StorageBackedIdPSessionSerializer extends AbstractInitializableComponent implements StorageSerializer<StorageBackedIdPSession>
A serializer for instances of `StorageBackedIdPSession` designed in conjunction with the `StorageService`-backed `SessionManager` implementation.

## Field Summary

Fields
Modifier and Type
Field
Description
`private static final String`
`CREATION_INSTANT_FIELD`
Field name of creation instant.
`private static final String`
`FLOW_ID_ARRAY_FIELD`
Field name of flow ID array.
`private static final String`
`IPV4_ADDRESS_FIELD`
Field name of IPv4 address.
`private static final String`
`IPV6_ADDRESS_FIELD`
Field name of IPv6 address.
`private final JsonProvider`
`jsonProvider`
JsonProvider to be used for session serialization.
`private final org.slf4j.Logger`
`log`
Class logger.
`private static final String`
`PRINCIPAL_NAME_FIELD`
Field name of principal name.
`private static final String`
`SERVICE_ID_ARRAY_FIELD`
Field name of service ID array.
`private final StorageBackedSessionManager`
`sessionManager`
Back-reference to parent instance.
`private final StorageBackedIdPSession`
`targetObject`
Object instance to overwrite with deserialization method.
`private static final String`
`UNK_ADDRESS_FIELD`
Field name of Unknown address.

## Constructor Summary

Constructors
Constructor
Description
`StorageBackedIdPSessionSerializer(StorageBackedSessionManager manager, StorageBackedIdPSession target)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`StorageBackedIdPSession`
`deserialize(long version, String context, String key, String value, Long expiration)`
`String`
`serialize(StorageBackedIdPSession instance)`

### 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

### CREATION_INSTANT_FIELD

@Nonnull @NotEmpty private static final String CREATION_INSTANT_FIELD
Field name of creation instant.

See Also:
  - Constant Field Values

### PRINCIPAL_NAME_FIELD

@Nonnull @NotEmpty private static final String PRINCIPAL_NAME_FIELD
Field name of principal name.

See Also:
  - Constant Field Values

### IPV4_ADDRESS_FIELD

@Nonnull @NotEmpty private static final String IPV4_ADDRESS_FIELD
Field name of IPv4 address.

See Also:
  - Constant Field Values

### IPV6_ADDRESS_FIELD

@Nonnull @NotEmpty private static final String IPV6_ADDRESS_FIELD
Field name of IPv6 address.

See Also:
  - Constant Field Values

### UNK_ADDRESS_FIELD

@Nonnull @NotEmpty private static final String UNK_ADDRESS_FIELD
Field name of Unknown address.

See Also:
  - Constant Field Values

### FLOW_ID_ARRAY_FIELD

@Nonnull @NotEmpty private static final String FLOW_ID_ARRAY_FIELD
Field name of flow ID array.

See Also:
  - Constant Field Values

### SERVICE_ID_ARRAY_FIELD

@Nonnull @NotEmpty private static final String SERVICE_ID_ARRAY_FIELD
Field name of service ID array.

See Also:
  - Constant Field Values

### log

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

### sessionManager

@Nonnull private final StorageBackedSessionManager sessionManager
Back-reference to parent instance.

### targetObject

@Nullable private final StorageBackedIdPSession targetObject
Object instance to overwrite with deserialization method.

### jsonProvider

@Nonnull private final JsonProvider jsonProvider
JsonProvider to be used for session serialization.

## Constructor Details

### StorageBackedIdPSessionSerializer

public StorageBackedIdPSessionSerializer(@Nonnull StorageBackedSessionManager manager, @Nullable StorageBackedIdPSession target)
Constructor.

Parameters:
  `manager` - parent SessionManager instance
  `target` - object to overwrite when deserializing instead of creating a new instance

## Method Details

### serialize

@Nonnull @NotEmpty public String serialize(@Nonnull StorageBackedIdPSession instance) throws IOException

Specified by:
  `serialize` in interface `StorageSerializer<StorageBackedIdPSession>`
Throws:
  `IOException`

### deserialize

@Nonnull public StorageBackedIdPSession deserialize(long version, @Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key, @Nonnull @NotEmpty String value, @Nullable Long expiration) throws IOException

Specified by:
  `deserialize` in interface `StorageSerializer<StorageBackedIdPSession>`
Throws:
  `IOException`