Class PropertyStorageAdapter
java.lang.Object
com.gigaspaces.client.storage_adapters.PropertyStorageAdapter
- Direct Known Subclasses:
AbstractAesAdapter,BinaryAdapter,ZipAdapter
Base class for adapting space properties values before storing them in space or after retrieving them.
- Since:
- 15.2
- Author:
- Niv Ingberg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]Helper method for decoding a base64-encoded string to a byte array.protected Stringbase64Encode(byte[] bytes) Helper method for encoding a byte array to a base64-encoded string.protected Objectdeserialize(byte[] data) Helper method for deserializing a byte array to a serializable object.abstract ObjectTriggered when a property value arrives from the space and is about to be injected in the user's object.getName()Returns a name used for display in monitoring tools.Class<?>Returns the class of the values which will be stored in the space.protected byte[]Helper method for serializing a serializable object to a byte array.booleanIndicates whether equality matching is supported.booleanIndicates whether ordered matching is supported.protected BinaryWrappertoBinaryWrapper(byte[] bytes) Default factory for wrapping a byte array in a container for space storage.abstract ObjectTriggered when a property value is retrieved from the user's object and is about to be sent to the space.protected byte[]unwrapBinary(Object spaceValue) Helper method for unwrapping a byte array from its container object.protected Objectunzip(byte[] data) Helper method for uncompressing and deserializing a byte array to a serializable object.booleanDetermines if binary content should be stored in the space as a string in base64 encoding.protected ObjectwrapBinary(byte[] data) Helper method for wrapping a byte array in a container object for space storage.protected byte[]Helper method for serializing and compressing a serializable object to a byte array.
-
Constructor Details
-
PropertyStorageAdapter
public PropertyStorageAdapter()
-
-
Method Details
-
toSpace
Triggered when a property value is retrieved from the user's object and is about to be sent to the space.- Parameters:
value- The original property value- Returns:
- The value which should be stored in space
- Throws:
IOException- Thrown when processing the property value fails.
-
fromSpace
Triggered when a property value arrives from the space and is about to be injected in the user's object.- Parameters:
value- The value which was stored in the space- Returns:
- The value which should be set in the user's object.
- Throws:
IOException- Thrown when processing the property value fails.ClassNotFoundException- Thrown when processing the property value fails due to a class loading issue.
-
getName
Returns a name used for display in monitoring tools. -
getStorageClass
Returns the class of the values which will be stored in the space. -
supportsEqualsMatching
public boolean supportsEqualsMatching()Indicates whether equality matching is supported. Defaults to false. Storage adapters who support equality should override this to true. -
supportsOrderedMatching
public boolean supportsOrderedMatching()Indicates whether ordered matching is supported. Defaults to false. Storage adapters who support order should override this to true. -
useBase64Wrapper
public boolean useBase64Wrapper()Determines if binary content should be stored in the space as a string in base64 encoding. Defaults to false. -
serialize
Helper method for serializing a serializable object to a byte array.- Throws:
IOException
-
deserialize
Helper method for deserializing a byte array to a serializable object.- Throws:
IOExceptionClassNotFoundException
-
zip
Helper method for serializing and compressing a serializable object to a byte array.- Throws:
IOException
-
unzip
Helper method for uncompressing and deserializing a byte array to a serializable object.- Throws:
IOExceptionClassNotFoundException
-
wrapBinary
Helper method for wrapping a byte array in a container object for space storage. -
unwrapBinary
Helper method for unwrapping a byte array from its container object. -
toBinaryWrapper
Default factory for wrapping a byte array in a container for space storage. -
base64Encode
Helper method for encoding a byte array to a base64-encoded string. -
base64Decode
Helper method for decoding a base64-encoded string to a byte array.
-