|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgr.uoa.di.madgik.commons.state.store.data.StateStoreData
public class StateStoreData
Class responsible of handling the persistency and retrieval of the actual state data clients want to
persiste with the State Store Repository. This class dows not keep any internal state and is
instanciated every time a new operation needs to be perofrmed on the repository payload data.
The operations this class provides are not thread safe and even though it represents a shared
resource it does not provide any kind of of resource locking policy. This is left to the wrapping
class, 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 Summary | |
---|---|
StateStoreData(StateStoreInfo Info)
Creates a new instance |
Method Summary | |
---|---|
java.lang.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. |
java.io.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. |
java.io.Serializable |
GetSerializable(StateStoreRegistryKey Key)
Retrieves the actual payload referenced by the provided metadata entry and returns it as the expected type. |
java.io.File |
MoveToClean(java.util.Map<java.lang.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,
java.io.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,
java.io.Serializable obj)
Appends the provided payload to the repository data file. |
void |
Put(StateStoreRegistryKey Key,
java.lang.String Alphanumeric)
Appends the provided payload to the repository data file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StateStoreData(StateStoreInfo Info)
Info
- The repository persistency files informationMethod Detail |
---|
public void Put(StateStoreRegistryKey Key, java.lang.String Alphanumeric) throws java.lang.Exception
StateStoreRegistryKey
entry is updated with the offsets of the stored data
Key
- 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 ConfigurationManager
java.lang.Exception
- the store could not be performedpublic java.lang.String GetAlphanumeric(StateStoreRegistryKey Key) throws java.lang.Exception
Key
- The metadate entry referencing the data to retrieve
EncodingCharset
from the ConfigurationManager
back to a string from a byte array
java.lang.Exception
- The retrieval could not be performedpublic void Put(StateStoreRegistryKey Key, byte[] bytearray) throws java.lang.Exception
StateStoreRegistryKey
entry is updated with the offsets of the stored data
Key
- The metadata entry representing the data.bytearray
- The payload to store as a sequence of bytes
java.lang.Exception
- The store could not be performedpublic byte[] GetByteArray(StateStoreRegistryKey Key) throws java.lang.Exception
Key
- The metadate entry referencing the data to retrieve
java.lang.Exception
- The retrieval could not be performedpublic void Put(StateStoreRegistryKey Key, ISerializable obj) throws java.lang.Exception
StateStoreRegistryKey
entry is updated with the offsets of the stored data
Key
- The metadata entry representing the data.obj
- The object to store serializing it through ISerializable.Serialize()
java.lang.Exception
- The store could not be performedpublic ISerializable GetISerializable(StateStoreRegistryKey Key) throws java.lang.Exception
Key
- The metadate entry referencing the data to retrieve
ISerializable.Deserialize(byte[])
java.lang.Exception
- The retrieval could not be performedpublic void Put(StateStoreRegistryKey Key, java.io.Serializable obj) throws java.lang.Exception
StateStoreRegistryKey
entry is updated with the offsets of the stored data
Key
- The metadata entry representing the data.obj
- The object to store serializing it through an ObjectOutputStream
java.lang.Exception
- The store could not be performedpublic java.io.Serializable GetSerializable(StateStoreRegistryKey Key) throws java.lang.Exception
Key
- The metadate entry referencing the data to retrieve
ObjectInputStream
java.lang.Exception
- The retrieval could not be performedpublic void Put(StateStoreRegistryKey Key, java.io.File file) throws java.lang.Exception
StateStoreRegistryKey
entry is updated with the offsets of the stored data
Key
- The metadata entry representing the data.file
- The file whose payload to retrieve and store
java.lang.Exception
- The store could not be performedpublic java.io.File GetFile(StateStoreRegistryKey Key) throws java.lang.Exception
Key
- The metadate entry referencing the data to retrieve
java.lang.Exception
- The retrieval could not be performedpublic java.io.File MoveToClean(java.util.Map<java.lang.String,StateStoreRegistryKey> registry) throws java.lang.Exception
StateStoreInfo
points to as the data repository file is deleted and replaced with
the file that this method returns
registry
- the in memeory structure holding the entries that should be kept from the data file
java.lang.Exception
- The clean operation could not be performed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |