From 37a3c3867cb4c7705065ed1d079bdac4f3f52f50 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 18 Oct 2013 10:21:07 +0200 Subject: Javadoc for ClusterStorage constants. --- .../com/c2kernel/persistency/ClusterStorage.java | 68 +++++++++++++++++++--- 1 file changed, 60 insertions(+), 8 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/c2kernel/persistency/ClusterStorage.java b/src/main/java/com/c2kernel/persistency/ClusterStorage.java index db9259a..9c18bb4 100644 --- a/src/main/java/com/c2kernel/persistency/ClusterStorage.java +++ b/src/main/java/com/c2kernel/persistency/ClusterStorage.java @@ -5,31 +5,83 @@ import com.c2kernel.persistency.outcome.Outcome; import com.c2kernel.persistency.outcome.Viewpoint; import com.c2kernel.utils.Logger; -/** Interface for persistency managers of entities. - A Cluster is defined as a path under the item - 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 - @version $Revision: 1.22 $ $Date: 2006/02/01 13:27:47 $ - @author $Author: abranson $ +/** Interface for persistency managers of entities. It allows different kernel objects to be stored in different backend. For instance, + * Properties may be stored in LDAP, while Events, Outcomes and Viewpoints could be stored in a relational database. There are old generic + * query methods, but these are deprecated. The kernel does no analytical querying of the ClusterStorages, only simple gets and puts. + * + * Each first-level path under the Item is defined as a Cluster. Different Clusters may be stored in different places. + * Each ClusterStorage must support {@link #get(Integer, String)} and {@link #getClusterContents(Integer, String)} for clusters they return + * {@link #READ} and {@link #READWRITE} from queryClusterSupport + * and {@link #put(Integer, C2KLocalObject)} and {@link #delete(Integer, String)} for clusters they return {@link #WRITE} and {@link #READWRITE} + * from {@link #getClusterContents(Integer, String)}. + * Operations that have notbeen declared as not supported should throw a ClusterStorageException. + * If a cluster does not exist, get should return null, and delete should return with no action. */ public abstract class ClusterStorage { + /** + * Constant to return from {@link #queryClusterSupport(String)} for Cluster types this storage does not support. + */ public static final short NONE = 0; + /** + * Constant to return from {@link #queryClusterSupport(String)} for Cluster types this storage can read from a database but not write. + * An example would be pre-existing data in a database that is mapped to Items in some way. + */ public static final short READ = 1; + /** + * Constant to return from {@link #queryClusterSupport(String)} for Cluster types this storage can write to a database but not read. + * An example would be a realtime database export of data, which is transformed in an unrecoverable way for use in other systems. + */ public static final short WRITE = 2; + /** + * Constant to return from {@link #queryClusterSupport(String)} for data stores that CRISTAL may use for both reading and writing for the given Cluster type. + */ public static final short READWRITE = 3; // Cluster types + /** + * The defined path of the root of the CRISTAL Kernel object cluster tree. A zero-length string. + */ public static final String ROOT = ""; + /** + * The root of the Property object cluster. All Property paths start with this. Defined as "Property". Properties are + * stored underneath according to their name e.g. "Property/Name" + */ public static final String PROPERTY = "Property"; + /** + * The root of the Collection object cluster. All Collection paths start with this. Defined as "Collection". Collections + * are stored underneath by name e.g. "Collection/Composition" + */ public static final String COLLECTION = "Collection"; + /** + * The cluster which holds the Item workflow. Defined as "LifeCycle". Holds the workflow inside, which is named "workflow", + * hence "LifeCycle/workflow". + * @see com.c2kernel.lifecycle.instance.Workflow + */ public static final String LIFECYCLE = "LifeCycle"; + /** + * This cluster holds all outcomes of this Item. The path to each outcome is "Outcome/Schema Name/Schema Version/Event ID" + */ public static final String OUTCOME = "Outcome"; + /** + * This is the cluster that contains all event for this Item. This cluster may be instantiated in a client as a History, which is a + * RemoteMap. Events are stored with their ID: "/AuditTrail/Event ID" + */ public static final String HISTORY = "AuditTrail"; + /** + * This cluster contains all viewpoints. Its name is defined as "ViewPoint". The paths of viewpoint objects stored here follow this pattern: + * "ViewPoint/Schema Name/Viewpoint Name" + */ public static final String VIEWPOINT = "ViewPoint"; + /** + * Agents store their persistent jobs in this cluster that have been pushed to them by activities configured to do so. The name is defined as "Job" + * and each new job received is assigned an integer ID one more than the highest already present. + */ public static final String JOB = "Job"; + + /** + * An array of all currently supported cluster types, for iterative purposes. + */ public static final String[] allClusterTypes = { PROPERTY, COLLECTION, LIFECYCLE, OUTCOME, HISTORY, VIEWPOINT, JOB }; // connection maintenance -- cgit v1.2.3