|
||||||||||
| 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 | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StateStoreData(StateStoreInfo Info)
Info - The repository persistency files information| Method Detail |
|---|
public void Put(StateStoreRegistryKey Key,
String Alphanumeric)
throws 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
Exception - the store could not be performed
public String GetAlphanumeric(StateStoreRegistryKey Key)
throws Exception
Key - The metadate entry referencing the data to retrieve
EncodingCharset
from the ConfigurationManager back to a string from a byte array
Exception - The retrieval could not be performed
public void Put(StateStoreRegistryKey Key,
byte[] bytearray)
throws 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
Exception - The store could not be performed
public byte[] GetByteArray(StateStoreRegistryKey Key)
throws Exception
Key - The metadate entry referencing the data to retrieve
Exception - The retrieval could not be performed
public void Put(StateStoreRegistryKey Key,
ISerializable obj)
throws 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()
Exception - The store could not be performed
public ISerializable GetISerializable(StateStoreRegistryKey Key)
throws Exception
Key - The metadate entry referencing the data to retrieve
ISerializable.Deserialize(byte[])
Exception - The retrieval could not be performed
public void Put(StateStoreRegistryKey Key,
Serializable obj)
throws 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
Exception - The store could not be performed
public Serializable GetSerializable(StateStoreRegistryKey Key)
throws Exception
Key - The metadate entry referencing the data to retrieve
ObjectInputStream
Exception - The retrieval could not be performed
public void Put(StateStoreRegistryKey Key,
File file)
throws 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
Exception - The store could not be performed
public File GetFile(StateStoreRegistryKey Key)
throws Exception
Key - The metadate entry referencing the data to retrieve
Exception - The retrieval could not be performed
public 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 returns
registry - the in memeory structure holding the entries that should be kept from the data file
Exception - The clean operation could not be performed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||