Interface StorageSerializer<Type>

Type Parameters:
Type - the type of object handled
All Superinterfaces:
Component, InitializableComponent
All Known Implementing Classes:
StorageServiceSAMLArtifactMapEntryFactory

@ThreadSafeAfterInit public interface StorageSerializer<Type> extends InitializableComponent
Interface to a serialization/deserialization process used by a StorageService implementation to optimize the handling of complex objects.
  • Method Details

    • serialize

      @Nonnull @NotEmpty String serialize(@Nonnull Type instance) throws IOException
      Returns a string representing the input object.
      Parameters:
      instance - object to serialize
      Returns:
      a string
      Throws:
      IOException - if an error occurs during serialization
    • deserialize

      @Nonnull Type 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 serialize(Type) method.
      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