airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: test method to getAllComputeResources
Date Tue, 08 Jul 2014 20:57:00 GMT
Repository: airavata
Updated Branches:
  refs/heads/master de2f7ceb9 -> b26219fe3


test method to getAllComputeResources


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

Branch: refs/heads/master
Commit: b26219fe3ac9020e3319c32aba36aed0b19b7878
Parents: de2f7ce
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Tue Jul 8 16:56:59 2014 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Tue Jul 8 16:56:59 2014 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   |  24 +-
 .../samples/TestCreateLaunchExperiment.java     | 448 ++-----------------
 2 files changed, 41 insertions(+), 431 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/b26219fe/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index e00c1b9..b961307 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -1559,17 +1559,21 @@ public class AiravataServerHandler implements Airavata.Iface, Watcher
{
             appCatalog = AppCatalogFactory.getAppCatalog();
             ApplicationDeployment applicationDeployment = appCatalog.getApplicationDeployment();
             List<String> computeResourceIdList = new ArrayList<String>();
-            List<String> applicationModules = appCatalog.getApplicationInterface().getApplicationInterface(appInterfaceId).getApplicationModules();
+            ApplicationInterfaceDescription applicationInterface = appCatalog.getApplicationInterface().getApplicationInterface(appInterfaceId);
+            List<String> applicationModules = applicationInterface.getApplicationModules();
         	HashMap<String, String> filters = new HashMap<String,String>();
-            for (String moduleId : applicationModules) {
-            	filters.put(AbstractResource.ApplicationDeploymentConstants.APP_MODULE_ID, moduleId);
-				List<ApplicationDeploymentDescription> applicationDeployements = applicationDeployment.getApplicationDeployements(filters);
-            	for (ApplicationDeploymentDescription deploymentDescription : applicationDeployements)
{
-					if (!computeResourceIdList.contains(deploymentDescription.getComputeHostId())){
-						computeResourceIdList.add(deploymentDescription.getComputeHostId());
-					}
-				}
-			}
+            if (applicationModules != null && !applicationModules.isEmpty()){
+                for (String moduleId : applicationModules) {
+                    filters.put(AbstractResource.ApplicationDeploymentConstants.APP_MODULE_ID,
moduleId);
+                    List<ApplicationDeploymentDescription> applicationDeployements
= applicationDeployment.getApplicationDeployements(filters);
+                    for (ApplicationDeploymentDescription deploymentDescription : applicationDeployements)
{
+                        if (!computeResourceIdList.contains(deploymentDescription.getComputeHostId())){
+                            computeResourceIdList.add(deploymentDescription.getComputeHostId());
+                        }
+                    }
+                }
+            }
+
             return computeResourceIdList;
         } catch (AppCatalogException e) {
             logger.error("Error while saving compute resource...", e);

http://git-wip-us.apache.org/repos/asf/airavata/blob/b26219fe/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
index cb43d5a..aed60eb 100644
--- 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
@@ -30,6 +30,7 @@ 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.appcatalog.computeresource.ComputeResourceDescription;
 import org.apache.airavata.model.error.*;
 import org.apache.airavata.model.util.ExperimentModelUtil;
 import org.apache.airavata.model.util.ProjectModelUtil;
@@ -49,8 +50,8 @@ 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;
+    public static final String THRIFT_SERVER_HOST = "gw111.iu.xsede.org";
+    public static final int THRIFT_SERVER_PORT = 9930;
     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";
@@ -60,77 +61,16 @@ public class TestCreateLaunchExperiment {
             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.
-//                }
+            getAllComputeResources(airavata);
+            getAVailableComputeResourcesForApp(airavata, "Amber_0cecdf39-1ce2-4d98-bc76-87447e10fd4d");
+//            for (int i = 0; i < 10 ; i++){
+//                long time = System.currentTimeMillis();
+//                List<ExperimentSummary> experiments = getExperimentsForApplication(airavata,
"ultrascan", "US3Application");
+//                int count = i+1;
+//                System.out.println("Experiment count : " + experiments.size());
+//                System.out.println("iteration : " + String.valueOf(count));
+//                System.out.println(System.currentTimeMillis() - time);
 //            }
-
-//            List<Experiment> experimentList = getExperimentsForUser(airavata, "admin");
-//            Experiment experiment = experimentList.get(1);
-//            ExperimentStatus experimentStatus = experiment.getExperimentStatus();
-//            long timeOfStateChange = experimentStatus.getTimeOfStateChange();
-//            System.out.println(timeOfStateChange);
-//            Date date = new Date(timeOfStateChange);
-//            Format format = new SimpleDateFormat("yyyy MM dd HH:mm:ss");
-//            String time1 = format.format(date);
-////                int count = i+1;
-//            System.out.println(time1);
-
-            for (int i = 0; i < 500 ; i++){
-                long time = System.currentTimeMillis();
-                List<Experiment> experiments = getExperimentsForUser(airavata, "admin");
-                int count = i+1;
-                System.out.println("Experiment count : " + experiments.size());
-                System.out.println("iteration : " + String.valueOf(count));
-                System.out.println(System.currentTimeMillis() - time);
-            }
 //            List<Experiment> experiments = getExperimentsForUser(airavata, "admin");
 //            System.out.println("Experiment count : " + experiments.size());
 //            for (Experiment ex : experiments){
@@ -143,25 +83,6 @@ public class TestCreateLaunchExperiment {
         }
     }
 
-    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 {
@@ -178,281 +99,6 @@ public class TestCreateLaunchExperiment {
         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);
@@ -468,39 +114,9 @@ public class TestCreateLaunchExperiment {
         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){
+    public static List<ExperimentSummary> getExperimentsForApplication (Airavata.Client
client, String user, String application){
         try {
-            return client.searchProjectsByProjectDesc(user, desc);
+            return client.searchExperimentsByApplication(user, application);
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
@@ -513,49 +129,39 @@ public class TestCreateLaunchExperiment {
         return null;
     }
 
-
-    public static List<ExperimentSummary> searchExperimentsByName (Airavata.Client
client, String user, String expName){
+    public static void getAllComputeResources (Airavata.Client client){
         try {
-            return client.searchExperimentsByName(user, expName);
+            Map<String, String> allComputeResourceNames = client.getAllComputeResourceNames();
+            for (String id : allComputeResourceNames.keySet()){
+                System.out.println("resource id : " + id);
+                System.out.println("resource name : " + allComputeResourceNames.get(id));
+            }
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
             e.printStackTrace();
         } catch (AiravataClientException e) {
             e.printStackTrace();
-        }catch (TException e){
+        }catch (TException e) {
             e.printStackTrace();
         }
-        return null;
     }
 
-    public static List<ExperimentSummary> searchExperimentsByDesc(Airavata.Client client,
String user, String desc){
+    public static void getAVailableComputeResourcesForApp (Airavata.Client client, String
applicationName){
         try {
-            return client.searchExperimentsByDesc(user, desc);
+            List<String> resources = client.getAvailableAppInterfaceComputeResources(applicationName);
+            for (String id : resources){
+                System.out.println("resource id : " + id);
+            }
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
             e.printStackTrace();
         } catch (AiravataClientException e) {
             e.printStackTrace();
-        }catch (TException e){
+        }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;
-    }
 }


Mime
View raw message