Class CASSPSessionSerializer

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

public class CASSPSessionSerializer extends AbstractSPSessionSerializer
JSON serializer for CASSPSession class.
  • Field Details

  • Constructor Details

    • CASSPSessionSerializer

      public CASSPSessionSerializer(@Nonnull @ParameterName(name="offset") Duration offset)
      offset - time to subtract from record expiration to establish session expiration value
  • Method Details

    • doSerializeAdditional

      protected void doSerializeAdditional(@Nonnull SPSession instance, @Nonnull generator)
      Description copied from class: AbstractSPSessionSerializer
      Override this method to handle serialization of additional data.

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

      doSerializeAdditional in class AbstractSPSessionSerializer
      instance - object to serialize
      generator - JSON generator to write to
    • doDeserialize

      @Nonnull protected SPSession doDeserialize(@Nonnull javax.json.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
      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
      the newly constructed object
      IOException - if an error occurs during deserialization