Package net.shibboleth.idp.session.impl
Class StorageBackedIdPSessionSerializer
- java.lang.Object
-
- net.shibboleth.utilities.java.support.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 ofStorageBackedIdPSessiondesigned in conjunction with theStorageService-backedSessionManagerimplementation.
-
-
Field Summary
Fields Modifier and Type Field Description private static StringCREATION_INSTANT_FIELDField name of creation instant.private static StringFLOW_ID_ARRAY_FIELDField name of flow ID array.private static StringIPV4_ADDRESS_FIELDField name of IPv4 address.private static StringIPV6_ADDRESS_FIELDField name of IPv6 address.private javax.json.spi.JsonProviderjsonProviderJsonProvider to be used for session serialization.private org.slf4j.LoggerlogClass logger.private static StringPRINCIPAL_NAME_FIELDField name of principal name.private static StringSERVICE_ID_ARRAY_FIELDField name of service ID array.private StorageBackedSessionManagersessionManagerBack-reference to parent instance.private StorageBackedIdPSessiontargetObjectObject instance to overwrite with deserialization method.private static StringUNK_ADDRESS_FIELDField name of Unknown address.
-
Constructor Summary
Constructors Constructor Description StorageBackedIdPSessionSerializer(StorageBackedSessionManager manager, StorageBackedIdPSession target)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StorageBackedIdPSessiondeserialize(long version, String context, String key, String value, Long expiration)Stringserialize(StorageBackedIdPSession instance)-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, 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.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
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 javax.json.spi.JsonProvider jsonProvider
JsonProvider to be used for session serialization.
-
-
Constructor Detail
-
StorageBackedIdPSessionSerializer
public StorageBackedIdPSessionSerializer(@Nonnull StorageBackedSessionManager manager, @Nullable StorageBackedIdPSession target)Constructor.- Parameters:
manager- parent SessionManager instancetarget- object to overwrite when deserializing instead of creating a new instance
-
-
Method Detail
-
serialize
@Nonnull @NotEmpty public String serialize(@Nonnull StorageBackedIdPSession instance) throws IOException
- Specified by:
serializein interfaceStorageSerializer<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:
deserializein interfaceStorageSerializer<StorageBackedIdPSession>- Throws:
IOException
-
-