airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: fixing AIRAVATA-1285
Date Thu, 29 May 2014 18:46:48 GMT
Repository: airavata
Updated Branches:
  refs/heads/master e3b0bf2bf -> 0fadb0806


fixing AIRAVATA-1285


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

Branch: refs/heads/master
Commit: 0fadb080674244b0eb62d93a0840b1dea342ea9c
Parents: e3b0bf2
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Thu May 29 14:46:41 2014 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Thu May 29 14:46:41 2014 -0400

----------------------------------------------------------------------
 .../samples/TestCreateLaunchExperiment.java     | 546 +++++++++++++++++++
 .../persistance/registry/jpa/ResourceUtils.java |   4 +-
 .../registry/jpa/impl/ExperimentRegistry.java   |   3 +-
 .../jpa/model/AdvancedInputDataHandling.java    |   3 +
 .../jpa/model/AdvancedOutputDataHandling.java   |   3 +
 .../registry/jpa/model/ApplicationInput.java    |   3 +
 .../registry/jpa/model/ApplicationOutput.java   |   3 +
 .../Computational_Resource_Scheduling.java      |   3 +
 .../registry/jpa/model/Configuration.java       |   3 +
 .../registry/jpa/model/DataTransferDetail.java  |   3 +
 .../registry/jpa/model/ErrorDetail.java         |   3 +
 .../registry/jpa/model/Experiment.java          |   3 +
 .../jpa/model/ExperimentConfigData.java         |   3 +
 .../registry/jpa/model/Experiment_Input.java    |   3 +
 .../registry/jpa/model/Experiment_Output.java   |   3 +
 .../persistance/registry/jpa/model/Gateway.java |   3 +
 .../registry/jpa/model/Gateway_Worker.java      |   3 +
 .../registry/jpa/model/JobDetail.java           |   3 +
 .../registry/jpa/model/NodeInput.java           |   3 +
 .../registry/jpa/model/NodeOutput.java          |   3 +
 .../persistance/registry/jpa/model/Project.java |   3 +
 .../registry/jpa/model/ProjectUser.java         |   3 +
 .../registry/jpa/model/QosParam.java            |   3 +
 .../persistance/registry/jpa/model/Status.java  |   3 +
 .../registry/jpa/model/TaskDetail.java          |   3 +
 .../persistance/registry/jpa/model/Users.java   |   3 +
 .../registry/jpa/model/WorkflowNodeDetail.java  |   3 +
 .../registry/jpa/resources/WorkerResource.java  |  27 +
 28 files changed, 650 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/TestCreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/TestCreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/TestCreateLaunchExperiment.java
