Package net.shibboleth.idp.cas.session.impl

# Class CASSPSessionSerializer

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.session.AbstractSPSessionSerializer
net.shibboleth.idp.cas.session.impl.CASSPSessionSerializer

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

public class CASSPSessionSerializer extends AbstractSPSessionSerializer
JSON serializer for `CASSPSession` class.

## Field Summary

Fields
Modifier and Type
Field
Description
`private static final String`
`SERVICE_URL_FIELD`
Field name of CAS service URL.
`private static final String`
`TICKET_FIELD`
Field name of CAS ticket.

## Constructor Summary

Constructors
Constructor
Description
`CASSPSessionSerializer(Duration offset)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected SPSession`
`doDeserialize(JsonObject obj, String id, Instant creation, Instant expiration)`
Implement this method to return the appropriate type of object, populated with the basic information supplied.
`protected void`
`doSerializeAdditional(SPSession instance, JsonGenerator generator)`
Override this method to handle serialization of additional data.

### Methods inherited from class net.shibboleth.idp.session.AbstractSPSessionSerializer

`deserialize, serialize`

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

### TICKET_FIELD

@Nonnull @NotEmpty private static final String TICKET_FIELD
Field name of CAS ticket.

See Also:
  - Constant Field Values

### SERVICE_URL_FIELD

@Nonnull @NotEmpty private static final String SERVICE_URL_FIELD
Field name of CAS service URL.

See Also:
  - Constant Field Values

## Constructor Details

### CASSPSessionSerializer

public CASSPSessionSerializer(@Nonnull @ParameterName(name="offset") Duration offset)
Constructor.

Parameters:
  `offset` - time to subtract from record expiration to establish session expiration value

## Method Details

### doSerializeAdditional

protected void doSerializeAdditional(@Nonnull SPSession instance, @Nonnull JsonGenerator generator)
Override this method to handle serialization of additional data.

The serialization "context" is the continuation of a JSON struct.

Overrides:
  `doSerializeAdditional` in class `AbstractSPSessionSerializer`
Parameters:
  `instance` - object to serialize
  `generator` - JSON generator to write to

### doDeserialize

@Nonnull protected SPSession doDeserialize(@Nonnull JsonObject obj, @Nonnull @NotEmpty String id, @Nonnull Instant creation, @Nonnull Instant expiration) throws IOException
Implement this method to return the appropriate type of object, populated with the basic information supplied.

The JSON object supplied is a structure that may contain additional data created by the concrete subclass during serialization.

Specified by:
  `doDeserialize` in class `AbstractSPSessionSerializer`
Parameters:
  `obj` - JSON structure to parse
  `id` - the identifier of the service associated with this session
  `creation` - creation time of session
  `expiration` - expiration time of session
Returns:
  the newly constructed object
Throws:
  `IOException` - if an error occurs during deserialization