From 0ec8481c10cd8277d84c7c1a785483a0a739e5a0 Mon Sep 17 00:00:00 2001 From: abranson Date: Thu, 4 Aug 2011 00:42:34 +0200 Subject: 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 --- .../com/c2kernel/persistency/ClusterStorage.java | 46 +++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) mode change 100755 => 100644 source/com/c2kernel/persistency/ClusterStorage.java (limited to 'source/com/c2kernel/persistency/ClusterStorage.java') diff --git a/source/com/c2kernel/persistency/ClusterStorage.java b/source/com/c2kernel/persistency/ClusterStorage.java old mode 100755 new mode 100644 index f0d28a4..80fd86d --- 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; } -- cgit v1.2.3