new file mode 100644
index 0000000..8dc907b
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/TestCreateLaunchExperiment.java
@@ -0,0 +1,546 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.samples;
+
+import org.apache.airavata.api.Airavata;
+import org.apache.airavata.api.client.AiravataClientFactory;
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.client.tools.DocumentCreator;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.common.utils.ClientSettings;
+import org.apache.airavata.model.error.*;
+import org.apache.airavata.model.util.ExperimentModelUtil;
+import org.apache.airavata.model.util.ProjectModelUtil;
+import org.apache.airavata.model.workspace.Project;
+import org.apache.airavata.model.workspace.experiment.*;
+import org.apache.airavata.model.workspace.experiment.Experiment;
+import org.apache.airavata.persistance.registry.jpa.model.*;
+import org.apache.thrift.TException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.Timestamp;
+import java.util.*;
+
+public class TestCreateLaunchExperiment {
+
+    //FIXME: Read from a config file
+    public static final String THRIFT_SERVER_HOST = "localhost";
+    public static final int THRIFT_SERVER_PORT = 8930;
+    private final static Logger logger = LoggerFactory.getLogger(TestCreateLaunchExperiment.class);
+    private static final String DEFAULT_USER = "default.registry.user";
+    private static final String DEFAULT_GATEWAY = "default.registry.gateway";
+
+    public static void main(String[] args) {
+        try {
+            AiravataUtils.setExecutionAsClient();
+            final Airavata.Client airavata = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT);
+            System.out.println("API version is " + airavata.getAPIVersion());
+//            addDescriptors();
+
+//            final String expId = createExperimentForSSHHost(airavata);
+//            final String expId = createExperimentForTrestles(airavata);
+//            final String expId = createExperimentForStampede(airavata);
+//            for (int i = 0 ; i < 100 ; i++){
+//                final String expId = createExperimentForLocalHost(airavata);
+//                System.out.println("Experiment ID : " + expId);
+//                launchExperiment(airavata, expId);
+//                Thread monitor = (new Thread(){
+//                    public void run() {
+//                        Map<String, JobStatus> jobStatuses = null;
+//                        while (true) {
+//                            try {
+//                                jobStatuses = airavata.getJobStatuses(expId);
+//                                Set<String> strings = jobStatuses.keySet();
+//                                for (String key : strings) {
+//                                    JobStatus jobStatus = jobStatuses.get(key);
+//                                    if(jobStatus == null){
+//                                        return;
+//                                    }else {
+//                                        if (JobState.COMPLETE.equals(jobStatus.getJobState())) {
+//                                            System.out.println("Job completed Job ID: " + key);
+//                                            return;
+//                                        }else{
+//                                            System.out.println("Job ID:" + key + jobStatuses.get(key).getJobState().toString());
+//                                        }
+//                                    }
+//                                }
+//                                System.out.println(airavata.getExperimentStatus(expId));
+//                                Thread.sleep(5000);
+//                            } catch (Exception e) {
+//                                e.printStackTrace();
+//                            }
+//                        }
+//
+//                    }
+//                });
+//                monitor.start();
+//                try {
+//                    monitor.join();
+//                } catch (InterruptedException e) {
+//                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+//                }
+//                try {
+//                    Thread.sleep(5000);
+//                } catch (InterruptedException e) {
+//                    e.printStackTrace(); // To change body of catch statement use
+//                    // File | Settings | File Templates.
+//                }
+//            }
+
+            for (int i = 0; i < 100 ; i++){
+                long time = System.currentTimeMillis();
+                List<Experiment> experiments = getExperimentsForUser(airavata, "admin");
+                System.out.println("Experiment count : " + experiments.size());
+                System.out.println(System.currentTimeMillis() - time);
+            }
+//            List<Experiment> experiments = getExperimentsForUser(airavata, "admin");
+//            System.out.println("Experiment count : " + experiments.size());
+//            for (Experiment ex : experiments){
+//                System.out.println(ex.getExperimentID());
+//            }
+
+        } catch (Exception e) {
+            logger.error("Error while connecting with server", e.getMessage());
+            e.printStackTrace();
+        }
+    }
+
+    public static void addDescriptors() throws AiravataAPIInvocationException,ApplicationSettingsException  {
+        try {
+            DocumentCreator documentCreator = new DocumentCreator(getAiravataAPI());
+            documentCreator.createLocalHostDocs();
+            documentCreator.createSSHHostDocs();
+            documentCreator.createGramDocs();
+            documentCreator.createPBSDocsForOGCE();
+            documentCreator.createSlurmDocs();
+            documentCreator.createSGEDocs();
+            documentCreator.createEchoHostDocs();
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Unable to create airavata API", e.getMessage());
+            throw new AiravataAPIInvocationException(e);
+        } catch (ApplicationSettingsException e) {
+            logger.error("Unable to create airavata API", e.getMessage());
+            throw new ApplicationSettingsException(e.getMessage());
+        }
+    }
+
+    private static AiravataAPI getAiravataAPI() throws AiravataAPIInvocationException, ApplicationSettingsException {
+        AiravataAPI airavataAPI;
+        try {
+            String sysUser = ClientSettings.getSetting(DEFAULT_USER);
+            String gateway = ClientSettings.getSetting(DEFAULT_GATEWAY);
+            airavataAPI = AiravataAPIFactory.getAPI(gateway, sysUser);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Unable to create airavata API", e.getMessage());
+            throw new AiravataAPIInvocationException(e);
+        } catch (ApplicationSettingsException e) {
+            logger.error("Unable to create airavata API", e.getMessage());
+            throw new ApplicationSettingsException(e.getMessage());
+        }
+        return airavataAPI;
+    }
+
+    public static String createExperimentForTrestles(Airavata.Client client) throws TException  {
+        try{
+            List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
+            DataObjectType input = new DataObjectType();
+            input.setKey("echo_input");
+            input.setType(DataType.STRING);
+            input.setValue("echo_output=Hello World");
+            exInputs.add(input);
+
+            List<DataObjectType> exOut = new ArrayList<DataObjectType>();
+            DataObjectType output = new DataObjectType();
+            output.setKey("echo_output");
+            output.setType(DataType.STRING);
+            output.setValue("");
+            exOut.add(output);
+
+            Experiment simpleExperiment =
+                    ExperimentModelUtil.createSimpleExperiment("default", "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs);
+            simpleExperiment.setExperimentOutputs(exOut);
+
+            ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 1, 1, 1, "normal", 0, 0, 1, "sds128");
+            UserConfigurationData userConfigurationData = new UserConfigurationData();
+            userConfigurationData.setAiravataAutoSchedule(false);
+            userConfigurationData.setOverrideManualScheduledParams(false);
+            userConfigurationData.setComputationalResourceScheduling(scheduling);
+            simpleExperiment.setUserConfigurationData(userConfigurationData);
+            return client.createExperiment(simpleExperiment);
+        } catch (AiravataSystemException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataSystemException(e);
+        } catch (InvalidRequestException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new InvalidRequestException(e);
+        } catch (AiravataClientException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataClientException(e);
+        }catch (TException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new TException(e);
+        }
+    }
+
+    public static String cloneExperiment(Airavata.Client client, String expId) throws TException  {
+        try{
+            return client.cloneExperiment(expId, "cloneExperiment1");
+        }catch (TException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new TException(e);
+        }
+    }
+
+    public static void updateExperiment(Airavata.Client client, String expId) throws TException  {
+        try{
+            Experiment experiment = client.getExperiment(expId);
+            experiment.setDescription("updatedDescription");
+            client.updateExperiment(expId, experiment );
+        }catch (TException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new TException(e);
+        }
+    }
+
+
+    public static String createExperimentForLocalHost(Airavata.Client client) throws TException  {
+        try{
+            List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
+            DataObjectType input = new DataObjectType();
+            input.setKey("echo_input");
+            input.setType(DataType.STRING);
+            input.setValue("echo_output=Hello World");
+            exInputs.add(input);
+
+            List<DataObjectType> exOut = new ArrayList<DataObjectType>();
+            DataObjectType output = new DataObjectType();
+            output.setKey("echo_output");
+            output.setType(DataType.STRING);
+            output.setValue("");
+            exOut.add(output);
+
+            Project project = ProjectModelUtil.createProject("project1", "admin", "test project");
+            String projectId = client.createProject(project);
+
+            Experiment simpleExperiment =
+                    ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment", "Echo Test", "Echo", exInputs);
+            simpleExperiment.setExperimentOutputs(exOut);
+
+            ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("localhost", 1, 1, 1, "normal", 0, 0, 1, "");
+            UserConfigurationData userConfigurationData = new UserConfigurationData();
+            userConfigurationData.setAiravataAutoSchedule(false);
+            userConfigurationData.setOverrideManualScheduledParams(false);
+            userConfigurationData.setComputationalResourceScheduling(scheduling);
+            simpleExperiment.setUserConfigurationData(userConfigurationData);
+            return client.createExperiment(simpleExperiment);
+        } catch (AiravataSystemException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataSystemException(e);
+        } catch (InvalidRequestException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new InvalidRequestException(e);
+        } catch (AiravataClientException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataClientException(e);
+        }catch (TException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new TException(e);
+        }
+    }
+    
+    public static String createExperimentForSSHHost(Airavata.Client client) throws TException  {
+        try{
+            List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
+            DataObjectType input = new DataObjectType();
+            input.setKey("echo_input");
+            input.setType(DataType.STRING);
+            input.setValue("echo_output=Hello World");
+            exInputs.add(input);
+
+            List<DataObjectType> exOut = new ArrayList<DataObjectType>();
+            DataObjectType output = new DataObjectType();
+            output.setKey("echo_output");
+            output.setType(DataType.STRING);
+            output.setValue("");
+            exOut.add(output);
+
+            Project project = ProjectModelUtil.createProject("default", "admin", "test project");
+            String projectId = client.createProject(project);
+
+            Experiment simpleExperiment =
+                    ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "sshEchoExperiment", "SSHEcho1", "SSHEcho1", exInputs);
+            simpleExperiment.setExperimentOutputs(exOut);
+
+            ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("gw111.iu.xsede.org", 1, 1, 1, "normal", 0, 0, 1, "sds128");
+            scheduling.setResourceHostId("gw111.iu.xsede.org");
+            UserConfigurationData userConfigurationData = new UserConfigurationData();
+            userConfigurationData.setAiravataAutoSchedule(false);
+            userConfigurationData.setOverrideManualScheduledParams(false);
+            userConfigurationData.setComputationalResourceScheduling(scheduling);
+            simpleExperiment.setUserConfigurationData(userConfigurationData);
+            return client.createExperiment(simpleExperiment);
+        } catch (AiravataSystemException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataSystemException(e);
+        } catch (InvalidRequestException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new InvalidRequestException(e);
+        } catch (AiravataClientException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataClientException(e);
+        }catch (TException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new TException(e);
+        }
+    }
+    public static String createExperimentForStampede(Airavata.Client client) throws TException  {
+        try{
+            List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
+            DataObjectType input = new DataObjectType();
+            input.setKey("echo_input");
+            input.setType(DataType.STRING);
+            input.setValue("echo_output=Hello World");
+            exInputs.add(input);
+
+            List<DataObjectType> exOut = new ArrayList<DataObjectType>();
+            DataObjectType output = new DataObjectType();
+            output.setKey("echo_output");
+            output.setType(DataType.STRING);
+            output.setValue("");
+            exOut.add(output);
+
+            Project project = ProjectModelUtil.createProject("default", "admin", "test project");
+            String projectId = client.createProject(project);
+
+            Experiment simpleExperiment =
+                    ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment", "SimpleEcho3", "SimpleEcho3", exInputs);
+            simpleExperiment.setExperimentOutputs(exOut);
+
+            ComputationalResourceScheduling scheduling =
+                    ExperimentModelUtil.createComputationResourceScheduling("stampede.tacc.xsede.org", 1, 1, 1, "normal", 0, 0, 1, "TG-STA110014S");
+            UserConfigurationData userConfigurationData = new UserConfigurationData();
+            userConfigurationData.setAiravataAutoSchedule(false);
+            userConfigurationData.setOverrideManualScheduledParams(false);
+            userConfigurationData.setComputationalResourceScheduling(scheduling);
+            simpleExperiment.setUserConfigurationData(userConfigurationData);
+            return client.createExperiment(simpleExperiment);
+        } catch (AiravataSystemException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataSystemException(e);
+        } catch (InvalidRequestException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new InvalidRequestException(e);
+        } catch (AiravataClientException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataClientException(e);
+        }catch (TException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new TException(e);
+        }
+    }
+       public static String createExperimentForLonestar(Airavata.Client client) throws TException  {
+        try{
+            List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
+            DataObjectType input = new DataObjectType();
+            input.setKey("echo_input");
+            input.setType(DataType.STRING);
+            input.setValue("echo_output=Hello World");
+            exInputs.add(input);
+
+            List<DataObjectType> exOut = new ArrayList<DataObjectType>();
+            DataObjectType output = new DataObjectType();
+            output.setKey("echo_output");
+            output.setType(DataType.STRING);
+            output.setValue("");
+            exOut.add(output);
+
+            Project project = ProjectModelUtil.createProject("default", "admin", "test project");
+            String projectId = client.createProject(project);
+
+            Experiment simpleExperiment =
+                    ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment", "SimpleEcho4", "SimpleEcho4", exInputs);
+            simpleExperiment.setExperimentOutputs(exOut);
+
+            ComputationalResourceScheduling scheduling =
+                    ExperimentModelUtil.createComputationResourceScheduling("lonestar.tacc.utexas.edu", 1, 1, 1, "normal", 0, 0, 1, "TG-STA110014S");
+            scheduling.setResourceHostId("lonestar-host");
+            UserConfigurationData userConfigurationData = new UserConfigurationData();
+            userConfigurationData.setAiravataAutoSchedule(false);
+            userConfigurationData.setOverrideManualScheduledParams(false);
+            userConfigurationData.setComputationalResourceScheduling(scheduling);
+            simpleExperiment.setUserConfigurationData(userConfigurationData);
+            return client.createExperiment(simpleExperiment);
+        } catch (AiravataSystemException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataSystemException(e);
+        } catch (InvalidRequestException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new InvalidRequestException(e);
+        } catch (AiravataClientException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataClientException(e);
+        } catch (LaunchValidationException e) {
+            logger.error("Validation failed" + e.getErrorMessage());
+            org.apache.airavata.model.error.ValidationResults validationResult = e.getValidationResult();
+            for (org.apache.airavata.model.error.ValidatorResult vResult : validationResult.getValidationResultList()) {
+                if (!vResult.isSetResult()) {
+                    System.out.println("Error:" + vResult.getErrorDetails());
+                }
+            }
+            throw e;
+        }catch (TException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new TException(e);
+        }
+    }
+    public static void launchExperiment (Airavata.Client client, String expId)
+            throws TException{
+        try {
+            client.launchExperiment(expId, "testToken");
+        } catch (ExperimentNotFoundException e) {
+            logger.error("Error occured while launching the experiment...", e.getMessage());
+            throw new ExperimentNotFoundException(e);
+        } catch (AiravataSystemException e) {
+            logger.error("Error occured while launching the experiment...", e.getMessage());
+            throw new AiravataSystemException(e);
+        } catch (InvalidRequestException e) {
+            logger.error("Error occured while launching the experiment...", e.getMessage());
+            throw new InvalidRequestException(e);
+        } catch (AiravataClientException e) {
+            logger.error("Error occured while launching the experiment...", e.getMessage());
+            throw new AiravataClientException(e);
+        }catch (TException e) {
+            logger.error("Error occured while launching the experiment...", e.getMessage());
+            throw new TException(e);
+        }
+    }
+
+    public static List<Experiment> getExperimentsForUser (Airavata.Client client, String user){
+        try {
+            return client.getAllUserExperiments(user);
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        }catch (TException e){
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static List<Project> getAllUserProject (Airavata.Client client, String user){
+        try {
+            return client.getAllUserProjects(user);
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        }catch (TException e){
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static List<Project> searchProjectsByProjectName (Airavata.Client client, String user, String projectName){
+        try {
+            return client.searchProjectsByProjectName(user, projectName);
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        }catch (TException e){
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static List<Project> searchProjectsByProjectDesc (Airavata.Client client, String user, String desc){
+        try {
+            return client.searchProjectsByProjectDesc(user, desc);
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        }catch (TException e){
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+
+    public static List<ExperimentSummary> searchExperimentsByName (Airavata.Client client, String user, String expName){
+        try {
+            return client.searchExperimentsByName(user, expName);
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        }catch (TException e){
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static List<ExperimentSummary> searchExperimentsByDesc(Airavata.Client client, String user, String desc){
+        try {
+            return client.searchExperimentsByDesc(user, desc);
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        }catch (TException e){
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static List<ExperimentSummary> searchExperimentsByApplication(Airavata.Client client, String user, String app){
+        try {
+            return client.searchExperimentsByApplication(user, app);
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        }catch (TException e){
+            e.printStackTrace();
+        }
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
index 3ee9324..9670c33 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
@@ -63,7 +63,9 @@ public class ResourceUtils {
             properties.put("openjpa.ConnectionProperties", connectionProperties);
             properties.put("openjpa.DynamicEnhancementAgent", "true");
             properties.put("openjpa.RuntimeUnenhancedClasses", "unsupported");
-            properties.put("openjpa.Log", "SQL=ERROR");
+            properties.put("openjpa.DataCache","true(CacheSize=5000)");
+            properties.put("openjpa.QueryCache","true(CacheSize=5000)");
+            properties.put("openjpa.RemoteCommitProvider","sjvm");
             properties.put("openjpa.Log","DefaultLevel=INFO, Runtime=INFO, Tool=INFO, SQL=INFO");
             properties.put("openjpa.ReadLockLevel", "none");
             properties.put("openjpa.WriteLockLevel", "none");

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/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 b2ff0a3..6df557f 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
@@ -1632,7 +1632,8 @@ public class ExperimentRegistry {
             if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.USER_NAME)) {
                 WorkerResource resource = (WorkerResource)gatewayResource.create(ResourceType.GATEWAY_WORKER);
                 resource.setUser((String)value);
-                List<ExperimentResource> resources = resource.getExperiments();
+//                List<ExperimentResource> resources = resource.getExperiments();
+                List<ExperimentResource> resources = resource.getExperimentsByCaching((String)value);
                 for (ExperimentResource experimentResource : resources) {
                     Experiment experiment = ThriftDataModelConversion.getExperiment(experimentResource);
                     experiments.add(experiment);

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedInputDataHandling.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedInputDataHandling.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedInputDataHandling.java
index 16aa6b2..4ed2f03 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedInputDataHandling.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedInputDataHandling.java
@@ -21,8 +21,11 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @Table(name = "ADVANCE_INPUT_DATA_HANDLING")
 public class AdvancedInputDataHandling {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedOutputDataHandling.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedOutputDataHandling.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedOutputDataHandling.java
index 93a1217..6785246 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedOutputDataHandling.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedOutputDataHandling.java
@@ -21,8 +21,11 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @Table(name = "ADVANCE_OUTPUT_DATA_HANDLING")
 public class AdvancedOutputDataHandling {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput.java
index 1b7105b..0b2a6de 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput.java
@@ -21,8 +21,11 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @Table(name = "APPLICATION_INPUT")
 @IdClass(ApplicationInput_PK.class)

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput.java
index 4afd1a1..dbe7b08 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput.java
@@ -21,8 +21,11 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @Table(name = "APPLICATION_OUTPUT")
 @IdClass(ApplicationOutput_PK.class)

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Computational_Resource_Scheduling.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Computational_Resource_Scheduling.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Computational_Resource_Scheduling.java
index 0f199e9..eb96958 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Computational_Resource_Scheduling.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Computational_Resource_Scheduling.java
@@ -21,9 +21,12 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 import java.sql.Timestamp;
 
+@DataCache
 @Entity
 @Table(name = "COMPUTATIONAL_RESOURCE_SCHEDULING")
 public class Computational_Resource_Scheduling {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Configuration.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Configuration.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Configuration.java
index 14570db..a7a1d4f 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Configuration.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Configuration.java
@@ -20,10 +20,13 @@
 */
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 import java.io.Serializable;
 import java.sql.Timestamp;
 
+@DataCache
 @Entity
 @Table(name ="CONFIGURATION")
 @IdClass(Configuration_PK.class)

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/DataTransferDetail.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/DataTransferDetail.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/DataTransferDetail.java
index 13497a3..dd14847 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/DataTransferDetail.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/DataTransferDetail.java
@@ -21,9 +21,12 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 import java.sql.Timestamp;
 
+@DataCache
 @Entity
 @Table(name = "DATA_TRANSFER_DETAIL")
 public class DataTransferDetail {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ErrorDetail.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ErrorDetail.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ErrorDetail.java
index 2b407e1..0e41c67 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ErrorDetail.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ErrorDetail.java
@@ -21,10 +21,13 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
 import java.sql.Timestamp;
 
+@DataCache
 @Entity
 @Table(name = "ERROR_DETAIL")
 public class ErrorDetail {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment.java
index 5a03f4b..25f119f 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment.java
@@ -21,11 +21,14 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 import java.sql.Timestamp;
 
 @Entity
 @Table(name = "EXPERIMENT")
+@DataCache
 public class Experiment {
     @Id
     @Column(name = "EXPERIMENT_ID")

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ExperimentConfigData.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ExperimentConfigData.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ExperimentConfigData.java
index ef7d38e..1b2ee30 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ExperimentConfigData.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ExperimentConfigData.java
@@ -21,8 +21,11 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @Table(name = "CONFIG_DATA")
 public class ExperimentConfigData {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment_Input.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment_Input.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment_Input.java
index 0b40b46..fc50040 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment_Input.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment_Input.java
@@ -21,8 +21,11 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @Table(name ="EXPERIMENT_INPUT")
 @IdClass(Experiment_Input_PK.class)

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment_Output.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment_Output.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment_Output.java
index 4c9e055..33acd2d 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment_Output.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment_Output.java
@@ -21,8 +21,11 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @Table(name ="")
 @IdClass(Experiment_Output_PK.class)

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Gateway.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Gateway.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Gateway.java
index a58b6b6..b141a6c 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Gateway.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Gateway.java
@@ -20,11 +20,14 @@
 */
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
+@DataCache
 @Entity
 @Table(name ="GATEWAY")
 public class Gateway {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Gateway_Worker.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Gateway_Worker.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Gateway_Worker.java
index e659181..fe11d56 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Gateway_Worker.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Gateway_Worker.java
@@ -20,8 +20,11 @@
 */
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @Table(name ="GATEWAY_WORKER")
 @IdClass(Gateway_Worker_PK.class)

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/JobDetail.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/JobDetail.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/JobDetail.java
index b399400..a65c1a5 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/JobDetail.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/JobDetail.java
@@ -21,9 +21,12 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 import java.sql.Timestamp;
 
+@DataCache
 @Entity
 @Table(name = "JOB_DETAIL")
 @IdClass(JobDetails_PK.class)

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/NodeInput.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/NodeInput.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/NodeInput.java
index 78a6a30..f7864b4 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/NodeInput.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/NodeInput.java
@@ -21,8 +21,11 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @Table(name = "NODE_INPUT")
 @IdClass(NodeInput_PK.class)

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/NodeOutput.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/NodeOutput.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/NodeOutput.java
index 7bf0cea..67cb080 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/NodeOutput.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/NodeOutput.java
@@ -21,8 +21,11 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @Table(name = "NODE_OUTPUT")
 @IdClass(NodeOutput_PK.class)

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Project.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Project.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Project.java
index 133c9d7..0efd2d7 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Project.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Project.java
@@ -20,9 +20,12 @@
 */
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 import java.sql.Timestamp;
 
+@DataCache
 @Entity
 @Table(name ="PROJECT")
 public class Project {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ProjectUser.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ProjectUser.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ProjectUser.java
index d93c81b..b7f19e3 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ProjectUser.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ProjectUser.java
@@ -22,8 +22,11 @@
 package org.apache.airavata.persistance.registry.jpa.model;
 
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @IdClass(ProjectUser_PK.class)
 @Table(name = "PROJECT_USER")

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/QosParam.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/QosParam.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/QosParam.java
index 32fa94a..fd9979b 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/QosParam.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/QosParam.java
@@ -21,8 +21,11 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @Table(name = "QOS_PARAMS")
 public class QosParam {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Status.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Status.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Status.java
index 427c9d2..2ac9435 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Status.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Status.java
@@ -21,9 +21,12 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 import java.sql.Timestamp;
 
+@DataCache
 @Entity
 @Table(name = "STATUS")
 public class Status {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/TaskDetail.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/TaskDetail.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/TaskDetail.java
index e58e25e..8d6a1e9 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/TaskDetail.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/TaskDetail.java
@@ -21,9 +21,12 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 import java.sql.Timestamp;
 
+@DataCache
 @Entity
 @Table(name = "TASK_DETAIL")
 public class TaskDetail {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Users.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Users.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Users.java
index 781b2d5..7203117 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Users.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Users.java
@@ -20,8 +20,11 @@
 */
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 
+@DataCache
 @Entity
 @Table(name ="USERS")
 public class Users {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/WorkflowNodeDetail.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/WorkflowNodeDetail.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/WorkflowNodeDetail.java
index c3e4a4f..9c6daca 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/WorkflowNodeDetail.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/WorkflowNodeDetail.java
@@ -21,9 +21,12 @@
 
 package org.apache.airavata.persistance.registry.jpa.model;
 
+import org.apache.openjpa.persistence.DataCache;
+
 import javax.persistence.*;
 import java.sql.Timestamp;
 
+@DataCache
 @Entity
 @Table(name = "WORKFLOW_NODE_DETAIL")
 public class WorkflowNodeDetail {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0fadb080/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
index 43e241c..0c9b603 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
@@ -34,6 +34,9 @@ import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.*;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
+import org.apache.openjpa.persistence.OpenJPAEntityManagerFactory;
+import org.apache.openjpa.persistence.OpenJPAPersistence;
+import org.apache.openjpa.persistence.QueryResultCache;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -528,4 +531,28 @@ public class WorkerResource extends AbstractResource {
         em.close();
         return result;
     }
+
+    /**
+     *
+     * @return list of experiments for the user
+     */
+    public List<ExperimentResource> getExperimentsByCaching(String user){
+        List<ExperimentResource> result=new ArrayList<ExperimentResource>();
+        String query = "SELECT e from Experiment e WHERE e.executionUser = '" + user + "'";
+        EntityManager em = ResourceUtils.getEntityManager();
+//        OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(em.getEntityManagerFactory());
+//        QueryResultCache qcache = oemf.getQueryResultCache();
+        // qcache.evictAll(Experiment.class);
+        em.getTransaction().begin();
+        Query q = em.createQuery(query);
+        List resultList = q.getResultList();
+        for (Object o : resultList){
+            Experiment experiment = (Experiment) o;
+            ExperimentResource experimentResource = (ExperimentResource)Utils.getResource(ResourceType.EXPERIMENT, experiment);
+            result.add(experimentResource);
+        }
+        em.getTransaction().commit();
+        em.close();
+        return result;
+    }
 }


Mime
View raw message