Updated Branches:
refs/heads/master 43524f063 -> 25cc25147
initial commit to AIRAVATA-1006
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/25cc2514
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/25cc2514
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/25cc2514
Branch: refs/heads/master
Commit: 25cc25147ff950f4b08e534a925adfedeb3b2883
Parents: 43524f0
Author: chathuri <chathuri@apache.org>
Authored: Wed Feb 5 10:42:34 2014 -0500
Committer: chathuri <chathuri@apache.org>
Committed: Wed Feb 5 10:42:34 2014 -0500
----------------------------------------------------------------------
modules/registry/pom.xml | 1 +
.../apache/airavata/registry/cpi/DataType.java | 15 ++++
.../apache/airavata/registry/cpi/Registry.java | 90 ++++++++++++++++++++
3 files changed, 106 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/25cc2514/modules/registry/pom.xml
----------------------------------------------------------------------
diff --git a/modules/registry/pom.xml b/modules/registry/pom.xml
index 7ebb1b5..8063890 100644
--- a/modules/registry/pom.xml
+++ b/modules/registry/pom.xml
@@ -31,6 +31,7 @@
</activation>
<modules>
<module>registry-api</module>
+ <module>registry-cpi</module>
<module>airavata-jpa-registry</module>
<module>airavata-registry-service</module>
<module>airavata-registry-test</module>
http://git-wip-us.apache.org/repos/asf/airavata/blob/25cc2514/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/DataType.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/DataType.java
b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/DataType.java
new file mode 100644
index 0000000..b9099ce
--- /dev/null
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/DataType.java
@@ -0,0 +1,15 @@
+package org.apache.airavata.registry.cpi;
+
+public enum DataType {
+ APPLiCATION_CATALOG,
+ GROUP,
+ USER,
+ PROJECT,
+ EXPERIMENT_BASIC_DATA,
+ EXPERIMENT_SUMMARY,
+ EXPERIMENT_CONFIGURATION_DATA,
+ EXPERIMENT_GENERATED_DATA,
+ MONITORING_DATA,
+ PROVENANCE_DATA,
+ EXECUTION_ERROR
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/25cc2514/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java
b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java
new file mode 100644
index 0000000..a740f09
--- /dev/null
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java
@@ -0,0 +1,90 @@
+package org.apache.airavata.registry.cpi;
+
+import java.util.List;
+
+/**
+ * This is the interface for Registry CPI
+ */
+public interface Registry {
+
+ /**
+ * This method is to add an object in to the registry
+ * @param dataType Data type is a predefined type which the programmer should choose
according to the object he
+ * is going to save in to registry
+ * @param newObjectToAdd Object which contains the fields that need to be saved in to
registry. This object is a
+ * thrift model object. In experiment case this object can be BasicMetadata,
ConfigurationData
+ * etc
+ */
+ public void add(DataType dataType, Object newObjectToAdd);
+
+ /**
+ * This method is to update the whole object in registry
+ * @param dataType Data type is a predefined type which the programmer should choose
according to the object he
+ * is going to save in to registry
+ * @param newObjectToUpdate Object which contains the fields that need to be updated
in to registry. This object is a
+ * thrift model object. In experiment case this object can be BasicMetadata,
ConfigurationData
+ * etc. CPI programmer can only fill necessary fields that need
to be updated. He does not
+ * have to fill the whole object. He needs to only fill the mandatory
fields and whatever the
+ * other fields that need to be updated.
+ *
+ */
+ public void update(DataType dataType, Object newObjectToUpdate);
+
+ /**
+ * This method is to update a specific field of the data model
+ * @param dataType Data type is a predefined type which the programmer should choose
according to the object he
+ * is going to save in to registry
+ * @param identifier Identifier which will uniquely identify the data model. For example,
in Experiment_Basic_Type,
+ * identifier will be generated experimentID
+ * @param field Field which need to be updated in the registry. In Experiment_Basic_Type,
if you want to update the
+ * description, field will be "description"
+ * @param value Value by which the given field need to be updated. If the field is "description",
that field will be
+ * updated by given value
+ */
+ public void update(DataType dataType, Object identifier, Object field, Object value);
+
+ /**
+ * This method is to retrieve list of objects according to a given criteria
+ * @param dataType Data type is a predefined type which the programmer should choose
according to the object he
+ * is going to save in to registry
+ * @param filteredBy FilterBy is the field that filtering should be done. For example,
if we want to retrieve all
+ * the experiments for a given user, filterBy will be "userName"
+ * @param value value for the filtering field. In the experiment case, value for "userName"
can be "admin"
+ * @return List of objects according to the given criteria
+ */
+ public List<Object> get(DataType dataType, Object filteredBy, Object value);
+
+ /**
+ * This method is to retrieve a specific value for a given field.
+ * @param dataType Data type is a predefined type which the programmer should choose
according to the object he
+ * is going to save in to registry
+ * @param identifier Identifier which will uniquely identify the data model. For example,
in Experiment_Basic_Type,
+ * identifier will be generated experimentID
+ * @param field field that filtering should be done. For example, if we want to execution
user for a given
+ * experiment, field will be "userName"
+ * @return return the value for the specific field where data model is identified by
the unique identifier that has
+ * given
+ */
+ public Object getValue (DataType dataType, Object identifier, Object field);
+
+ /**
+ * This method is to remove a item from the registry
+ * @param dataType Data type is a predefined type which the programmer should choose
according to the object he
+ * is going to save in to registry
+ * @param identifier Identifier which will uniquely identify the data model. For example,
in Experiment_Basic_Type,
+ * identifier will be generated experimentID
+ */
+ public void remove (DataType dataType, Object identifier);
+
+ /**
+ * This method will check whether a given data type which can be identified with the
identifier exists or not
+ * @param dataType Data type is a predefined type which the programmer should choose
according to the object he
+ * is going to save in to registry
+ * @param identifier Identifier which will uniquely identify the data model. For example,
in Experiment_Basic_Type,
+ * identifier will be generated experimentID
+ * @return whether the given data type exists or not
+ */
+ public boolean isExist(DataType dataType, Object identifier);
+
+
+}
|