Class ClusterStorageManager
java.lang.Object
org.cristalise.kernel.persistency.ClusterStorageManager
Instantiates ClusterStorages listed in properties file. All read/write requests to storage pass through this object,
which can query the capabilities of each declared storage, and channel requests accordingly. Transaction based.
It also has a memoryCache to increase performance..
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes all ClusterStorage handlers listed by class name in the property "ClusterStorages" This property is usually process specific, and so should be in the server/client.conf and not the connect file. -
Method Summary
Modifier and TypeMethodDescriptionvoidabort(TransactionKey transactionKey) voidbegin(TransactionKey transactionKey) longClear entire cachelongclearCache(String pattern) longclearCache(List<String> fullPathList) longclearCache(ItemPath itemPath) longclearCache(ItemPath itemPath, String path) Clear the cache of the given cluster content of the given Item.longclearCache(ItemPath itemPath, ClusterType cluster) voidclose()voidcommit(TransactionKey transactionKey) executeQuery(Query query) executeQuery(Query query, TransactionKey transactionKey) Executes the Queryget(ItemPath itemPath, String path, TransactionKey transactionKey) Retrieves clusters from ClusterStorages invalid input: '&' maintains the memory cache.String[]getClusterContents(ItemPath itemPath, String path) String[]getClusterContents(ItemPath itemPath, String path, TransactionKey transactionKey) Retrieves the ids of the next level of a cluster.String[]getClusterContents(ItemPath itemPath, ClusterType type) String[]getClusterContents(ItemPath itemPath, ClusterType type, TransactionKey transactionKey) intgetLastIntegerId(ItemPath itemPath, String path, TransactionKey transactionKey) Retrieves the last id of the HistoryinstantiateStores(String allClusters) voidvoidvoidvoidput(ItemPath itemPath, C2KLocalObject obj, TransactionKey transactionKey) Creates or overwrites a cluster in all writers.voidremove(ItemPath itemPath, String path, TransactionKey transactionKey) Deletes a cluster from all writersvoidremoveCluster(ItemPath itemPath, String path, TransactionKey transactionKey) Removes all child objects from the given path for all writersvoidremoveCluster(ItemPath itemPath, ClusterType cluster, TransactionKey transactionKey) Removes all objects of a ClusterTypevoidremoveCluster(ItemPath itemPath, TransactionKey transactionKey) Removes all data associated with the item
-
Constructor Details
-
ClusterStorageManager
Initializes all ClusterStorage handlers listed by class name in the property "ClusterStorages" This property is usually process specific, and so should be in the server/client.conf and not the connect file.- Throws:
PersistencyException
-
-
Method Details
-
instantiateStores
- Parameters:
allClusters-- Returns:
- Throws:
PersistencyException
-
close
public void close() -
executeQuery
- Parameters:
query-- Returns:
- Throws:
PersistencyException
-
executeQuery
Executes the Query- Parameters:
query- the Query to be executedtransactionKey-query-- Returns:
- the xml result of the query
- Throws:
PersistencyException
-
getClusterContents
- Throws:
PersistencyException
-
getClusterContents
public String[] getClusterContents(ItemPath itemPath, ClusterType type, TransactionKey transactionKey) throws PersistencyException - Throws:
PersistencyException
-
getClusterContents
- Throws:
PersistencyException
-
getClusterContents
public String[] getClusterContents(ItemPath itemPath, String path, TransactionKey transactionKey) throws PersistencyException Retrieves the ids of the next level of a cluster.- Parameters:
itemPath- the current Itempath- the cluster path. The leading slash is removed if exists- Returns:
- list of keys found in the cluster
- Throws:
PersistencyException
-
get
public C2KLocalObject get(ItemPath itemPath, String path) throws PersistencyException, ObjectNotFoundException - Parameters:
itemPath-path-- Returns:
- Throws:
PersistencyExceptionObjectNotFoundException
-
get
public C2KLocalObject get(ItemPath itemPath, String path, TransactionKey transactionKey) throws PersistencyException, ObjectNotFoundException Retrieves clusters from ClusterStorages invalid input: '&' maintains the memory cache.- Parameters:
itemPath- current Itempath- the cluster path. The leading slash is removed if exists. Cannot be blank or a single '/'- Returns:
- the C2KLocalObject located by path
- Throws:
PersistencyExceptionObjectNotFoundException
-
getLastIntegerId
public int getLastIntegerId(ItemPath itemPath, String path, TransactionKey transactionKey) throws PersistencyException Retrieves the last id of the History- Parameters:
itemPath- current Itempath- the cluster path. The leading slash is removed if existstransactionKey-- Returns:
- the ID used starting with 0 or -1 if the cluster empty (e.g. Jobs)
- Throws:
PersistencyException
-
put
public void put(ItemPath itemPath, C2KLocalObject obj, TransactionKey transactionKey) throws PersistencyException Creates or overwrites a cluster in all writers. Used when committing transactions.- Throws:
PersistencyException
-
remove
public void remove(ItemPath itemPath, String path, TransactionKey transactionKey) throws PersistencyException Deletes a cluster from all writers- Parameters:
itemPath- - Item to delete frompath- - root path to deletetransactionKey- - locking object- Throws:
PersistencyException- - when deleting fails
-
removeCluster
public void removeCluster(ItemPath itemPath, ClusterType cluster, TransactionKey transactionKey) throws PersistencyException Removes all objects of a ClusterType- Parameters:
itemPath- - Item to delete fromcluster- - the cluster typetransactionKey- - locking object- Throws:
PersistencyException- - when deleting fails
-
removeCluster
public void removeCluster(ItemPath itemPath, TransactionKey transactionKey) throws PersistencyException Removes all data associated with the item- Parameters:
itemPath- - Item to be deletedtransactionKey- - locking object- Throws:
PersistencyException- - when deleting fails
-
removeCluster
public void removeCluster(ItemPath itemPath, String path, TransactionKey transactionKey) throws PersistencyException Removes all child objects from the given path for all writers- Parameters:
itemPath- - Item to delete frompath- - root path to deletetransactionKey- - locking object- Throws:
PersistencyException- - when deleting fails
-
clearCache
- Parameters:
itemPath-
-
clearCache
- Parameters:
itemPath-
-
clearCache
- Parameters:
pattern-
-
clearCache
Clear the cache of the given cluster content of the given Item.- Parameters:
itemPath- the item for which the cache should be cleared. Cannot be null.path- the identifier of the cluster content to be cleared. Cannot not be nul.
-
clearCache
- Parameters:
fullPathList-
-
clearCache
public long clearCache()Clear entire cache -
begin
- Parameters:
transactionKey-- Throws:
PersistencyException
-
commit
- Parameters:
transactionKey-- Throws:
PersistencyException
-
abort
- Parameters:
transactionKey-- Throws:
PersistencyException
-
postConnect
- Throws:
PersistencyException
-
postBoostrap
- Throws:
PersistencyException
-
postStartServer
- Throws:
PersistencyException
-