Package org.opensaml.storage
Interface StorageSerializer<Type>
-
- Type Parameters:
Type
- the type of object handled
- All Superinterfaces:
Component
,InitializableComponent
@ThreadSafeAfterInit public interface StorageSerializer<Type> extends InitializableComponent
Interface to a serialization/deserialization process used by aStorageService
implementation to optimize the handling of complex objects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Type
deserialize(long version, String context, String key, String value, Long expiration)
Returns an object recovered from a string produced through theserialize(Type)
method.String
serialize(Type instance)
Returns a string representing the input object.-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Method Detail
-
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 theserialize(Type)
method.- Parameters:
version
- record versioncontext
- context of recordkey
- key of recordvalue
- data to deserializeexpiration
- expiration of record, if any- Returns:
- a deserialized object
- Throws:
IOException
- if an error occurs during deserialization
-
-