|
|||||||||
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.registry.StateStoreRegistry
public class StateStoreRegistry
This class is the in memory registry of all entries persisted with the State Store Repository. It is used to
store metadata information on the available state entries and to retrieve them along with their attached data.
The repository does not store any of the actual data the clients provide. In the repository the metadata needed
to retrieve the payload stored internally are kept. 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
Constructor Summary | |
---|---|
StateStoreRegistry()
Creates a new instance |
Method Summary | |
---|---|
java.lang.Boolean |
Contains(java.lang.String Key)
Checks is the provided key is contained in the in memory structure regardless of whether or not it is active or not |
java.lang.Boolean |
Delete(java.lang.String Key,
StateStoreInfo info)
Effectivly deletes any StateStoreRegistryKey entry from the State Store Registry that is
associated with the provided key. |
void |
Deserialize(StateStoreInfo info)
This methdo initializes the in memory data structure from the State Store registry persistency files deserializing the entries found there. |
StateStoreRegistryKey |
Get(java.lang.String Key)
Retrieves the StateStoreRegistryKey that is associated with the provided key from the
in memory data structure if the key is found in the structure. |
java.util.Map<java.lang.String,StateStoreRegistryKey> |
GetDictionary()
Retrieved the dictionary data structure used to store the StateStoreRegistryKey entries |
java.io.File |
MoveToClean()
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 increraqsing the size of the repository files. |
java.lang.Boolean |
Put(StateStoreRegistryKey Key,
StateStoreInfo info)
Adds a StateStoreRegistryKey in the internal data structure. |
void |
StoreUpdate(StateStoreInfo info,
StateStoreRegistryKey entry,
boolean update)
This method stores a new record, or updates an existing one in the state store registry repository file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StateStoreRegistry()
Method Detail |
---|
public java.util.Map<java.lang.String,StateStoreRegistryKey> GetDictionary()
StateStoreRegistryKey
entries
public java.lang.Boolean Put(StateStoreRegistryKey Key, StateStoreInfo info) throws java.lang.Exception
StateStoreRegistryKey
in the internal data structure. If the key as retrieved from
StateStoreRegistryKey.GetKey()
already exists, the entry it points to is replaced with the provided
one. Once the StateStoreRegistryKey
is inserted in the in memory data structure, it is also persisted
in the State Store Registry file. If the entry already existed, it is simply updated there.
Key
- The entry to insert or updateinfo
- Information conserning the peristency repositories
true
if the entries key was not present in the dicitonary before this insert,
false
otherwise
java.lang.Exception
- The insert / update could not be updatedpublic java.lang.Boolean Contains(java.lang.String Key)
Key
- the key to check if it is contained
true
if the key is contained in the in memory data structure, false
otherwisepublic StateStoreRegistryKey Get(java.lang.String Key)
StateStoreRegistryKey
that is associated with the provided key from the
in memory data structure if the key is found in the structure.
Key
- The key to search for
public java.lang.Boolean Delete(java.lang.String Key, StateStoreInfo info) throws java.lang.Exception
StateStoreRegistryKey
entry from the State Store Registry that is
associated with the provided key. The entry is set as inactive using StateStoreRegistryKey.Deactivate()
and the change is reflected in the registry persistency file
Key
- THe key to deleteinfo
- State Store Registry persistency information
true
if the update was successful, or false
if the key was not found
java.lang.Exception
- The update could not be performedpublic void Deserialize(StateStoreInfo info) throws java.lang.Exception
info
- The State Store repository persistency files
java.lang.Exception
- The deserialization could not be performedpublic java.io.File MoveToClean() throws java.lang.Exception
StateStoreInfo
points
to as the registry repository file is deleted and replaced with the file that this method returns
java.lang.Exception
- The clean operation could not be performedpublic void StoreUpdate(StateStoreInfo info, StateStoreRegistryKey entry, boolean update) throws java.lang.Exception
info
- The state store repository persistency filesentry
- the entry to persistupdate
- Whether or not to update or store as new the provided entry
java.lang.Exception
- the stroe / update could not be performed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |