You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2014/02/10 18:17:29 UTC

git commit: adding new get methods AIRAVATA-1006

Updated Branches:
  refs/heads/master a0f437c1b -> 728e04b3f


adding new get methods AIRAVATA-1006


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/728e04b3
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/728e04b3
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/728e04b3

Branch: refs/heads/master
Commit: 728e04b3fd8e17b503b9bbfd186f7f12b5243a7e
Parents: a0f437c
Author: chathuri <ch...@apache.org>
Authored: Mon Feb 10 12:17:23 2014 -0500
Committer: chathuri <ch...@apache.org>
Committed: Mon Feb 10 12:17:23 2014 -0500

----------------------------------------------------------------------
 .../registry/jpa/impl/ExperimentRegistry.java   | 89 +++++++++++++++-----
 .../registry/jpa/impl/GatewayRegistry.java      |  9 +-
 .../registry/jpa/impl/RegistryImpl.java         | 51 ++++++++++-
 .../persistance/registry/jpa/impl/UserReg.java  |  7 +-
 .../jpa/utils/ThriftDataModelConversion.java    | 10 +--
 .../apache/airavata/registry/cpi/Registry.java  | 24 ++++++
 .../airavata/registry/cpi/utils/Constants.java  |  1 +
 7 files changed, 159 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/728e04b3/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index 5cfe7b9..008e250 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -22,6 +22,7 @@
 package org.apache.airavata.persistance.registry.jpa.impl;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.model.experiment.*;
 import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
