public class StateStoreData extends Object
StateManager. This class needs a value kith key EncodingCharset in the
ConfigurationManager representing the charaset name to use during alphanumeric storage and
retrieval through Put(gr.uoa.di.madgik.commons.state.store.registry.StateStoreRegistryKey, java.lang.String)
and GetAlphanumeric(gr.uoa.di.madgik.commons.state.store.registry.StateStoreRegistryKey)| Constructor and Description |
|---|
StateStoreData(StateStoreInfo Info)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
String |
GetAlphanumeric(StateStoreRegistryKey Key)
Retrieves the actual payload referenced by the provided metadata entry and returns it
as the expected type.
|
byte[] |
GetByteArray(StateStoreRegistryKey Key)
Retrieves the actual payload referenced by the provided metadata entry and returns it
as the expected type.
|
File |
GetFile(StateStoreRegistryKey Key)
Retrieves the actual payload referenced by the provided metadata entry and returns it
as the expected type.
|
ISerializable |
GetISerializable(StateStoreRegistryKey Key)
Retrieves the actual payload referenced by the provided metadata entry and returns it
as the expected type.
|
Serializable |
GetSerializable(StateStoreRegistryKey Key)
Retrieves the actual payload referenced by the provided metadata entry and returns it
as the expected type.
|
File |
MoveToClean(Map<String,StateStoreRegistryKey> registry)
In case of deletes and updates in the registry and data file, there will be data kept in the file that
are no longer needed but simply remain increrasing the size of the repository files.
|
void |
Put(StateStoreRegistryKey Key,
byte[] bytearray)
Appends the provided payload to the repository data file.
|
void |
Put(StateStoreRegistryKey Key,
File file)
Appends the provided payload to the repository data file.
|
void |
Put(StateStoreRegistryKey Key,
ISerializable obj)
Appends the provided payload to the repository data file.
|
void |
Put(StateStoreRegistryKey Key,
Serializable obj)
Appends the provided payload to the repository data file.
|
void |
Put(StateStoreRegistryKey Key,
String Alphanumeric)
Appends the provided payload to the repository data file.
|
public StateStoreData(StateStoreInfo Info)
Info - The repository persistency files informationpublic void Put(StateStoreRegistryKey Key, String Alphanumeric) throws Exception
StateStoreRegistryKey entry is updated with the offsets of the stored dataKey - The metadata entry representing the data.Alphanumeric - The payload to store as a sequence of bytes using the configuration
value with key EncodingCharset from the ConfigurationManagerException - the store could not be performedpublic String GetAlphanumeric(StateStoreRegistryKey Key) throws Exception
Key - The metadate entry referencing the data to retrieveEncodingCharset
from the ConfigurationManager back to a string from a byte arrayException - The retrieval could not be performedpublic void Put(StateStoreRegistryKey Key, byte[] bytearray) throws Exception
StateStoreRegistryKey entry is updated with the offsets of the stored dataKey - The metadata entry representing the data.bytearray - The payload to store as a sequence of bytesException - The store could not be performedpublic byte[] GetByteArray(StateStoreRegistryKey Key) throws Exception
Key - The metadate entry referencing the data to retrieveException - The retrieval could not be performedpublic void Put(StateStoreRegistryKey Key, ISerializable obj) throws Exception
StateStoreRegistryKey entry is updated with the offsets of the stored dataKey - The metadata entry representing the data.obj - The object to store serializing it through ISerializable.Serialize()Exception - The store could not be performedpublic ISerializable GetISerializable(StateStoreRegistryKey Key) throws Exception
Key - The metadate entry referencing the data to retrieveISerializable.Deserialize(byte[])Exception - The retrieval could not be performedpublic void Put(StateStoreRegistryKey Key, Serializable obj) throws Exception
StateStoreRegistryKey entry is updated with the offsets of the stored dataKey - The metadata entry representing the data.obj - The object to store serializing it through an ObjectOutputStreamException - The store could not be performedpublic Serializable GetSerializable(StateStoreRegistryKey Key) throws Exception
Key - The metadate entry referencing the data to retrieveObjectInputStreamException - The retrieval could not be performedpublic void Put(StateStoreRegistryKey Key, File file) throws Exception
StateStoreRegistryKey entry is updated with the offsets of the stored dataKey - The metadata entry representing the data.file - The file whose payload to retrieve and storeException - The store could not be performedpublic File GetFile(StateStoreRegistryKey Key) throws Exception
Key - The metadate entry referencing the data to retrieveException - The retrieval could not be performedpublic File MoveToClean(Map<String,StateStoreRegistryKey> registry) throws Exception
StateStoreInfo points to as the data repository file is deleted and replaced with
the file that this method returnsregistry - the in memeory structure holding the entries that should be kept from the data fileException - The clean operation could not be performedCopyright © 2018. All Rights Reserved.