summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-10-13 12:04:23 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-10-13 12:04:23 +0200
commit79266bce4bdb3e91f54cdb117704967cc7d0ab11 (patch)
treeaf2df1d0ae8ac24c591605e9488a5885304c2c9f
parent32feb5a91fe0c96afd1480442f835a7ab6756643 (diff)
Add ItemProxy.getCollection(name, version), plus more Javadoc
-rw-r--r--src/main/java/org/cristalise/kernel/entity/proxy/ItemProxy.java42
1 files changed, 41 insertions, 1 deletions
diff --git a/src/main/java/org/cristalise/kernel/entity/proxy/ItemProxy.java b/src/main/java/org/cristalise/kernel/entity/proxy/ItemProxy.java
index 326da36..f42c095 100644
--- a/src/main/java/org/cristalise/kernel/entity/proxy/ItemProxy.java
+++ b/src/main/java/org/cristalise/kernel/entity/proxy/ItemProxy.java
@@ -214,18 +214,58 @@ public class ItemProxy
}
+ /** Gets the current version of the named collection
+ *
+ * @param collName The collection name
+ * @return the Collection object
+ * @throws ObjectNotFoundException
+ */
public Collection<?> getCollection(String collName) throws ObjectNotFoundException {
- return (Collection<?>)getObject(ClusterStorage.COLLECTION+"/"+collName+"/last");
+ return getCollection(collName, null);
+ }
+
+ /** Gets a numbered version (snapshot) of a collection
+ *
+ * @param collName The collection name
+ * @param version The collection number (null for the current version)
+ * @return
+ * @throws ObjectNotFoundException
+ */
+ public Collection<?> getCollection(String collName, Integer version) throws ObjectNotFoundException {
+ String verStr = version==null?"last":String.valueOf(version);
+ return (Collection<?>)getObject(ClusterStorage.COLLECTION+"/"+collName+"/"+verStr);
}
+ /** Gets the Workflow object of this Item
+ *
+ * @return the Item's Workflow object
+ * @throws ObjectNotFoundException
+ */
public Workflow getWorkflow() throws ObjectNotFoundException {
return (Workflow)getObject(ClusterStorage.LIFECYCLE+"/workflow");
}
+ /** Gets the named viewpoint
+ *
+ * @param schemaName Outcome schema name
+ * @param viewName Viewpoint name
+ * @return a Viewpoint object
+ * @throws ObjectNotFoundException
+ */
public Viewpoint getViewpoint(String schemaName, String viewName) throws ObjectNotFoundException {
return (Viewpoint)getObject(ClusterStorage.VIEWPOINT+"/"+schemaName+"/"+viewName);
}
+ /** Tries to find a job with the given name for the given Agent in
+ * the workflow.
+ *
+ * @param actName The activity name to look for
+ * @param agent The agent to fetch jobs for
+ * @return
+ * @throws AccessRightsException
+ * @throws ObjectNotFoundException
+ * @throws PersistencyException Error loading the relevant objects
+ */
public Job getJobByName(String actName, AgentProxy agent)
throws AccessRightsException,
ObjectNotFoundException,