@@ -37,15 +38,16 @@ import java.util.*;
 
 public class ExperimentRegistry {
     private GatewayRegistry gatewayRegistry;
+    private UserReg userReg;
     private final static Logger logger = LoggerFactory.getLogger(ExperimentRegistry.class);
 
     public String add(BasicMetadata basicMetadata) {
         String experimentID = "";
         try {
             gatewayRegistry = new GatewayRegistry();
-            GatewayResource gateway = gatewayRegistry.getGateway();
-            UserReg userReg = new UserReg();
-            WorkerResource worker = userReg.getWorker();
+            GatewayResource gateway = gatewayRegistry.getDefaultGateway();
+            userReg = new UserReg();
+            WorkerResource worker = userReg.getSysteUser();
             experimentID = getExperimentID(basicMetadata.getExperimentName());
             ExperimentMetadataResource exBasicData = gateway.createBasicMetada(experimentID);
             exBasicData.setExperimentName(basicMetadata.getExperimentName());
@@ -53,7 +55,7 @@ public class ExperimentRegistry {
             exBasicData.setExecutionUser(basicMetadata.getUserName());
             exBasicData.setSubmittedDate(getCurrentTimestamp());
             exBasicData.setShareExp(basicMetadata.isSetShareExperimentPublicly());
-            ProjectResource projectResource = worker.createProject(basicMetadata.getProjectID());
+            ProjectResource projectResource = worker.getProject(basicMetadata.getProjectID());
             exBasicData.setProject(projectResource);
             exBasicData.save();
         } catch (ApplicationSettingsException e) {
@@ -65,7 +67,7 @@ public class ExperimentRegistry {
     public void add(ConfigurationData configurationData, String experimentID) {
         try {
             gatewayRegistry = new GatewayRegistry();
-            GatewayResource gateway = gatewayRegistry.getGateway();
+            GatewayResource gateway = gatewayRegistry.getDefaultGateway();
             ExperimentMetadataResource exBasicData = (ExperimentMetadataResource) gateway.get(ResourceType.EXPERIMENT_METADATA, experimentID);
             ExperimentConfigDataResource exConfigData = (ExperimentConfigDataResource) exBasicData.create(ResourceType.EXPERIMENT_CONFIG_DATA);
             BasicMetadata updatedBasicMetadata = configurationData.getBasicMetadata();
@@ -160,7 +162,7 @@ public class ExperimentRegistry {
 
     public void updateExpBasicMetadataField(String expID, String fieldName, Object value) {
         try {
-            GatewayResource gateway = gatewayRegistry.getGateway();
+            GatewayResource gateway = gatewayRegistry.getDefaultGateway();
             ExperimentMetadataResource exBasicData = (ExperimentMetadataResource) gateway.get(ResourceType.EXPERIMENT_METADATA, expID);
             if (fieldName.equals(Constants.FieldConstants.BasicMetadataConstants.EXPERIMENT_NAME)) {
                 exBasicData.setExperimentName((String) value);
@@ -185,7 +187,7 @@ public class ExperimentRegistry {
 
     public void updateExpConfigDataField(String expID, String fieldName, Object value) {
         try {
-            GatewayResource gateway = gatewayRegistry.getGateway();
+            GatewayResource gateway = gatewayRegistry.getDefaultGateway();
             ExperimentMetadataResource exBasicData = (ExperimentMetadataResource) gateway.get(ResourceType.EXPERIMENT_METADATA, expID);
             ExperimentConfigDataResource exConfigData = (ExperimentConfigDataResource)exBasicData.get(ResourceType.EXPERIMENT_CONFIG_DATA, expID);
             if (fieldName.equals(Constants.FieldConstants.ConfigurationDataConstants.APPLICATION_ID)) {
@@ -256,20 +258,21 @@ public class ExperimentRegistry {
         }
     }
 
-
     public void updateBasicData(BasicMetadata basicMetadata, String expId) throws ApplicationSettingsException {
-        GatewayResource gateway = gatewayRegistry.getGateway();
+        GatewayResource gateway = gatewayRegistry.getDefaultGateway();
+        WorkerResource worker = userReg.getSysteUser();
         ExperimentMetadataResource exBasicData = (ExperimentMetadataResource) gateway.get(ResourceType.EXPERIMENT_METADATA, expId);
         exBasicData.setExperimentName(basicMetadata.getExperimentName());
         exBasicData.setDescription(basicMetadata.getExperimentDescription());
         exBasicData.setExecutionUser(basicMetadata.getUserName());
         exBasicData.setSubmittedDate(getCurrentTimestamp());
         exBasicData.setShareExp(basicMetadata.isSetShareExperimentPublicly());
+        exBasicData.setProject(worker.getProject(basicMetadata.getProjectID()));
         exBasicData.save();
     }
 
     public void updateExpConfigData(ConfigurationData configData, String expId) throws ApplicationSettingsException {
-        GatewayResource gateway = gatewayRegistry.getGateway();
+        GatewayResource gateway = gatewayRegistry.getDefaultGateway();
         ExperimentMetadataResource exBasicData = (ExperimentMetadataResource) gateway.get(ResourceType.EXPERIMENT_METADATA, expId);
         ExperimentConfigDataResource exConfigResource = (ExperimentConfigDataResource) exBasicData.get(ResourceType.EXPERIMENT_CONFIG_DATA, expId);
         BasicMetadata updatedBasicMetadata = configData.getBasicMetadata();
@@ -344,11 +347,9 @@ public class ExperimentRegistry {
     public List<BasicMetadata> getExperimentMetaDataList (String fieldName, Object value){
         List<BasicMetadata> metadataList = new ArrayList<BasicMetadata>();
         try {
-            gatewayRegistry = new GatewayRegistry();
-            GatewayResource gateway = gatewayRegistry.getGateway();
             if (fieldName.equals(Constants.FieldConstants.BasicMetadataConstants.USER_NAME)){
                 UserReg userRegistry = new UserReg();
-                WorkerResource worker = userRegistry.getWorker();
+                WorkerResource worker = userRegistry.getSysteUser();
                 List<Resource> resources = worker.get(ResourceType.EXPERIMENT_METADATA);
                 for (Resource resource : resources){
                     ExperimentMetadataResource ex =  (ExperimentMetadataResource)resource;
@@ -369,7 +370,7 @@ public class ExperimentRegistry {
         List<ConfigurationData> configDataList = new ArrayList<ConfigurationData>();
         try {
             gatewayRegistry = new GatewayRegistry();
-            GatewayResource gateway = gatewayRegistry.getGateway();
+            GatewayResource gateway = gatewayRegistry.getDefaultGateway();
             if (fieldName.equals(Constants.FieldConstants.ConfigurationDataConstants.EXPERIMENT_ID)){
                 ExperimentMetadataResource exBasicData = (ExperimentMetadataResource) gateway.get(ResourceType.EXPERIMENT_METADATA, (String)value);
                 List<Resource> resources = exBasicData.get(ResourceType.EXPERIMENT_CONFIG_DATA);
@@ -388,12 +389,14 @@ public class ExperimentRegistry {
         return configDataList;
     }
 
-    public Object getBasicMetaDataValues(String expId, String fieldName) {
+    public Object getBasicMetaData(String expId, String fieldName) {
         try {
             gatewayRegistry = new GatewayRegistry();
-            GatewayResource gateway = gatewayRegistry.getGateway();
+            GatewayResource gateway = gatewayRegistry.getDefaultGateway();
             ExperimentMetadataResource exBasicData = (ExperimentMetadataResource) gateway.get(ResourceType.EXPERIMENT_METADATA, expId);
-            if (fieldName.equals(Constants.FieldConstants.BasicMetadataConstants.USER_NAME)){
+            if (fieldName == null){
+                return exBasicData;
+            }else if (fieldName.equals(Constants.FieldConstants.BasicMetadataConstants.USER_NAME)){
                 return exBasicData.getExecutionUser();
             }else if (fieldName.equals(Constants.FieldConstants.BasicMetadataConstants.EXPERIMENT_NAME)){
                 return exBasicData.getExperimentName();
@@ -414,13 +417,15 @@ public class ExperimentRegistry {
         return null;
     }
 
-    public Object getConfigDataValues(String expId, String fieldName) {
+    public Object getConfigData(String expId, String fieldName) {
         try {
             gatewayRegistry = new GatewayRegistry();
-            GatewayResource gateway = gatewayRegistry.getGateway();
+            GatewayResource gateway = gatewayRegistry.getDefaultGateway();
             ExperimentMetadataResource exBasicData = (ExperimentMetadataResource) gateway.get(ResourceType.EXPERIMENT_METADATA, expId);
             ExperimentConfigDataResource exCongfig = (ExperimentConfigDataResource)exBasicData.get(ResourceType.EXPERIMENT_CONFIG_DATA, expId);
-            if (fieldName.equals(Constants.FieldConstants.ConfigurationDataConstants.APPLICATION_ID)){
+            if (fieldName == null){
+                return exCongfig;
+            }else if (fieldName.equals(Constants.FieldConstants.ConfigurationDataConstants.APPLICATION_ID)){
                 return exCongfig.getApplicationID();
             }else if (fieldName.equals(Constants.FieldConstants.ConfigurationDataConstants.APPLICATION_VERSION)){
                 return exCongfig.getApplicationVersion();
@@ -428,13 +433,55 @@ public class ExperimentRegistry {
                 return exCongfig.getWorkflowTemplateId();
             }else if (fieldName.equals(Constants.FieldConstants.ConfigurationDataConstants.WORKFLOW_TEMPLATE_VERSION)){
                 return exCongfig.getWorkflowTemplateVersion();
+            }else if (fieldName.equals(Constants.FieldConstants.ConfigurationDataConstants.EXPERIMENT_INPUTS)){
+                return ThriftDataModelConversion.getExperimentInputs(exBasicData);
+            }else if (fieldName.equals(Constants.FieldConstants.ConfigurationDataConstants.COMPUTATIONAL_RESOURCE_SCHEDULING)){
+                return ThriftDataModelConversion.getComputationalResourceScheduling(exCongfig);
+            }else if (fieldName.equals(Constants.FieldConstants.ConfigurationDataConstants.ADVANCED_INPUT_HANDLING)){
+                return ThriftDataModelConversion.getAdvanceInputDataHandling(exCongfig);
+            }else if (fieldName.equals(Constants.FieldConstants.ConfigurationDataConstants.ADVANCED_OUTPUT_HANDLING)){
+                return ThriftDataModelConversion.getAdvanceOutputDataHandling(exCongfig);
+            }else if (fieldName.equals(Constants.FieldConstants.ConfigurationDataConstants.QOS_PARAMS)){
+                return ThriftDataModelConversion.getQOSParams(exCongfig);
+            }else {
+                logger.error("Unsupported field name for experiment configuration data..");
             }
         } catch (ApplicationSettingsException e) {
-            e.printStackTrace();
+            logger.error("Unable to read airavata-server properties..", e.getMessage());
         }
         return null;
     }
 
+    public List<String> getExperimentIDs (String fieldName, Object value) {
+        List<String> expIDs = new ArrayList<String>();
+        try {
+            if (fieldName.equals(Constants.FieldConstants.BasicMetadataConstants.GATEWAY)) {
+                GatewayResource gateway = gatewayRegistry.getExistingGateway((String) value);
+                if (gateway == null) {
+                    logger.error("You should use an existing gateway in order to retrieve experiments..");
+                    return null;
+                } else {
+                    List<Resource> resources = gateway.get(ResourceType.EXPERIMENT_METADATA);
+                    for (Resource resource : resources) {
+                        String expID = ((ExperimentMetadataResource) resource).getExpID();
+                        expIDs.add(expID);
+                    }
+                }
+            } else if (fieldName.equals(Constants.FieldConstants.BasicMetadataConstants.USER_NAME)) {
+                WorkerResource workerResource = userReg.getExistingUser(ServerSettings.getSystemUserGateway(), (String)value);
+                List<Resource> resources = workerResource.get(ResourceType.EXPERIMENT_METADATA);
+                for (Resource resource : resources) {
+                    String expID = ((ExperimentMetadataResource) resource).getExpID();
+                    expIDs.add(expID);
+                }
+            }
+        } catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata-server properties..", e.getMessage());
+        }
+        return expIDs;
+    }
+
+
     public void remove(DependentDataType dataType, Object identifier) {
 
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/728e04b3/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/GatewayRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/GatewayRegistry.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/GatewayRegistry.java
index 931f62f..db6b139 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/GatewayRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/GatewayRegistry.java
@@ -27,9 +27,12 @@ import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
 
 public class GatewayRegistry {
-    public GatewayResource getGateway () throws ApplicationSettingsException {
-        GatewayResource gateway = (GatewayResource)ResourceUtils.getGateway(ServerSettings.getSystemUserGateway());
-        return gateway;
+    public GatewayResource getDefaultGateway () throws ApplicationSettingsException {
+        return (GatewayResource)ResourceUtils.getGateway(ServerSettings.getSystemUserGateway());
+    }
+
+    public GatewayResource getExistingGateway (String gatewayName) {
+        return (GatewayResource)ResourceUtils.getGateway(gatewayName);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/728e04b3/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
index e2e95ed..279fd48 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
@@ -101,6 +101,29 @@ public class RegistryImpl implements Registry {
     }
 
     /**
+     * This method is to retrieve object according to the identifier. In the experiment basic data type, if you give the
+     * experiment id, this method will return the BasicMetadata object
+     * @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 object according to the given identifier.
+     */
+    @Override
+    public Object get(DataType dataType, Object identifier) {
+
+        switch (dataType){
+            case EXPERIMENT_BASIC_DATA:
+                return experimentRegistry.getBasicMetaData((String)identifier, null);
+            case EXPERIMENT_CONFIGURATION_DATA:
+                return experimentRegistry.getConfigData((String)identifier, null);
+            default:
+                logger.error("Unsupported data type...", new UnsupportedOperationException());
+                throw new UnsupportedOperationException();
+        }
+    }
+
+    /**
      * 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
@@ -146,9 +169,33 @@ public class RegistryImpl implements Registry {
     public Object getValue(DataType dataType, Object identifier, String field) {
         switch (dataType){
             case EXPERIMENT_BASIC_DATA:
-                return experimentRegistry.getBasicMetaDataValues((String)identifier, field);
+                return experimentRegistry.getBasicMetaData((String) identifier, field);
+            case EXPERIMENT_CONFIGURATION_DATA:
+                return experimentRegistry.getConfigData((String) identifier, field);
+            default:
+                logger.error("Unsupported data type...", new UnsupportedOperationException());
+                throw new UnsupportedOperationException();
+        }
+    }
+
+    /**
+     * This method is to retrieve all the identifiers according to given filtering criteria. For an example, if you want
+     * to get all the experiment ids for a given gateway, your field name will be "gateway" and the value will be the
+     * name of the gateway ("default"). Similar manner you can retrieve all the experiment ids for a given user.
+     * @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 fieldName FieldName 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 id list according to the filtering criteria
+     */
+    @Override
+    public List<String> getIds(DataType dataType, String fieldName, Object value) {
+        switch (dataType){
+            case EXPERIMENT_BASIC_DATA:
+                return experimentRegistry.getExperimentIDs(fieldName, value);
             case EXPERIMENT_CONFIGURATION_DATA:
-                return experimentRegistry.getConfigDataValues((String) identifier, field);
+                return experimentRegistry.getExperimentIDs(fieldName, value);
             default:
                 logger.error("Unsupported data type...", new UnsupportedOperationException());
                 throw new UnsupportedOperationException();

http://git-wip-us.apache.org/repos/asf/airavata/blob/728e04b3/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java
index 016a2bc..8543c35 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java
@@ -27,8 +27,13 @@ import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
 
 public class UserReg {
-    public WorkerResource getWorker () throws ApplicationSettingsException {
+    public WorkerResource getSysteUser () throws ApplicationSettingsException {
         WorkerResource worker = (WorkerResource)ResourceUtils.getWorker(ServerSettings.getSystemUserGateway(), ServerSettings.getSystemUser());
         return worker;
     }
+
+    public WorkerResource getExistingUser (String gatewayName, String userName) {
+        WorkerResource worker = (WorkerResource)ResourceUtils.getWorker(gatewayName, userName);
+        return worker;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/728e04b3/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
index a02f61c..27da417 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
@@ -61,7 +61,7 @@ public class ThriftDataModelConversion {
         return configData;
     }
 
-    private static Map<String, String> getExperimentInputs (ExperimentMetadataResource exmdr){
+    public static Map<String, String> getExperimentInputs (ExperimentMetadataResource exmdr){
         List<Resource> resources = exmdr.get(ResourceType.EXPERIMENT_INPUT);
         Map<String, String> exInputs = new HashMap<String, String>();
         for (Resource resource : resources){
@@ -71,7 +71,7 @@ public class ThriftDataModelConversion {
         return exInputs;
     }
 
-    private static ComputationalResourceScheduling getComputationalResourceScheduling (ExperimentConfigDataResource excdr){
+    public static ComputationalResourceScheduling getComputationalResourceScheduling (ExperimentConfigDataResource excdr){
         ComputationalResourceScheduling scheduling = new ComputationalResourceScheduling();
         scheduling.setAiravataAutoSchedule(excdr.isAiravataAutoSchedule());
         scheduling.setOverrideManualScheduledParams(excdr.isOverrideManualSchedule());
@@ -87,7 +87,7 @@ public class ThriftDataModelConversion {
         return scheduling;
     }
 
-    private static AdvancedInputDataHandling getAdvanceInputDataHandling(ExperimentConfigDataResource excd){
+    public static AdvancedInputDataHandling getAdvanceInputDataHandling(ExperimentConfigDataResource excd){
         AdvancedInputDataHandling adih = new AdvancedInputDataHandling();
         adih.setStageInputFilesToWorkingDir(excd.isStageInputsToWDir());
         adih.setWorkingDirectoryParent(excd.getWorkingDirParent());
@@ -96,7 +96,7 @@ public class ThriftDataModelConversion {
         return adih;
     }
 
-    private static AdvancedOutputDataHandling getAdvanceOutputDataHandling(ExperimentConfigDataResource excd){
+    public static AdvancedOutputDataHandling getAdvanceOutputDataHandling(ExperimentConfigDataResource excd){
         AdvancedOutputDataHandling outputDataHandling = new AdvancedOutputDataHandling();
         outputDataHandling.setOutputdataDir(excd.getOutputDataDir());
         outputDataHandling.setDataRegistryURL(excd.getDataRegURL());
@@ -104,7 +104,7 @@ public class ThriftDataModelConversion {
         return outputDataHandling;
     }
 
-    private static QualityOfServiceParams getQOSParams (ExperimentConfigDataResource excd){
+    public static QualityOfServiceParams getQOSParams (ExperimentConfigDataResource excd){
         QualityOfServiceParams qosParams = new QualityOfServiceParams();
         qosParams.setStartExecutionAt(excd.getStartExecutionAt());
         qosParams.setExecuteBefore(excd.getExecuteBefore());

http://git-wip-us.apache.org/repos/asf/airavata/blob/728e04b3/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
index 5e3b5b6..1ec2642 100644
--- 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
@@ -76,6 +76,17 @@ public interface Registry {
     public void update(DataType dataType, Object identifier, String fieldName, Object value);
 
     /**
+     * This method is to retrieve object according to the identifier. In the experiment basic data type, if you give the
+     * experiment id, this method will return the BasicMetadata object
+     * @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 object according to the given identifier.
+     */
+    public Object get(DataType dataType, Object identifier);
+
+    /**
      * 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
@@ -100,6 +111,19 @@ public interface Registry {
     public Object getValue (DataType dataType, Object identifier, String field);
 
     /**
+     * This method is to retrieve all the identifiers according to given filtering criteria. For an example, if you want
+     * to get all the experiment ids for a given gateway, your field name will be "gateway" and the value will be the
+     * name of the gateway ("default"). Similar manner you can retrieve all the experiment ids for a given user.
+     * @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 fieldName FieldName 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 id list according to the filtering criteria
+     */
+    public List<String> getIds (DataType dataType, String fieldName, Object value);
+
+    /**
      * 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

http://git-wip-us.apache.org/repos/asf/airavata/blob/728e04b3/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java
index 3f69934..6919a08 100644
--- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java
@@ -26,6 +26,7 @@ public class Constants {
         public final class BasicMetadataConstants {
             public static final String EXPERIMENT_NAME = "experimentName";
             public static final String USER_NAME = "userName";
+            public static final String GATEWAY = "gateway";
             public static final String EXPERIMENT_DESC = "experimentDescription";
             public static final String SHARE_EXP_PUBLIC = "shareExperimentPublicly";
             public static final String PROJECT_NAME = "project";