Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 91F9010692 for ; Wed, 5 Feb 2014 15:42:51 +0000 (UTC) Received: (qmail 12263 invoked by uid 500); 5 Feb 2014 15:42:50 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 12202 invoked by uid 500); 5 Feb 2014 15:42:45 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 12195 invoked by uid 99); 5 Feb 2014 15:42:44 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Feb 2014 15:42:44 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B717891C1AE; Wed, 5 Feb 2014 15:42:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chathuri@apache.org To: commits@airavata.apache.org Message-Id: <2aaa5de749ae466c8dd085342c691fba@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: initial commit to AIRAVATA-1006 Date: Wed, 5 Feb 2014 15:42:43 +0000 (UTC) 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 Authored: Wed Feb 5 10:42:34 2014 -0500 Committer: chathuri 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 @@ registry-api + registry-cpi airavata-jpa-registry airavata-registry-service airavata-registry-test 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 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); + + +}