summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/persistency/ClusterStorage.java
diff options
context:
space:
mode:
authorabranson <andrew.branson@cern.ch>2011-08-04 00:42:34 +0200
committerabranson <andrew.branson@cern.ch>2011-08-04 00:42:34 +0200
commit0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (patch)
tree5f6e5d9ae75193e67e6f3b3dfa488960c5cde1d5 /source/com/c2kernel/persistency/ClusterStorage.java
parent036cbdba66f804743c4c838ed598d6972c4b3e17 (diff)
More code cleanup:
Refactored Entity Proxy Subscription to handle generics better Rewrote RemoteMap to use TreeMap instead of the internal array for order. It now sorts its keys by number if they parse, else as strings. Removed a no-longer-in-progress outcome form class
Diffstat (limited to 'source/com/c2kernel/persistency/ClusterStorage.java')
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/persistency/ClusterStorage.java46
1 files changed, 23 insertions, 23 deletions
diff --git a/source/com/c2kernel/persistency/ClusterStorage.java b/source/com/c2kernel/persistency/ClusterStorage.java
index f0d28a4..80fd86d 100755..100644
--- a/source/com/c2kernel/persistency/ClusterStorage.java
+++ b/source/com/c2kernel/persistency/ClusterStorage.java
@@ -10,7 +10,7 @@ import com.c2kernel.utils.Logger;
Each ClusterStorage must support get() and getClusterContents() for clusters they return READ and READWRITE from queryClusterSupport
and put() and delete() for clusters they return WRITE and READWRITE from queryClusterSupport().
Unsupported operations should throw a ClusterStorageException.
- If a cluster does not exist, get should return null, and delete should return
+ If a cluster does not exist, get should return null, and delete should return
@version $Revision: 1.22 $ $Date: 2006/02/01 13:27:47 $
@author $Author: abranson $
*/
@@ -20,7 +20,7 @@ public abstract class ClusterStorage {
public static final short READ = 1;
public static final short WRITE = 2;
public static final short READWRITE = 3;
-
+
// Cluster types
public static final String ROOT = "";
public static final String PROPERTY = "Property";
@@ -28,13 +28,13 @@ public abstract class ClusterStorage {
public static final String LIFECYCLE = "LifeCycle";
public static final String OUTCOME = "Outcome";
public static final String HISTORY = "AuditTrail";
- public static final String VIEWPOINT = "ViewPoint";
- public static final String JOB = "Job";
-
+ public static final String VIEWPOINT = "ViewPoint";
+ public static final String JOB = "Job";
+
// connection maintenance
- public abstract void open()
+ public abstract void open()
throws ClusterStorageException;
- public abstract void close()
+ public abstract void close()
throws ClusterStorageException;
// introspection
@@ -42,8 +42,8 @@ public abstract class ClusterStorage {
public abstract String getName();
// for addressing queries
public abstract String getId();
-
-
+
+
/** Quickly gets the first string of the slashed path */
public static String getClusterType(String path) {
try {
@@ -52,12 +52,12 @@ public abstract class ClusterStorage {
int end = path.indexOf('/', start + 1);
if (end == -1) end = path.length();
return path.substring(start, end);
- } catch (Exception ex) {
+ } catch (Exception ex) {
Logger.error(ex);
- return ClusterStorage.ROOT;
+ return ClusterStorage.ROOT;
}
}
-
+
public static String getPath(C2KLocalObject obj) {
String root = obj.getClusterType();
if (root == null) return null; // no storage allowed
@@ -71,34 +71,34 @@ public abstract class ClusterStorage {
}
else
return root+"/"+obj.getName();
- }
-
+ }
+
/* object manipulation */
// retrieve object by path
- public abstract C2KLocalObject get(Integer sysKey, String path)
+ public abstract C2KLocalObject get(Integer sysKey, String path)
throws ClusterStorageException;
// store object by path
- public abstract void put(Integer sysKey, C2KLocalObject obj)
+ public abstract void put(Integer sysKey, C2KLocalObject obj)
throws ClusterStorageException;
// delete cluster
- public abstract void delete(Integer sysKey, String path)
+ public abstract void delete(Integer sysKey, String path)
throws ClusterStorageException;
-
+
// db specific queries
- public Object query(Object query)
+ public Object query(Object query)
throws ClusterStorageException {
throw new ClusterStorageException("Query not supported on this storage");
}
-
+
public String queryToXML(String query, boolean genericFormat)
throws ClusterStorageException {
throw new ClusterStorageException("Query not supported on this storage");
}
-
-
+
+
// directory listing
- public abstract String[] getClusterContents(Integer sysKey, String path)
+ public abstract String[] getClusterContents(Integer sysKey, String path)
throws ClusterStorageException;
}