You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2015/03/03 23:36:53 UTC

[1/2] airavata git commit: Updating API calls to use gatewayId - AIRAVATA-1607

Repository: airavata
Updated Branches:
  refs/heads/master 8be598817 -> b1f0b00d3


http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterUS3Application.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterUS3Application.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterUS3Application.java
index 8567c74..27a4063 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterUS3Application.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterUS3Application.java
@@ -159,7 +159,7 @@ public class RegisterUS3Application {
             System.out.println("\n #### Registering Application Modules #### \n");
 
             //Register Echo
-            ultrascanModuleId = airavataClient.registerApplicationModule(
+            ultrascanModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             "ultrascan", "1.0", "ultrascan application"));
             System.out.println("Ultrascan Module Id " + ultrascanModuleId);
@@ -191,7 +191,7 @@ public class RegisterUS3Application {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
   
-            ultrascanAppId = airavataClient.registerApplicationInterface(
+            ultrascanAppId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("ultrascan", "ultrascan application",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Ultrascan Application Interface Id " + ultrascanAppId);
@@ -206,17 +206,17 @@ public class RegisterUS3Application {
 			System.out.println("#### Registering Application Deployments on Stampede #### \n");
 
 			// Register Stampede
-			String ultascanStamplede = airavataClient.registerApplicationDeployment(RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
+			String ultascanStamplede = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
 					stampedeResourceId, "/home1/01623/us3/bin/us_mpi_analysis", ApplicationParallelismType.MPI, "ultrascan application", null, null, null));
 			System.out.println("Ultrascan on stampede deployment Id " + ultascanStamplede);
 			
-			String ultascanTrestles = airavataClient.registerApplicationDeployment(RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
+			String ultascanTrestles = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
 					trestlesResourceId, "/home/us3/trestles/bin/us_mpi_analysis", ApplicationParallelismType.MPI, "ultrascan application", null, null, null));
 			System.out.println("Ultrascan on trestles deployment Id " + ultascanTrestles);
-			String ultascanLonestar = airavataClient.registerApplicationDeployment(RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
+			String ultascanLonestar = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
 					lonestarResourceId, "/home1/01623/us3/bin/us_mpi_analysis", ApplicationParallelismType.MPI, "ultrascan application", null, null ,null));
 			System.out.println("Ultrascan on lonestar deployment Id " + ultascanLonestar);
-			String ultascanAlamo = airavataClient.registerApplicationDeployment(RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
+			String ultascanAlamo = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
 					alamoResourceId, "/home/us3/bin/us_mpi_analysis.sh", ApplicationParallelismType.MPI, "ultrascan application", null, null ,null));
 			System.out.println("Ultrascan on alamo deployment Id " + ultascanAlamo);
 		} catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java
----------------------------------------------------------------------
diff --git a/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java b/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java
index 17107cf..d56c2b8 100644
--- a/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java
+++ b/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java
@@ -103,7 +103,7 @@ public class BaseCaseIT extends WorkflowIntegrationTestBase {
         exOut.add(output);
 
         Project project = ProjectModelUtil.createProject("project1", "admin", "test project");
-        String projectId = getClient().createProject(project);
+        String projectId = getClient().createProject("default", project);
 
         Experiment simpleExperiment = ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs);
         simpleExperiment.setExperimentOutputs(exOut);
@@ -177,7 +177,7 @@ public class BaseCaseIT extends WorkflowIntegrationTestBase {
         exOut.add(output);
 
         Project project = ProjectModelUtil.createProject("project1", "admin", "test project");
-        String projectId = getClient().createProject(project);
+        String projectId = getClient().createProject("default", project);
 
         Experiment simpleExperiment = ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment", "SimpleEcho3", "SimpleEcho3", exInputs);
         simpleExperiment.setExperimentOutputs(exOut);

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/modules/integration-tests/src/test/java/org/apache/airavata/integration/DataRetrievalIT.java
----------------------------------------------------------------------
diff --git a/modules/integration-tests/src/test/java/org/apache/airavata/integration/DataRetrievalIT.java b/modules/integration-tests/src/test/java/org/apache/airavata/integration/DataRetrievalIT.java
index c768b68..a23fff0 100644
--- a/modules/integration-tests/src/test/java/org/apache/airavata/integration/DataRetrievalIT.java
+++ b/modules/integration-tests/src/test/java/org/apache/airavata/integration/DataRetrievalIT.java
@@ -83,7 +83,7 @@ public class DataRetrievalIT extends AbstractIntegrationTest {
     private void addProjects() throws TException {
         for (int i = 0; i < projects.length; i++){
         	Project project = ProjectModelUtil.createProject(projects[i], "admin", "test project");
-            String projectId = getClient().createProject(project);
+            String projectId = getClient().createProject("default", project);
             projectIds.add(projectId);
         }
     }
@@ -161,7 +161,7 @@ public class DataRetrievalIT extends AbstractIntegrationTest {
 	public List<Experiment> listUserExperiments(String user) throws ApplicationSettingsException,
 			AiravataClientConnectException, InvalidRequestException,
 			AiravataClientException, AiravataSystemException, TException {
-		return getClient().getAllUserExperiments(user);
+		return getClient().getAllUserExperiments("default", user);
 	}
 
 	public List<Experiment> listProjectExperiments(String projectID) throws ApplicationSettingsException,
@@ -173,7 +173,7 @@ public class DataRetrievalIT extends AbstractIntegrationTest {
 	public List<Project> listUserProjects(String user) throws ApplicationSettingsException,
 			AiravataClientConnectException, InvalidRequestException,
 			AiravataClientException, AiravataSystemException, TException {
-		return getClient().getAllUserProjects(user);
+		return getClient().getAllUserProjects("default", user);
 	}
 
 	public String runExperiment(String user, String project) throws ApplicationSettingsException, AiravataClientConnectException,
@@ -209,7 +209,7 @@ public class DataRetrievalIT extends AbstractIntegrationTest {
 		simpleExperiment.setUserConfigurationData(userConfigurationData);
 
 		Client client = getClient();
-		final String expId = client.createExperiment(simpleExperiment);
+		final String expId = client.createExperiment("default", simpleExperiment);
 
 		client.launchExperiment(expId, "testToken");
 		return expId;

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/modules/integration-tests/src/test/java/org/apache/airavata/integration/SimpleEchoIT.java
----------------------------------------------------------------------
diff --git a/modules/integration-tests/src/test/java/org/apache/airavata/integration/SimpleEchoIT.java b/modules/integration-tests/src/test/java/org/apache/airavata/integration/SimpleEchoIT.java
index 81d1383..0b94c43 100644
--- a/modules/integration-tests/src/test/java/org/apache/airavata/integration/SimpleEchoIT.java
+++ b/modules/integration-tests/src/test/java/org/apache/airavata/integration/SimpleEchoIT.java
@@ -77,7 +77,7 @@ public class SimpleEchoIT extends SingleAppIntegrationTestBase {
         exOut.add(output);
 
         Project project = ProjectModelUtil.createProject("project1", "admin", "test project");
-        String projectId = getClient().createProject(project);
+        String projectId = getClient().createProject("default", project);
 
         Experiment simpleExperiment =
                 ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment", appId, appId, exInputs);

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/modules/integration-tests/src/test/java/org/apache/airavata/integration/SingleAppIntegrationTestBase.java
----------------------------------------------------------------------
diff --git a/modules/integration-tests/src/test/java/org/apache/airavata/integration/SingleAppIntegrationTestBase.java b/modules/integration-tests/src/test/java/org/apache/airavata/integration/SingleAppIntegrationTestBase.java
index bd2593a..a2f0b91 100644
--- a/modules/integration-tests/src/test/java/org/apache/airavata/integration/SingleAppIntegrationTestBase.java
+++ b/modules/integration-tests/src/test/java/org/apache/airavata/integration/SingleAppIntegrationTestBase.java
@@ -37,7 +37,7 @@ import org.junit.Assert;
 public class SingleAppIntegrationTestBase extends AbstractIntegrationTest {
 
     protected String createExperiment(Experiment experiment) throws AiravataSystemException, InvalidRequestException, TException {
-        return getClient().createExperiment(experiment);
+        return getClient().createExperiment("default", experiment);
     }
 
     protected void launchExperiment(String expId) throws ExperimentNotFoundException, AiravataSystemException, InvalidRequestException, TException {

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/modules/integration-tests/src/test/java/org/apache/airavata/integration/WorkflowIntegrationTestBase.java
----------------------------------------------------------------------
diff --git a/modules/integration-tests/src/test/java/org/apache/airavata/integration/WorkflowIntegrationTestBase.java b/modules/integration-tests/src/test/java/org/apache/airavata/integration/WorkflowIntegrationTestBase.java
index f0e4242..b6528f0 100644
--- a/modules/integration-tests/src/test/java/org/apache/airavata/integration/WorkflowIntegrationTestBase.java
+++ b/modules/integration-tests/src/test/java/org/apache/airavata/integration/WorkflowIntegrationTestBase.java
@@ -184,7 +184,7 @@ public abstract class WorkflowIntegrationTestBase {
 //    }
 
     protected String createExperiment (Experiment experiment) throws AiravataSystemException, InvalidRequestException, AiravataClientException, TException, AiravataClientConnectException {
-        return getClient().createExperiment(experiment);
+        return getClient().createExperiment("default", experiment);
     }
 
     protected void launchExperiment (String expId) throws ExperimentNotFoundException, AiravataSystemException, InvalidRequestException, AiravataClientException, TException, AiravataClientConnectException {

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/modules/integration-tests/src/test/java/org/apache/airavata/integration/tools/DocumentCreatorNew.java
----------------------------------------------------------------------
diff --git a/modules/integration-tests/src/test/java/org/apache/airavata/integration/tools/DocumentCreatorNew.java b/modules/integration-tests/src/test/java/org/apache/airavata/integration/tools/DocumentCreatorNew.java
index 2823202..281fc90 100644
--- a/modules/integration-tests/src/test/java/org/apache/airavata/integration/tools/DocumentCreatorNew.java
+++ b/modules/integration-tests/src/test/java/org/apache/airavata/integration/tools/DocumentCreatorNew.java
@@ -50,6 +50,7 @@ import java.util.*;
 
 public class DocumentCreatorNew {
 
+    private static final String DEFAULT_GATEWAY = "default.registry.gateway";
     private AppCatalog appcatalog = null;
     private String trestleshpcHostAddress = "trestles.sdsc.edu";
     private String lonestarHostAddress = "lonestar.tacc.utexas.edu";
@@ -92,7 +93,7 @@ public class DocumentCreatorNew {
 
         //Define application module
         ApplicationModule module = DocumentCreatorUtils.createApplicationModule("echo", "1.0.0", "Local host echo applications");
-        module.setAppModuleId(client.registerApplicationModule(module));
+        module.setAppModuleId(client.registerApplicationModule(DEFAULT_GATEWAY, module));
 
         //Define application interfaces
         ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
@@ -101,11 +102,11 @@ public class DocumentCreatorNew {
         application.addToApplicationModules(module.getAppModuleId());
         application.addToApplicationInputs(DocumentCreatorUtils.createAppInput("echo_input", "echo_input", "Echo Input Data", null, DataType.STRING));
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("echo_output", null, DataType.STRING));
-        application.setApplicationInterfaceId(client.registerApplicationInterface(application));
+        application.setApplicationInterfaceId(client.registerApplicationInterface(DEFAULT_GATEWAY, application));
 
         //Define application deployment
         ApplicationDeploymentDescription deployment = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module.getAppModuleId(), "/bin/echo", ApplicationParallelismType.SERIAL, "Local echo app depoyment");
-        deployment.setAppDeploymentId(client.registerApplicationDeployment(deployment));
+        deployment.setAppDeploymentId(client.registerApplicationDeployment(DEFAULT_GATEWAY, deployment));
 
         //Define gateway profile
         ComputeResourcePreference computeResourcePreference = DocumentCreatorUtils.createComputeResourcePreference(
@@ -161,11 +162,11 @@ public class DocumentCreatorNew {
         client.addSCPDataMovementDetails(host.getComputeResourceId(), 1, scpDataMovement);
 
         ApplicationModule module = DocumentCreatorUtils.createApplicationModule("echo", "1.1", null);
-        module.setAppModuleId(client.registerApplicationModule(module));
+        module.setAppModuleId(client.registerApplicationModule(DEFAULT_GATEWAY, module));
         ;
 
         ApplicationDeploymentDescription deployment = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module.getAppModuleId(), "/bin/echo", ApplicationParallelismType.SERIAL, "SSHEchoApplication");
-        client.registerApplicationDeployment(deployment);
+        client.registerApplicationDeployment(DEFAULT_GATEWAY, deployment);
 
         ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
 //    	application.setIsEmpty(false);
@@ -173,7 +174,7 @@ public class DocumentCreatorNew {
         application.addToApplicationModules(module.getAppModuleId());
         application.addToApplicationInputs(DocumentCreatorUtils.createAppInput("echo_input", "echo_input", null, null, DataType.STRING));
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("echo_output", null, DataType.STRING));
-        client.registerApplicationInterface(application);
+        client.registerApplicationInterface(DEFAULT_GATEWAY, application);
         client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/tmp", null, false, null, null, null));
         return host.getComputeResourceId() + "," + application.getApplicationInterfaceId();
     }
@@ -291,7 +292,7 @@ public class DocumentCreatorNew {
         client.addSCPDataMovementDetails(host.getComputeResourceId(), 1, scpDataMovement);
 
         ApplicationModule module1 = DocumentCreatorUtils.createApplicationModule("echo", "1.2", null);
-        module1.setAppModuleId(client.registerApplicationModule(module1));
+        module1.setAppModuleId(client.registerApplicationModule(DEFAULT_GATEWAY, module1));
 
         ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
 //    	application.setIsEmpty(false);
@@ -300,10 +301,10 @@ public class DocumentCreatorNew {
         application.addToApplicationInputs(DocumentCreatorUtils.createAppInput("echo_input", "echo_input", "echo_input", null, DataType.STRING));
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("echo_output", null, DataType.STRING));
 
-        application.setApplicationInterfaceId(client.registerApplicationInterface(application));
+        application.setApplicationInterfaceId(client.registerApplicationInterface(DEFAULT_GATEWAY, application));
 
         ApplicationDeploymentDescription deployment = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module1.getAppModuleId(), "/home/ogce/echo.sh", ApplicationParallelismType.SERIAL, "Echo application");
-        deployment.setAppDeploymentId(client.registerApplicationDeployment(deployment));
+        deployment.setAppDeploymentId(client.registerApplicationDeployment(DEFAULT_GATEWAY, deployment));
 
         client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/oasis/scratch/trestles/ogce/temp_project/", "sds128", false, null, null, null));
         return host.getComputeResourceId() + "," + application.getApplicationInterfaceId();
@@ -332,7 +333,7 @@ public class DocumentCreatorNew {
         client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/oasis/scratch/trestles/ogce/temp_project/", "sds128", false, null, null, null));
 
         ApplicationModule module2 = DocumentCreatorUtils.createApplicationModule("wrf", "1.0.0", null);
-        module2.setAppModuleId(client.registerApplicationModule(module2));
+        module2.setAppModuleId(client.registerApplicationModule(DEFAULT_GATEWAY, module2));
         ApplicationInterfaceDescription application2 = new ApplicationInterfaceDescription();
 //    	application2.setIsEmpty(false);
         application2.setApplicationName("WRF");
@@ -343,10 +344,10 @@ public class DocumentCreatorNew {
 
         application2.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("WRF_Output", null, DataType.URI));
         application2.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("WRF_Execution_Log", null, DataType.URI));
-        application2.setApplicationInterfaceId(client.registerApplicationInterface(application2));
+        application2.setApplicationInterfaceId(client.registerApplicationInterface(DEFAULT_GATEWAY, application2));
 
         ApplicationDeploymentDescription deployment2 = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module2.getAppModuleId(), "/home/ogce/production/app_wrappers/wrf_wrapper.sh", ApplicationParallelismType.MPI, "WRF");
-        deployment2.setAppDeploymentId(client.registerApplicationDeployment(deployment2));
+        deployment2.setAppDeploymentId(client.registerApplicationDeployment(DEFAULT_GATEWAY, deployment2));
         return host.getComputeResourceId() + "," + application2.getApplicationInterfaceId();
     }
 
@@ -372,7 +373,7 @@ public class DocumentCreatorNew {
         client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/home1/01437/ogce", "TG-STA110014S", false, null, null, null));
 
         ApplicationModule module2 = DocumentCreatorUtils.createApplicationModule("wrf", "1.0.0", null);
-        module2.setAppModuleId(client.registerApplicationModule(module2));
+        module2.setAppModuleId(client.registerApplicationModule(DEFAULT_GATEWAY, module2));
         ApplicationInterfaceDescription application2 = new ApplicationInterfaceDescription();
         //    	application2.setIsEmpty(false);
         application2.setApplicationName("WRF");
@@ -383,10 +384,10 @@ public class DocumentCreatorNew {
 
         application2.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("WRF_Output", null, DataType.URI));
         application2.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("WRF_Execution_Log", null, DataType.URI));
-        application2.setApplicationInterfaceId(client.registerApplicationInterface(application2));
+        application2.setApplicationInterfaceId(client.registerApplicationInterface(DEFAULT_GATEWAY, application2));
 
         ApplicationDeploymentDescription deployment2 = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module2.getAppModuleId(), "/home1/01437/ogce/production/app_wrappers/wrf_wrapper.sh", ApplicationParallelismType.MPI, "WRF");
-        deployment2.setAppDeploymentId(client.registerApplicationDeployment(deployment2));
+        deployment2.setAppDeploymentId(client.registerApplicationDeployment(DEFAULT_GATEWAY, deployment2));
         return host.getComputeResourceId() + "," + application2.getApplicationInterfaceId();
 
     }
@@ -410,7 +411,7 @@ public class DocumentCreatorNew {
         client.addSCPDataMovementDetails(host.getComputeResourceId(), 1, scpDataMovement);
 
         ApplicationModule module = DocumentCreatorUtils.createApplicationModule("echo", "1.3", null);
-        module.setAppModuleId(client.registerApplicationModule(module));
+        module.setAppModuleId(client.registerApplicationModule(DEFAULT_GATEWAY, module));
 
         ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
 //    	application.setIsEmpty(false);
@@ -418,10 +419,10 @@ public class DocumentCreatorNew {
         application.addToApplicationModules(module.getAppModuleId());
         application.addToApplicationInputs(DocumentCreatorUtils.createAppInput("echo_input", "echo_input", null, null, DataType.STRING));
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("echo_output", null, DataType.STRING));
-        application.setApplicationInterfaceId(client.registerApplicationInterface(application));
+        application.setApplicationInterfaceId(client.registerApplicationInterface(DEFAULT_GATEWAY, application));
 
         ApplicationDeploymentDescription deployment = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module.getAppModuleId(), "/bin/echo", ApplicationParallelismType.SERIAL, "EchoLocal");
-        deployment.setAppDeploymentId(client.registerApplicationDeployment(deployment));
+        deployment.setAppDeploymentId(client.registerApplicationDeployment(DEFAULT_GATEWAY, deployment));
 
         client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/home1/01437/ogce", "TG-STA110014S", false, null, null, null));
         return host.getComputeResourceId() + "," + application.getApplicationInterfaceId();
@@ -447,7 +448,7 @@ public class DocumentCreatorNew {
         client.addSCPDataMovementDetails(host.getComputeResourceId(), 1, scpDataMovement);
 
         ApplicationModule module = DocumentCreatorUtils.createApplicationModule("echo", "1.4", null);
-        module.setAppModuleId(client.registerApplicationModule(module));
+        module.setAppModuleId(client.registerApplicationModule(DEFAULT_GATEWAY, module));
 
         ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
 //    	application.setIsEmpty(false);
@@ -455,10 +456,10 @@ public class DocumentCreatorNew {
         application.addToApplicationModules(module.getAppModuleId());
         application.addToApplicationInputs(DocumentCreatorUtils.createAppInput("echo_input", "echo_input", null, null, DataType.STRING));
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("echo_output", null, DataType.STRING));
-        application.setApplicationInterfaceId(client.registerApplicationInterface(application));
+        application.setApplicationInterfaceId(client.registerApplicationInterface(DEFAULT_GATEWAY, application));
 
         ApplicationDeploymentDescription deployment = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module.getAppModuleId(), "/bin/echo", ApplicationParallelismType.SERIAL, "EchoLocal");
-        deployment.setAppDeploymentId(client.registerApplicationDeployment(deployment));
+        deployment.setAppDeploymentId(client.registerApplicationDeployment(DEFAULT_GATEWAY, deployment));
 
         client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/home1/01437/ogce", "TG-STA110014S", false, null, null, null));
         return host.getComputeResourceId() + "," + application.getApplicationInterfaceId();
@@ -655,17 +656,17 @@ public class DocumentCreatorNew {
         client.addSCPDataMovementDetails(host.getComputeResourceId(), 1, scpDataMovement);
 
         ApplicationModule module = DocumentCreatorUtils.createApplicationModule("echo", "1.5", null);
-        module.setAppModuleId(client.registerApplicationModule(module));
+        module.setAppModuleId(client.registerApplicationModule(DEFAULT_GATEWAY, module));
 
         ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
         application.setApplicationName("SimpleEchoBR");
         application.addToApplicationModules(module.getAppModuleId());
         application.addToApplicationInputs(DocumentCreatorUtils.createAppInput("echo_input", "echo_input", null, null, DataType.STRING));
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("echo_output", null, DataType.STRING));
-        application.setApplicationInterfaceId(client.registerApplicationInterface(application));
+        application.setApplicationInterfaceId(client.registerApplicationInterface(DEFAULT_GATEWAY, application));
 
         ApplicationDeploymentDescription deployment = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module.getAppModuleId(), "/N/u/lginnali/BigRed2/myjob/test.sh", ApplicationParallelismType.SERIAL, "EchoLocal");
-        deployment.setAppDeploymentId(client.registerApplicationDeployment(deployment));
+        deployment.setAppDeploymentId(client.registerApplicationDeployment(DEFAULT_GATEWAY, deployment));
 
         String date = (new Date()).toString();
         date = date.replaceAll(" ", "_");
@@ -703,7 +704,7 @@ public class DocumentCreatorNew {
 
 
         ApplicationModule amodule = DocumentCreatorUtils.createApplicationModule("Amber", "12.0", null);
-        amodule.setAppModuleId(client.registerApplicationModule(amodule));
+        amodule.setAppModuleId(client.registerApplicationModule(DEFAULT_GATEWAY, amodule));
 
 
         ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
@@ -716,10 +717,10 @@ public class DocumentCreatorNew {
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("AMBER_Prod.mdcrd", null, DataType.URI));
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("AMBER_Prod.out", null, DataType.URI));
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("AMBER_Prod.rst", null, DataType.URI));
-        application.setApplicationInterfaceId(client.registerApplicationInterface(application));
+        application.setApplicationInterfaceId(client.registerApplicationInterface(DEFAULT_GATEWAY, application));
 
         ApplicationDeploymentDescription deployment = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), amodule.getAppModuleId(), "/N/u/cgateway/BigRed2/sandbox/amber_wrapper.sh", ApplicationParallelismType.SERIAL, "AmberBR2");
-        deployment.setAppDeploymentId(client.registerApplicationDeployment(deployment));
+        deployment.setAppDeploymentId(client.registerApplicationDeployment(DEFAULT_GATEWAY, deployment));
 
 
         String date = (new Date()).toString();
@@ -753,7 +754,7 @@ public class DocumentCreatorNew {
         scpDataMovement.setSshPort(22);
         client.addSCPDataMovementDetails(host.getComputeResourceId(), 1, scpDataMovement);
         ApplicationModule amodule = DocumentCreatorUtils.createApplicationModule("Amber", "12.0", null);
-        amodule.setAppModuleId(client.registerApplicationModule(amodule));
+        amodule.setAppModuleId(client.registerApplicationModule(DEFAULT_GATEWAY, amodule));
 
 
         ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
@@ -766,10 +767,10 @@ public class DocumentCreatorNew {
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("AMBER_Prod.mdcrd", null, DataType.URI));
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("AMBER_Prod.out", null, DataType.URI));
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("AMBER_Prod.rst", null, DataType.URI));
-        application.setApplicationInterfaceId(client.registerApplicationInterface(application));
+        application.setApplicationInterfaceId(client.registerApplicationInterface(DEFAULT_GATEWAY, application));
 
         ApplicationDeploymentDescription deployment = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), amodule.getAppModuleId(), "/home1/01437/ogce/production/app_wrappers/amber_wrapper.sh", ApplicationParallelismType.SERIAL, "AmberStampede");
-        deployment.setAppDeploymentId(client.registerApplicationDeployment(deployment));
+        deployment.setAppDeploymentId(client.registerApplicationDeployment(DEFAULT_GATEWAY, deployment));
 
         client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/home1/01437/ogce", "TG-STA110014S", false, null, null, null));
 
@@ -797,7 +798,7 @@ public class DocumentCreatorNew {
         client.addSCPDataMovementDetails(host.getComputeResourceId(), 1, scpDataMovement);
 
         ApplicationModule amodule = DocumentCreatorUtils.createApplicationModule("Amber", "12.0", null);
-        amodule.setAppModuleId(client.registerApplicationModule(amodule));
+        amodule.setAppModuleId(client.registerApplicationModule(DEFAULT_GATEWAY, amodule));
 
 
         ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
@@ -810,10 +811,10 @@ public class DocumentCreatorNew {
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("AMBER_Prod.mdcrd", null, DataType.URI));
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("AMBER_Prod.out", null, DataType.URI));
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("AMBER_Prod.rst", null, DataType.URI));
-        application.setApplicationInterfaceId(client.registerApplicationInterface(application));
+        application.setApplicationInterfaceId(client.registerApplicationInterface(DEFAULT_GATEWAY, application));
 
         ApplicationDeploymentDescription deployment = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), amodule.getAppModuleId(), "/home/ogce/production/app_wrappers/amber_wrapper.sh", ApplicationParallelismType.SERIAL, "AmberStampede");
-        deployment.setAppDeploymentId(client.registerApplicationDeployment(deployment));
+        deployment.setAppDeploymentId(client.registerApplicationDeployment(DEFAULT_GATEWAY, deployment));
 
         client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/oasis/scratch/trestles/ogce/temp_project/", "sds128", false, null, null, null));
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java b/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java
index c1d3c65..ccaae5e 100644
--- a/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java
+++ b/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java
@@ -48,7 +48,8 @@ public class JCRComponentRegistry extends ComponentRegistry {
     public List<ComponentReference> getComponentReferenceList() {
         List<ComponentReference> tree = new ArrayList<ComponentReference>();
         try {
-        	List<ApplicationInterfaceDescription> allApplicationInterfaces = client.getAllApplicationInterfaces();
+        	//FIXME: Pass Gateway ID to the UI and use it to fetch the applications
+            List<ApplicationInterfaceDescription> allApplicationInterfaces = client.getAllApplicationInterfaces("default");
         	for (ApplicationInterfaceDescription interfaceDescription : allApplicationInterfaces) {
         		JCRComponentReference jcr = new JCRComponentReference(interfaceDescription.getApplicationName(),interfaceDescription);
                 tree.add(jcr);

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/WorkflowImportWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/WorkflowImportWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/WorkflowImportWindow.java
index a5f366f..0931ebc 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/WorkflowImportWindow.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/WorkflowImportWindow.java
@@ -110,7 +110,8 @@ public class WorkflowImportWindow {
                     SwingUtilities.invokeLater(new Runnable() {
                         public void run() {
                             try {
-								List<String> resultList = getClient().getAllWorkflows();
+								//FIXME: Update the gateway id fetched from UI
+                                List<String> resultList = getClient().getAllWorkflows("default");
 								if (resultList == null || resultList.size() == 0) {
 								    /*
 								     * OGCEXRegistryLoaderWindow.this.list.getList(). setListData( new

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/LaunchApplicationWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/LaunchApplicationWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/LaunchApplicationWindow.java
index 26d2c6f..adfa726 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/LaunchApplicationWindow.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/LaunchApplicationWindow.java
@@ -298,7 +298,8 @@ public class LaunchApplicationWindow {
         String owner = this.thriftClientData.getUsername();        
         if(owner.equals(""))owner="NotKnown";              
         project.setOwner(owner);
-        project.setProjectID(airavataClient.createProject(project));
+        //FIXME:: use gatewayId from UI
+        project.setProjectID(airavataClient.createProject("default", project));
 //        final List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
         final List<DataPort> inputPorts = node.getInputPorts();
         final Experiment experiment = new Experiment();
@@ -366,8 +367,9 @@ public class LaunchApplicationWindow {
             elem.setValue("");
 			experiment.addToExperimentOutputs(elem );
         }
-  
-        experiment.setExperimentID(airavataClient.createExperiment(experiment));
+
+        //FIXME:: use gatewayId from UI
+        experiment.setExperimentID(airavataClient.createExperiment("default", experiment));
         airavataClient.launchExperiment(experiment.getExperimentID(), "testToken");
         hide();
         JOptionPane.showMessageDialog(null, "Experiment Launched. You will be alerted on completion.");

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryWorkflowPublisherWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryWorkflowPublisherWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryWorkflowPublisherWindow.java
index c2eef03..e8ea5d8 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryWorkflowPublisherWindow.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryWorkflowPublisherWindow.java
@@ -102,7 +102,8 @@ public class RegistryWorkflowPublisherWindow {
     			org.apache.airavata.model.Workflow workflowData = new org.apache.airavata.model.Workflow();
     			workflowData.setName(workflowTemplateName);
     			workflowData.setGraph(workflowAsString);
-    			client.registerWorkflow(workflowData);
+                //FIXME: Use the gatewayId from the UI
+    			client.registerWorkflow("default", workflowData);
     			hide();
         	}
 		} catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
index c542aa7..7e7a8ba 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
@@ -270,7 +270,8 @@ public class WorkflowInterpreterLaunchWindow {
 		org.apache.airavata.model.Workflow w = new org.apache.airavata.model.Workflow();
 		w.setName(workflowClone.getName());
         w.setGraph(JSONUtil.jsonElementToString(workflowClone.toJSON()));
-		w.setTemplateId(airavataClient.registerWorkflow(w));
+		//FIXME:: use gatewayId from UI
+        w.setTemplateId(airavataClient.registerWorkflow("default", w));
         String instanceName = this.instanceNameTextField.getText();
         if (instanceName.trim().equals("")){
         	JOptionPane.showMessageDialog(engine.getGUI().getFrame(),
@@ -291,7 +292,8 @@ public class WorkflowInterpreterLaunchWindow {
         Project project = new Project();
         project.setName("project1");
         project.setOwner(thriftClientData.getUsername());
-        project.setProjectID(airavataClient.createProject(project));
+        //FIXME:: use gatewayId from UI
+        project.setProjectID(airavataClient.createProject("default", project));
         final List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
         final Experiment experiment = new Experiment();
         experiment.setApplicationId(w.getTemplateId());
@@ -354,7 +356,8 @@ public class WorkflowInterpreterLaunchWindow {
             throw new RuntimeException("Resource scheduling failed, target computer resource host name is not defined");
         }
 
-        experiment.setExperimentID(airavataClient.createExperiment(experiment));
+        //FIXME:: use gatewayId from UI
+        experiment.setExperimentID(airavataClient.createExperiment("default", experiment));
 
         try {
             this.engine.getMonitor().subscribe(experiment.getExperimentID());


[2/2] airavata git commit: Updating API calls to use gatewayId - AIRAVATA-1607

Posted by sm...@apache.org.
Updating API calls to use gatewayId - AIRAVATA-1607


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

Branch: refs/heads/master
Commit: b1f0b00d3340bc935f025817a13a786798c3a94e
Parents: 8be5988
Author: Suresh Marru <sm...@apache.org>
Authored: Tue Mar 3 17:36:21 2015 -0500
Committer: Suresh Marru <sm...@apache.org>
Committed: Tue Mar 3 17:36:21 2015 -0500

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   |  42 ++++----
 .../client/samples/CreateLaunchExperiment.java  |  62 ++++++------
 .../samples/CreateLaunchExperimentUS3.java      |  20 ++--
 .../client/samples/RegisterSampleData.java      |  36 +++----
 .../samples/TestCreateLaunchExperiment.java     |  10 +-
 .../tools/RegisterOGCEUS3Application.java       |   8 +-
 .../tools/RegisterSampleApplications.java       | 100 +++++++++----------
 .../client/tools/RegisterUS3Application.java    |  12 +--
 .../apache/airavata/integration/BaseCaseIT.java |   4 +-
 .../airavata/integration/DataRetrievalIT.java   |   8 +-
 .../airavata/integration/SimpleEchoIT.java      |   2 +-
 .../SingleAppIntegrationTestBase.java           |   2 +-
 .../WorkflowIntegrationTestBase.java            |   2 +-
 .../integration/tools/DocumentCreatorNew.java   |  67 +++++++------
 .../registry/JCRComponentRegistry.java          |   3 +-
 .../dialogs/workflow/WorkflowImportWindow.java  |   3 +-
 .../ui/experiment/LaunchApplicationWindow.java  |   8 +-
 .../RegistryWorkflowPublisherWindow.java        |   3 +-
 .../WorkflowInterpreterLaunchWindow.java        |   9 +-
 19 files changed, 205 insertions(+), 196 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/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 c449119..ff90bb2 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
@@ -251,7 +251,7 @@ public class AiravataServerHandler implements Airavata.Iface {
      * @param project
      */
     @Override
-    public String createProject(Project project) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public String createProject(String gatewayId, Project project) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         try {
             registry = RegistryFactory.getDefaultRegistry();
             if (!validateString(project.getName()) || !validateString(project.getOwner())){
@@ -341,7 +341,7 @@ public class AiravataServerHandler implements Airavata.Iface {
      * @param userName
      */
     @Override
-    public List<Project> getAllUserProjects(String userName) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public List<Project> getAllUserProjects(String gatewayId, String userName) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         if (!validateString(userName)){
             logger.error("Username cannot be empty. Please provide a valid user..");
             AiravataSystemException exception = new AiravataSystemException();
@@ -375,7 +375,7 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
     }
 
-    public List<Project> searchProjectsByProjectName(String userName, String projectName) throws InvalidRequestException,
+    public List<Project> searchProjectsByProjectName(String gatewayId, String userName, String projectName) throws InvalidRequestException,
                                                                                                  AiravataClientException,
                                                                                                  AiravataSystemException,
                                                                                                  TException {
@@ -413,7 +413,7 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
     }
 
-    public List<Project> searchProjectsByProjectDesc(String userName, String description) throws InvalidRequestException,
+    public List<Project> searchProjectsByProjectDesc(String gatewayId, String userName, String description) throws InvalidRequestException,
                                                                                                  AiravataClientException,
                                                                                                  AiravataSystemException,
                                                                                                  TException {
@@ -451,7 +451,7 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
     }
 
-    public List<ExperimentSummary> searchExperimentsByName(String userName, String expName) throws InvalidRequestException,
+    public List<ExperimentSummary> searchExperimentsByName(String gatewayId, String userName, String expName) throws InvalidRequestException,
                                                                                                    AiravataClientException,
                                                                                                    AiravataSystemException,
                                                                                                    TException {
@@ -489,7 +489,7 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
     }
 
-    public List<ExperimentSummary> searchExperimentsByDesc(String userName, String description) throws InvalidRequestException,
+    public List<ExperimentSummary> searchExperimentsByDesc(String gatewayId, String userName, String description) throws InvalidRequestException,
                                                                                                        AiravataClientException,
                                                                                                        AiravataSystemException,
                                                                                                        TException {
@@ -527,7 +527,7 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
     }
 
-    public List<ExperimentSummary> searchExperimentsByApplication(String userName, String applicationId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public List<ExperimentSummary> searchExperimentsByApplication(String gatewayId, String userName, String applicationId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         if (!validateString(userName)){
             logger.error("Username cannot be empty. Please provide a valid user..");
             AiravataSystemException exception = new AiravataSystemException();
@@ -563,7 +563,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     }
 
     @Override
-    public List<ExperimentSummary> searchExperimentsByStatus(String userName, ExperimentState experimentState) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public List<ExperimentSummary> searchExperimentsByStatus(String gatewayId, String userName, ExperimentState experimentState) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         if (!validateString(userName)){
             logger.error("Username cannot be empty. Please provide a valid user..");
             AiravataSystemException exception = new AiravataSystemException();
@@ -599,7 +599,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     }
 
     @Override
-    public List<ExperimentSummary> searchExperimentsByCreationTime(String userName, long fromTime, long toTime) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public List<ExperimentSummary> searchExperimentsByCreationTime(String gatewayId, String userName, long fromTime, long toTime) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         if (!validateString(userName)){
             logger.error("Username cannot be empty. Please provide a valid user..");
             AiravataSystemException exception = new AiravataSystemException();
@@ -684,7 +684,7 @@ public class AiravataServerHandler implements Airavata.Iface {
      * @param userName
      */
     @Override
-    public List<Experiment> getAllUserExperiments(String userName) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public List<Experiment> getAllUserExperiments(String gatewayId, String userName) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         if (!validateString(userName)){
             logger.error("Username cannot be empty. Please provide a valid user..");
             AiravataSystemException exception = new AiravataSystemException();
@@ -741,7 +741,7 @@ public class AiravataServerHandler implements Airavata.Iface {
      *                                                               rather an Airavata Administrator will be notified to take corrective action.
      */
     @Override
-    public String createExperiment(Experiment experiment) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public String createExperiment(String gatewayId, Experiment experiment) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         try {
             registry = RegistryFactory.getDefaultRegistry();
             if (!validateString(experiment.getName())){
@@ -753,7 +753,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             }
             String experimentId = (String)registry.add(ParentDataType.EXPERIMENT, experiment);
             if (ServerSettings.isRabbitMqPublishEnabled()){
-                String gatewayId = ServerSettings.getDefaultUserGateway();
+                gatewayId = ServerSettings.getDefaultUserGateway();
                 ExperimentStatusChangeEvent event = new ExperimentStatusChangeEvent(ExperimentState.CREATED,
                         experimentId,
                         gatewayId);
@@ -1354,7 +1354,7 @@ public class AiravataServerHandler implements Airavata.Iface {
      * Returns a server-side generated airavata appModule globally unique identifier.
      */
     @Override
-    public String registerApplicationModule(ApplicationModule applicationModule) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public String registerApplicationModule(String gatewayId, ApplicationModule applicationModule) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         try {
             appCatalog = AppCatalogFactory.getAppCatalog();
             return appCatalog.getApplicationInterface().addApplicationModule(applicationModule);
@@ -1412,7 +1412,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     }
 
     @Override
-    public List<ApplicationModule> getAllAppModules() throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public List<ApplicationModule> getAllAppModules(String gatewayId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         try {
             appCatalog = AppCatalogFactory.getAppCatalog();
             return appCatalog.getApplicationInterface().getAllApplicationModules();
@@ -1453,7 +1453,7 @@ public class AiravataServerHandler implements Airavata.Iface {
      *                                     Returns a server-side generated airavata appModule globally unique identifier.
      */
     @Override
-    public String registerApplicationDeployment(ApplicationDeploymentDescription applicationDeployment) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public String registerApplicationDeployment(String gatewayId, ApplicationDeploymentDescription applicationDeployment) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         try {
             appCatalog = AppCatalogFactory.getAppCatalog();
             return appCatalog.getApplicationDeployment().addApplicationDeployment(applicationDeployment);
@@ -1539,7 +1539,7 @@ public class AiravataServerHandler implements Airavata.Iface {
      * Returns the list of all application Deployment Objects.
      */
     @Override
-    public List<ApplicationDeploymentDescription> getAllApplicationDeployments() throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public List<ApplicationDeploymentDescription> getAllApplicationDeployments(String gatewayId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         try {
             appCatalog = AppCatalogFactory.getAppCatalog();
             return appCatalog.getApplicationDeployment().getAllApplicationDeployements();
@@ -1587,7 +1587,7 @@ public class AiravataServerHandler implements Airavata.Iface {
      *                                    Returns a server-side generated airavata application interface globally unique identifier.
      */
     @Override
-    public String registerApplicationInterface(ApplicationInterfaceDescription applicationInterface) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public String registerApplicationInterface(String gatewayId, ApplicationInterfaceDescription applicationInterface) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         try {
             appCatalog = AppCatalogFactory.getAppCatalog();
             return appCatalog.getApplicationInterface().addApplicationInterface(applicationInterface);
@@ -1672,7 +1672,7 @@ public class AiravataServerHandler implements Airavata.Iface {
      * Returns a list of application interfaces with corresponsing id's
      */
     @Override
-    public Map<String, String> getAllApplicationInterfaceNames() throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public Map<String, String> getAllApplicationInterfaceNames(String gatewayId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         try {
             appCatalog = AppCatalogFactory.getAppCatalog();
             List<ApplicationInterfaceDescription> allApplicationInterfaces = appCatalog.getApplicationInterface().getAllApplicationInterfaces();
@@ -1699,7 +1699,7 @@ public class AiravataServerHandler implements Airavata.Iface {
      * Returns a list of application interfaces documents
      */
     @Override
-    public List<ApplicationInterfaceDescription> getAllApplicationInterfaces() throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+    public List<ApplicationInterfaceDescription> getAllApplicationInterfaces(String gatewayId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         try {
             appCatalog = AppCatalogFactory.getAppCatalog();
             return appCatalog.getApplicationInterface().getAllApplicationInterfaces();
@@ -2841,7 +2841,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     }
 
     @Override
-	public List<String> getAllWorkflows() throws InvalidRequestException,
+	public List<String> getAllWorkflows(String gatewayId) throws InvalidRequestException,
 			AiravataClientException, AiravataSystemException, TException {
 		try {
 			return getWorkflowCatalog().getAllWorkflows();
@@ -2885,7 +2885,7 @@ public class AiravataServerHandler implements Airavata.Iface {
 	}
 
 	@Override
-	public String registerWorkflow(Workflow workflow)
+	public String registerWorkflow(String gatewayId, Workflow workflow)
 			throws InvalidRequestException, AiravataClientException,
 			AiravataSystemException, TException {
 		try {

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 9d07028..01f017a 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -179,7 +179,7 @@ public class CreateLaunchExperiment {
             List<OutputDataObjectType> exOut = client.getApplicationOutputs(echoAppId);
 
             Project project = ProjectModelUtil.createProject("default", "admin", "test project");
-            String projectId = client.createProject(project);
+            String projectId = client.createProject(DEFAULT_GATEWAY, project);
 
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment", "SimpleEcho3", echoAppId, exInputs);
@@ -196,7 +196,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -272,7 +272,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setAdvanceOutputDataHandling(dataHandling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
                         
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -333,7 +333,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setAdvanceOutputDataHandling(dataHandling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
                         
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -410,7 +410,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -497,7 +497,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -595,7 +595,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -668,7 +668,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -727,7 +727,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -780,7 +780,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -905,7 +905,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -979,7 +979,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -1038,7 +1038,7 @@ public class CreateLaunchExperiment {
             exOut.add(output);
 
             Project project = ProjectModelUtil.createProject("project1", "admin", "test project");
-            String projectId = client.createProject(project);
+            String projectId = client.createProject(DEFAULT_GATEWAY, project);
 
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment", "Echo Test", echoAppId, exInputs);
@@ -1055,7 +1055,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -1132,7 +1132,7 @@ public class CreateLaunchExperiment {
 			List<OutputDataObjectType> exOut = client.getApplicationOutputs(echoAppId);
 
             Project project = ProjectModelUtil.createProject("default", "admin", "test project");
-            String projectId = client.createProject(project);
+            String projectId = client.createProject(DEFAULT_GATEWAY, project);
 
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment", "SimpleEcho3", echoAppId, exInputs);
@@ -1149,7 +1149,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -1256,7 +1256,7 @@ public class CreateLaunchExperiment {
             exOut.add(output);
 
             Project project = ProjectModelUtil.createProject("default", "lahiru", "test project");
-            String projectId = client.createProject(project);
+            String projectId = client.createProject(DEFAULT_GATEWAY, project);
 
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment(projectId, "lahiru", "sshEchoExperiment", "SimpleEchoBR", echoAppId, exInputs);
@@ -1273,7 +1273,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -1319,7 +1319,7 @@ public class CreateLaunchExperiment {
 			List<OutputDataObjectType> exOut = client.getApplicationOutputs(amberAppId);
 
             Project project = ProjectModelUtil.createProject("default", "admin", "test project");
-            String projectId = client.createProject(project);
+            String projectId = client.createProject(DEFAULT_GATEWAY, project);
 
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "sshEchoExperiment", "SimpleEchoBR", amberAppId, exInputs);
@@ -1337,7 +1337,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -1384,7 +1384,7 @@ public class CreateLaunchExperiment {
 
 
             Project project = ProjectModelUtil.createProject("default", "admin", "test project");
-            String projectId = client.createProject(project);
+            String projectId = client.createProject(DEFAULT_GATEWAY, project);
 
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "sshEchoExperiment", "SimpleEchoBR", amberAppId, exInputs);
@@ -1401,7 +1401,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -1447,7 +1447,7 @@ public class CreateLaunchExperiment {
 			List<OutputDataObjectType> exOut = client.getApplicationOutputs(amberAppId);
 
             Project project = ProjectModelUtil.createProject("default", "admin", "test project");
-            String projectId = client.createProject(project);
+            String projectId = client.createProject(DEFAULT_GATEWAY, project);
 
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "sshEchoExperiment", "SimpleEchoBR", amberAppId, exInputs);
@@ -1465,7 +1465,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
-                        return client.createExperiment(simpleExperiment);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
                     }
                 }
             }
@@ -1511,7 +1511,7 @@ public class CreateLaunchExperiment {
 
     public static List<Experiment> getExperimentsForUser(Airavata.Client client, String user) {
         try {
-            return client.getAllUserExperiments(user);
+            return client.getAllUserExperiments(DEFAULT_GATEWAY, user);
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
@@ -1526,7 +1526,7 @@ public class CreateLaunchExperiment {
 
     public static List<Project> getAllUserProject(Airavata.Client client, String user) {
         try {
-            return client.getAllUserProjects(user);
+            return client.getAllUserProjects(DEFAULT_GATEWAY, user);
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
@@ -1541,7 +1541,7 @@ public class CreateLaunchExperiment {
 
     public static List<Project> searchProjectsByProjectName(Airavata.Client client, String user, String projectName) {
         try {
-            return client.searchProjectsByProjectName(user, projectName);
+            return client.searchProjectsByProjectName(DEFAULT_GATEWAY, user, projectName);
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
@@ -1556,7 +1556,7 @@ public class CreateLaunchExperiment {
 
     public static List<Project> searchProjectsByProjectDesc(Airavata.Client client, String user, String desc) {
         try {
-            return client.searchProjectsByProjectDesc(user, desc);
+            return client.searchProjectsByProjectDesc(DEFAULT_GATEWAY, user, desc);
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
@@ -1572,7 +1572,7 @@ public class CreateLaunchExperiment {
 
     public static List<ExperimentSummary> searchExperimentsByName(Airavata.Client client, String user, String expName) {
         try {
-            return client.searchExperimentsByName(user, expName);
+            return client.searchExperimentsByName(DEFAULT_GATEWAY, user, expName);
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
@@ -1587,7 +1587,7 @@ public class CreateLaunchExperiment {
 
     public static List<ExperimentSummary> searchExperimentsByDesc(Airavata.Client client, String user, String desc) {
         try {
-            return client.searchExperimentsByDesc(user, desc);
+            return client.searchExperimentsByDesc(DEFAULT_GATEWAY, user, desc);
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
@@ -1602,7 +1602,7 @@ public class CreateLaunchExperiment {
 
     public static List<ExperimentSummary> searchExperimentsByApplication(Airavata.Client client, String user, String app) {
         try {
-            return client.searchExperimentsByApplication(user, app);
+            return client.searchExperimentsByApplication(DEFAULT_GATEWAY, user, app);
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperimentUS3.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperimentUS3.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperimentUS3.java
index 3849d82..bf82ed3 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperimentUS3.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperimentUS3.java
@@ -158,7 +158,7 @@ public class CreateLaunchExperimentUS3 {
             exOut.add(output);
 
             Project project = ProjectModelUtil.createProject("project1", "admin", "test project");
-            String projectId = client.createProject(project);
+            String projectId = client.createProject(DEFAULT_GATEWAY, project);
 
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "US3EchoExperimentTrestles", "US3EchoTrestles", "US3EchoTrestles", exInputs);
@@ -171,7 +171,7 @@ public class CreateLaunchExperimentUS3 {
             userConfigurationData.setOverrideManualScheduledParams(false);
             userConfigurationData.setComputationalResourceScheduling(scheduling);
             simpleExperiment.setUserConfigurationData(userConfigurationData);
-            return client.createExperiment(simpleExperiment);
+            return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
         } catch (AiravataSystemException e) {
             logger.error("Error occured while creating the experiment...", e.getMessage());
             throw new AiravataSystemException(e);
@@ -225,7 +225,7 @@ public class CreateLaunchExperimentUS3 {
 //            exOut.add(output2);
 
             Project project = ProjectModelUtil.createProject("ultrascan", "ultrascan", "test project");
-            String projectId = client.createProject(project);
+            String projectId = client.createProject(DEFAULT_GATEWAY, project);
 
             Experiment simpleExperiment = ExperimentModelUtil.createSimpleExperiment(projectId, "ultrascan", "US3ExperimentTrestles", "US3AppTrestles", "ultrascan_7ce6cd43-622c-44e0-87c5-fb7a6528c799", exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
@@ -243,7 +243,7 @@ public class CreateLaunchExperimentUS3 {
         
             userConfigurationData.setComputationalResourceScheduling(scheduling);
             simpleExperiment.setUserConfigurationData(userConfigurationData);
-            return client.createExperiment(simpleExperiment);
+            return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
         } catch (AiravataSystemException e) {
             logger.error("Error occured while creating the experiment...", e.getMessage());
             throw new AiravataSystemException(e);
@@ -297,7 +297,7 @@ public class CreateLaunchExperimentUS3 {
 //            exOut.add(output2);
 
             Project project = ProjectModelUtil.createProject("project1", "admin", "test project");
-            String projectId = client.createProject(project);
+            String projectId = client.createProject(DEFAULT_GATEWAY, project);
 
             Experiment simpleExperiment = ExperimentModelUtil.createSimpleExperiment(projectId, "ultrascan", "US3ExperimentStampede", "US3AppStampede", "ultrascan_7ce6cd43-622c-44e0-87c5-fb7a6528c799", exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
@@ -316,7 +316,7 @@ public class CreateLaunchExperimentUS3 {
             userConfigurationData.setAdvanceOutputDataHandling(dataHandling);
         
             simpleExperiment.setUserConfigurationData(userConfigurationData);
-            return client.createExperiment(simpleExperiment);
+            return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
         } catch (AiravataSystemException e) {
             logger.error("Error occured while creating the experiment...", e.getMessage());
             throw new AiravataSystemException(e);
@@ -388,7 +388,7 @@ public class CreateLaunchExperimentUS3 {
             userConfigurationData.setAdvanceOutputDataHandling(dataHandling);
         
             simpleExperiment.setUserConfigurationData(userConfigurationData);
-            return client.createExperiment(simpleExperiment);
+            return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
         } catch (AiravataSystemException e) {
             logger.error("Error occured while creating the experiment...", e.getMessage());
             throw new AiravataSystemException(e);
@@ -461,7 +461,7 @@ public class CreateLaunchExperimentUS3 {
             userConfigurationData.setAdvanceOutputDataHandling(dataHandling);
         
             simpleExperiment.setUserConfigurationData(userConfigurationData);
-            return client.createExperiment(simpleExperiment);
+            return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
         } catch (AiravataSystemException e) {
             logger.error("Error occured while creating the experiment...", e.getMessage());
             throw new AiravataSystemException(e);
@@ -493,7 +493,7 @@ public class CreateLaunchExperimentUS3 {
             exOut.add(output);
 
             Project project = ProjectModelUtil.createProject("project1", "admin", "test project");
-            String projectId = client.createProject(project);
+            String projectId = client.createProject(DEFAULT_GATEWAY, project);
 
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "US3EchoExperimentStatus", "US3EchoStampede", "US3EchoStampede", exInputs);
@@ -507,7 +507,7 @@ public class CreateLaunchExperimentUS3 {
             userConfigurationData.setOverrideManualScheduledParams(false);
             userConfigurationData.setComputationalResourceScheduling(scheduling);
             simpleExperiment.setUserConfigurationData(userConfigurationData);
-            return client.createExperiment(simpleExperiment);
+            return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
         } catch (AiravataSystemException e) {
             logger.error("Error occured while creating the experiment...", e.getMessage());
             throw new AiravataSystemException(e);

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/RegisterSampleData.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/RegisterSampleData.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/RegisterSampleData.java
index f5a79de..8b23643 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/RegisterSampleData.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/RegisterSampleData.java
@@ -142,7 +142,7 @@ public class RegisterSampleData {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
 
-            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(
+            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Gaussian", "Gaussian application",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Gaussian Application Interface Id " + addApplicationInterfaceId);
@@ -190,7 +190,7 @@ public class RegisterSampleData {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
 
-            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(
+            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Tinker_Monte", "Monte application",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Monte Application Interface Id " + addApplicationInterfaceId);
@@ -203,42 +203,42 @@ public class RegisterSampleData {
     private void registerApplicationDeployments() throws TException {
         System.out.println("#### Registering Application Deployments on Localhost ####");
         //Register Echo
-        String echoAppDeployId = airavataClient.registerApplicationDeployment(
+        String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                 RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, localhostId,
                         sampleScriptDir + "/echo.sh", ApplicationParallelismType.SERIAL, "Echo application description",
                         null, null, null));
         System.out.println("Successfully registered Echo application on localhost, application Id = " + echoAppDeployId);
 
         //Register Add application
-        String addAppDeployId = airavataClient.registerApplicationDeployment(
+        String addAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                 RegisterSampleApplicationsUtils.createApplicationDeployment(addModuleId, localhostId,
                         sampleScriptDir + "/add.sh", ApplicationParallelismType.SERIAL, "Add application description",
                         null, null, null));
         System.out.println("Successfully registered Add application on localhost, application Id = " + addAppDeployId);
 
         //Register Multiply application
-        String multiplyAppDeployId = airavataClient.registerApplicationDeployment(
+        String multiplyAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                 RegisterSampleApplicationsUtils.createApplicationDeployment(multiplyModuleId, localhostId,
                         sampleScriptDir + "/multiply.sh", ApplicationParallelismType.SERIAL, "Multiply application description",
                         null, null, null));
         System.out.println("Successfully registered Multiply application on localhost, application Id = " + multiplyAppDeployId);
 
         //Register Subtract application
-        String subtractAppDeployId = airavataClient.registerApplicationDeployment(
+        String subtractAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                 RegisterSampleApplicationsUtils.createApplicationDeployment(subtractModuleId, localhostId,
                         sampleScriptDir + "/subtract.sh", ApplicationParallelismType.SERIAL, "Subtract application description ",
                         null, null, null));
         System.out.println("Successfully registered Subtract application on localhost, application Id = " + subtractAppDeployId);
 
         //Register Tinker monte application
-        String tinkerMonteAppDeployId = airavataClient.registerApplicationDeployment(
+        String tinkerMonteAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                 RegisterSampleApplicationsUtils.createApplicationDeployment(monteXModuleId, localhostId,
                         sampleScriptDir + "/monte.x", ApplicationParallelismType.SERIAL, "Grid chem tinker monte application description ",
                         null, null, null));
         System.out.println("Successfully registered tinker monte application on localhost, application Id = " + tinkerMonteAppDeployId);
 
         //Register Tinker monte application
-        String gaussianAppDeployId = airavataClient.registerApplicationDeployment(
+        String gaussianAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                 RegisterSampleApplicationsUtils.createApplicationDeployment(gaussianModuleId, localhostId,
                         sampleScriptDir + "/gaussian.sh", ApplicationParallelismType.SERIAL, "Grid chem Gaussian application description ",
                         null, null, null));
@@ -247,28 +247,28 @@ public class RegisterSampleData {
 
     private void registerApplicationModules() throws TException {
         //Register Echo
-        echoModuleId = airavataClient.registerApplicationModule(
+        echoModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                 RegisterSampleApplicationsUtils.createApplicationModule(
                         "Echo", "1.0", "Echo application description"));
         //Register Echo
-        addModuleId = airavataClient.registerApplicationModule(
+        addModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                 RegisterSampleApplicationsUtils.createApplicationModule(
                         "Add", "1.0", "Add application description"));
         //Register Echo
-        multiplyModuleId = airavataClient.registerApplicationModule(
+        multiplyModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                 RegisterSampleApplicationsUtils.createApplicationModule(
                         "Multiply", "1.0", "Multiply application description"));
         //Register Echo
-        subtractModuleId = airavataClient.registerApplicationModule(
+        subtractModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                 RegisterSampleApplicationsUtils.createApplicationModule(
                         "Subtract", "1.0", "Subtract application description"));
         //Register Monte
-        monteXModuleId = airavataClient.registerApplicationModule(
+        monteXModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                 RegisterSampleApplicationsUtils.createApplicationModule(
                         "Tinker Monte", "1.0", "Grid chem tinker monte application description"));
 
         // Register gaussian application
-        gaussianModuleId = airavataClient.registerApplicationModule(
+        gaussianModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                 RegisterSampleApplicationsUtils.createApplicationModule(
                         "Gaussian", "1.0", "Grid Chem Gaussian application description"));
 
@@ -294,7 +294,7 @@ public class RegisterSampleData {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
 
-            String echoInterfaceId = airavataClient.registerApplicationInterface(
+            String echoInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Echo", "Echo application description",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Echo Application Interface Id " + echoInterfaceId);
@@ -326,7 +326,7 @@ public class RegisterSampleData {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
 
-            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(
+            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Add", "Add two numbers",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Add Application Interface Id " + addApplicationInterfaceId);
@@ -358,7 +358,7 @@ public class RegisterSampleData {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
 
-            String multiplyApplicationInterfaceId = airavataClient.registerApplicationInterface(
+            String multiplyApplicationInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Multiply", "Multiply two numbers",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Multiply Application Interface Id " + multiplyApplicationInterfaceId);
@@ -390,7 +390,7 @@ public class RegisterSampleData {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
 
-            String subtractApplicationInterfaceId = airavataClient.registerApplicationInterface(
+            String subtractApplicationInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Subtract", "Subtract two numbers",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Subtract Application Interface Id " + subtractApplicationInterfaceId);

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/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 84c053d..8cfbd65 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
@@ -109,7 +109,7 @@ public class TestCreateLaunchExperiment {
 
     public static List<Experiment> getExperimentsForUser (Airavata.Client client, String user){
         try {
-            return client.getAllUserExperiments(user);
+            return client.getAllUserExperiments(DEFAULT_GATEWAY, user);
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
@@ -154,7 +154,7 @@ public class TestCreateLaunchExperiment {
 
     public static List<ExperimentSummary> getExperimentsForApplication (Airavata.Client client, String user, String application){
         try {
-            return client.searchExperimentsByApplication(user, application);
+            return client.searchExperimentsByApplication(DEFAULT_GATEWAY, user, application);
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
@@ -169,7 +169,7 @@ public class TestCreateLaunchExperiment {
 
     public static List<ExperimentSummary> searchExperimentsByStatus (Airavata.Client client, String user, ExperimentState experimentState){
         try {
-            return client.searchExperimentsByStatus(user, experimentState);
+            return client.searchExperimentsByStatus(DEFAULT_GATEWAY, user, experimentState);
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
@@ -184,7 +184,7 @@ public class TestCreateLaunchExperiment {
 
     public static List<ExperimentSummary> searchExperimentsByDate (Airavata.Client client, String user, Long from, Long to){
         try {
-            return client.searchExperimentsByCreationTime(user, from, to);
+            return client.searchExperimentsByCreationTime(DEFAULT_GATEWAY, user, from, to);
         } catch (AiravataSystemException e) {
             e.printStackTrace();
         } catch (InvalidRequestException e) {
@@ -218,7 +218,7 @@ public class TestCreateLaunchExperiment {
 
     public static void getAllAppInterfaces (Airavata.Client client){
         try {
-            Map<String, String> allApps = client.getAllApplicationInterfaceNames();
+            Map<String, String> allApps = client.getAllApplicationInterfaceNames(DEFAULT_GATEWAY);
             for (String id : allApps.keySet()){
                 System.out.println("app id : " + id);
                 System.out.println("app name : " + allApps.get(id));

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterOGCEUS3Application.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterOGCEUS3Application.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterOGCEUS3Application.java
index d046710..c1f5cc8 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterOGCEUS3Application.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterOGCEUS3Application.java
@@ -159,7 +159,7 @@ public class RegisterOGCEUS3Application {
             System.out.println("\n #### Registering Application Modules #### \n");
 
             //Register Echo
-            ultrascanModuleId = airavataClient.registerApplicationModule(
+            ultrascanModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             "ultrascan_ogce", "1.0", "ultrascan application"));
             System.out.println("Ultrascan Module Id " + ultrascanModuleId);
@@ -191,7 +191,7 @@ public class RegisterOGCEUS3Application {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
   
-            ultrascanAppId = airavataClient.registerApplicationInterface(
+            ultrascanAppId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("ultrascan", "ultrascan application",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Ultrascan Application Interface Id " + ultrascanAppId);
@@ -206,12 +206,12 @@ public class RegisterOGCEUS3Application {
 			System.out.println("#### Registering Application Deployments on Stampede #### \n");
 
 			// Register Stampede
-			String ultascanStamplede = airavataClient.registerApplicationDeployment(RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
+			String ultascanStamplede = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
 					stampedeResourceId, "/home1/01437/ogce/xsede_apps/ultrascan/bin/us_mpi_analysis",
                     ApplicationParallelismType.MPI, "ultrascan OGCE application", null, null, null));
 			System.out.println("Ultrascan on stampede deployment Id " + ultascanStamplede);
 			
-			String ultascanTrestles = airavataClient.registerApplicationDeployment(RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
+			String ultascanTrestles = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
 					trestlesResourceId, "/home/ogce/xsede_app/ultrascan/bin/us_mpi_analysis",
                     ApplicationParallelismType.MPI, "ultrascan OGCE application", null, null, null));
 			System.out.println("Ultrascan on trestles deployment Id " + ultascanTrestles);

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1f0b00d/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
index c311dde..7f7ac1d 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -238,81 +238,81 @@ public class RegisterSampleApplications {
             System.out.println("\n #### Registering Application Modules #### \n");
 
             //Register Echo
-            echoModuleId = airavataClient.registerApplicationModule(
+            echoModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             echoName, "1.0", echoDescription));
             System.out.println("Echo Module Id " + echoModuleId);
             
-            mpiModuleId = airavataClient.registerApplicationModule(
+            mpiModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             mpiName, "1.0", mpiDescription));
             System.out.println("MPI Module Id " + mpiModuleId);
             
 
             //Register Amber
-            amberModuleId = airavataClient.registerApplicationModule(
+            amberModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             amberName, "12.0", amberDescription));
             System.out.println("Amber Module Id " + amberModuleId);
 
             //Register AutoDock
-            autoDockModuleId = airavataClient.registerApplicationModule(
+            autoDockModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             autoDockName, "4.2", autoDockDescription));
             System.out.println("AutoDock Module Id " + autoDockModuleId);
 
             //Register ESPRESSO
-            espressoModuleId = airavataClient.registerApplicationModule(
+            espressoModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             espressoName, "5.0.3", espressoDescription));
             System.out.println("ESPRESSO Module Id " + espressoModuleId);
 
             //Register GROMACS
-            gromacsModuleId = airavataClient.registerApplicationModule(
+            gromacsModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             gromacsName, "4.6.5", gromacsDescription));
             System.out.println("GROMACS Module Id " + gromacsModuleId);
 
             //Register LAMMPS
-            lammpsModuleId = airavataClient.registerApplicationModule(
+            lammpsModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             lammpsName, "20Mar14", lammpsDescription));
             System.out.println("LAMMPS Module Id " + lammpsModuleId);
 
             //Register NWChem
-            nwChemModuleId = airavataClient.registerApplicationModule(
+            nwChemModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             nwChemName, "6.3", nwChemDescription));
             System.out.println("NWChem Module Id " + nwChemModuleId);
 
             //Register Trinity
-            trinityModuleId = airavataClient.registerApplicationModule(
+            trinityModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             trinityName, "r20130225", trinityDescription));
             System.out.println("Trinity Module Id " + trinityModuleId);
 
             //Register WRF
-            wrfModuleId = airavataClient.registerApplicationModule(
+            wrfModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             wrfName, "3.5.1", wrfDescription));
             System.out.println("WRF Module Id " + wrfModuleId);
 
             //Register PHASTA
-            phastaModuleId = airavataClient.registerApplicationModule(
+            phastaModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             phastaName, "1.0", phastaDescription));
             System.out.println("phasta Module Id " + phastaModuleId);
 
-            monteXModuleId = airavataClient.registerApplicationModule(
+            monteXModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             monteXName, "1.0", monteXDescription));
             System.out.println("Tinker Monte Module Id " + monteXModuleId);
 
-            gaussianModuleId = airavataClient.registerApplicationModule(
+            gaussianModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             gaussianName, "1.0", gaussianDescription));
             //Register GAMESS
-            gamessModuleId = airavataClient.registerApplicationModule(
+            gamessModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             gamessName, "17May13", gamessDescription));
             System.out.println("Gamess Module Id " + gamessModuleId);
@@ -415,7 +415,7 @@ public class RegisterSampleApplications {
                     "", DataType.URI, false, true));
 
 
-            gamessInterfaceId = airavataClient.registerApplicationInterface(
+            gamessInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("gamess", "gamess",
                             appModules, applicationInputs, applicationOutputs));
 
@@ -445,7 +445,7 @@ public class RegisterSampleApplications {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
 
-            echoLocalInterfaceId = airavataClient.registerApplicationInterface(
+            echoLocalInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(echoName, echoDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Local Echo Application Interface Id " + echoLocalInterfaceId);
@@ -484,7 +484,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output1);
             
 
-            echoInterfaceId = airavataClient.registerApplicationInterface(
+            echoInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(echoName, echoDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Echo Application Interface Id " + echoInterfaceId);
@@ -515,7 +515,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output1);
  
             
-            mpiInterfaceId = airavataClient.registerApplicationInterface(
+            mpiInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(mpiName, mpiDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("MPI Application Interface Id " + mpiInterfaceId);
@@ -561,7 +561,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output5);
             applicationOutputs.add(output6);
             
-            amberInterfaceId = airavataClient.registerApplicationInterface(
+            amberInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(amberName, amberDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Amber Application Interface Id " + amberInterfaceId);
@@ -598,7 +598,7 @@ public class RegisterSampleApplications {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
 
-            autoDockInterfaceId = airavataClient.registerApplicationInterface(
+            autoDockInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(autoDockName, autoDockDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("AutoDock Application Interface Id " + autoDockInterfaceId);
@@ -636,7 +636,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output3);
             applicationOutputs.add(output4);
 
-            espressoInterfaceId = airavataClient.registerApplicationInterface(
+            espressoInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(espressoName, espressoDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Espresso Application Interface Id " + espressoInterfaceId);
@@ -676,7 +676,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output4);
             applicationOutputs.add(output5);
 
-            gromacsInterfaceId = airavataClient.registerApplicationInterface(
+            gromacsInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(gromacsName, gromacsDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Gromacs Application Interface Id " + gromacsInterfaceId);
@@ -704,7 +704,7 @@ public class RegisterSampleApplications {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
 
-            lammpsInterfaceId = airavataClient.registerApplicationInterface(
+            lammpsInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(lammpsName, lammpsDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("LAMMPS Application Interface Id " + lammpsInterfaceId);
@@ -733,7 +733,7 @@ public class RegisterSampleApplications {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
 
-            nwChemInterfaceId = airavataClient.registerApplicationInterface(
+            nwChemInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(nwChemName, nwChemDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("NWChem Application Interface Id " + nwChemInterfaceId);
@@ -768,7 +768,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output1);
             applicationOutputs.add(output2);
 
-            trinityInterfaceId = airavataClient.registerApplicationInterface(
+            trinityInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(trinityName, trinityDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Trinity Application Interface Id " + trinityInterfaceId);
@@ -810,7 +810,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output1);
             applicationOutputs.add(output2);
 
-            wrfInterfaceId = airavataClient.registerApplicationInterface(
+            wrfInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(wrfName, wrfDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("WRF Application Interface Id " + wrfInterfaceId);
@@ -848,7 +848,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output1);
             applicationOutputs.add(output2);
 
-            amberInterfaceId = airavataClient.registerApplicationInterface(
+            amberInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(phastaName, phastaDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("phasta Application Interface Id " + phastaInterfaceId);
@@ -862,7 +862,7 @@ public class RegisterSampleApplications {
         try {
             System.out.println("#### Registering Application Deployments on Localhost #### \n");
             //Register Echo
-            String echoAppDeployId = airavataClient.registerApplicationDeployment(
+            String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, localhostId,
                             "/bin/echo", ApplicationParallelismType.SERIAL, echoDescription, null, null, null));
 
@@ -892,7 +892,7 @@ public class RegisterSampleApplications {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
 
-            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(
+            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Gaussian", "Gaussian application",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Gaussian Application Interface Id " + addApplicationInterfaceId);
@@ -939,7 +939,7 @@ public class RegisterSampleApplications {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
 
-            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(
+            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Tinker_Monte", "Monte application",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Monte Application Interface Id " + addApplicationInterfaceId);
@@ -955,28 +955,28 @@ public class RegisterSampleApplications {
             System.out.println("#### Registering Application Deployments on Stampede #### \n");
 
             //Register Echo
-            String echoAppDeployId = airavataClient.registerApplicationDeployment(
+            String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, stampedeResourceId,
                             "/home1/01437/ogce/production/app_wrappers/echo_wrapper.sh", ApplicationParallelismType.SERIAL,
                             echoDescription, null, null,null));
             System.out.println("Echo on stampede deployment Id " + echoAppDeployId);
 
             //Register Amber
-            String amberAppDeployId = airavataClient.registerApplicationDeployment(
+            String amberAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, stampedeResourceId,
                             "/home1/01437/ogce/production/app_wrappers/amber_wrapper.sh", ApplicationParallelismType.MPI,
                             amberDescription, null, null, null));
             System.out.println("Amber on stampede deployment Id " + amberAppDeployId);
 
             //Register ESPRESSO
-            String espressoAppDeployId = airavataClient.registerApplicationDeployment(
+            String espressoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(espressoModuleId, stampedeResourceId,
                             "/home1/01437/ogce/production/app_wrappers/espresso_wrapper.sh", ApplicationParallelismType.MPI,
                             espressoDescription, null, null, null));
             System.out.println("ESPRESSO on stampede deployment Id " + espressoAppDeployId);
 
             //Register GROMACS
-            String gromacsAppDeployId = airavataClient.registerApplicationDeployment(
+            String gromacsAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(gromacsModuleId, stampedeResourceId,
                             "/home1/01437/ogce/production/app_wrappers/gromacs_wrapper.sh", ApplicationParallelismType.MPI,
                             gromacsDescription, null, null ,null));
@@ -985,7 +985,7 @@ public class RegisterSampleApplications {
             //Register LAMMPS
             List<String> preJobCommands = new ArrayList<String>();
             preJobCommands.add("cp /home1/00421/ccguser/apps/ds_lammps/data/* $workingDir");
-            String lammpsAppDeployId = airavataClient.registerApplicationDeployment(
+            String lammpsAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(lammpsModuleId, stampedeResourceId,
                             "~/apps/ds_lammps/bin/lmp_stampede", ApplicationParallelismType.MPI,
                             lammpsDescription,null, preJobCommands, null));
@@ -994,21 +994,21 @@ public class RegisterSampleApplications {
             //Register NWChem
             List<String> nwChemModuleCmds = new ArrayList<String>();
             nwChemModuleCmds.add("module load nwchem");
-            String nwChemAppDeployId = airavataClient.registerApplicationDeployment(
+            String nwChemAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(nwChemModuleId, stampedeResourceId,
                             "nwchem", ApplicationParallelismType.MPI,
                             nwChemDescription, nwChemModuleCmds, null, null));
             System.out.println("NWChem on stampede deployment Id " + nwChemAppDeployId);
 
             //Register Trinity
-            String trinityAppDeployId = airavataClient.registerApplicationDeployment(
+            String trinityAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(trinityModuleId, stampedeResourceId,
                             "/home1/01437/ogce/production/app_wrappers/trinity_wrapper.sh", ApplicationParallelismType.MPI,
                             trinityDescription, null, null, null));
             System.out.println("Trinity on stampede deployment Id " + trinityAppDeployId);
 
             //Register WRF
-            String wrfAppDeployId = airavataClient.registerApplicationDeployment(
+            String wrfAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(wrfModuleId, stampedeResourceId,
                             "/home1/01437/ogce/production/app_wrappers/wrf_wrapper.sh", ApplicationParallelismType.MPI,
                             wrfDescription, null, null , null));
@@ -1020,7 +1020,7 @@ public class RegisterSampleApplications {
 //            monteXModuleCmds.add("module load uberftp");
             monteXModuleCmds.add("module load fftw3");
 
-            String monteXAppDeployId = airavataClient.registerApplicationDeployment(
+            String monteXAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(monteXModuleId, stampedeResourceId,
                             "/home1/00421/ccguser/apps/tinker/tinker/bin/monte.x", ApplicationParallelismType.OPENMP,
                             monteXDescription, monteXModuleCmds, null, null));
@@ -1035,28 +1035,28 @@ public class RegisterSampleApplications {
             System.out.println("#### Registering Application Deployments on Trestles #### \n");
 
             //Register Echo
-            String echoAppDeployId = airavataClient.registerApplicationDeployment(
+            String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, trestlesResourceId,
                             "/home/ogce/production/app_wrappers/echo_wrapper.sh", ApplicationParallelismType.SERIAL,
                             echoDescription, null, null, null));
             System.out.println("Echo on trestles deployment Id " + echoAppDeployId);
 
             //Register Amber
-            String amberAppDeployId = airavataClient.registerApplicationDeployment(
+            String amberAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, trestlesResourceId,
                             "/home/ogce/production/app_wrappers/amber_wrapper.sh", ApplicationParallelismType.MPI,
                             amberDescription, null, null, null));
             System.out.println("Amber on trestles deployment Id " + amberAppDeployId);
 
             //Register GROMACS
-            String gromacsAppDeployId = airavataClient.registerApplicationDeployment(
+            String gromacsAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(gromacsModuleId, trestlesResourceId,
                             "/home/ogce/production/app_wrappers/gromacs_wrapper.sh", ApplicationParallelismType.MPI,
                             gromacsDescription, null, null, null));
             System.out.println("GROMACS on trestles deployment Id " + gromacsAppDeployId);
 
             //Register LAMMPS
-            String lammpsAppDeployId = airavataClient.registerApplicationDeployment(
+            String lammpsAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(lammpsModuleId, trestlesResourceId,
                             "/home/ogce/production/app_wrappers/lammps_wrapper.sh", ApplicationParallelismType.MPI,
                             lammpsDescription, null, null , null));
@@ -1065,7 +1065,7 @@ public class RegisterSampleApplications {
             //Register GAMESS
             List<String> moduleLoadCmd = new ArrayList<String>();
             moduleLoadCmd.add("module load gamess");
-            String gamessAppDeployId = airavataClient.registerApplicationDeployment(
+            String gamessAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(gamessModuleId, trestlesResourceId,
                             "/opt/gamess/rungms", ApplicationParallelismType.MPI,
                             gamessDescription, moduleLoadCmd, null,null));
@@ -1074,7 +1074,7 @@ public class RegisterSampleApplications {
 
             List<String> gaussianMouldes = new ArrayList<String>();
             gaussianMouldes.add("module load gaussian");
-            String gaussianAppDeployId = airavataClient.registerApplicationDeployment(
+            String gaussianAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(gaussianModuleId, trestlesResourceId,
                             "g09", ApplicationParallelismType.OPENMP, gaussianDescription, gaussianMouldes , null, null));
             System.out.println("Gaussian on trestles deployment Id " + gaussianAppDeployId);
@@ -1089,21 +1089,21 @@ public class RegisterSampleApplications {
             System.out.println("#### Registering Application Deployments on BigRed II #### \n");
 
             //Register Echo
-            String echoAppDeployId = airavataClient.registerApplicationDeployment(
+            String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, bigredResourceId,
                             "/N/u/cgateway/BigRed2/production/app_wrappers/echo_wrapper.sh",
                             ApplicationParallelismType.SERIAL, echoDescription, null, null, null));
             System.out.println("Echo on bigredII deployment Id " + echoAppDeployId);
 
             //Register Amber
-            String amberAppDeployId = airavataClient.registerApplicationDeployment(
+            String amberAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, bigredResourceId,
                             "/N/u/cgateway/BigRed2/production/app_wrappers/amber_wrapper.sh", ApplicationParallelismType.MPI,
                             amberDescription, null, null, null));
             System.out.println("Amber on bigredII deployment Id " + amberAppDeployId);
 
             //Register AutoDock
-            String autoDockDeployId = airavataClient.registerApplicationDeployment(
+            String autoDockDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(autoDockModuleId, bigredResourceId,
                             "/N/u/cgateway/BigRed2/production/app_wrappers/auto_dock_wrapper.sh", ApplicationParallelismType.MPI,
                             autoDockDescription, null, null, null));
@@ -1133,13 +1133,13 @@ public class RegisterSampleApplications {
             System.out.println("#### Registering Application Deployments on FSD #### \n");
 
             //Register Echo
-            String echoAppDeployId = airavataClient.registerApplicationDeployment(
+            String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, fsdResourceId,
                             "/bin/echo", ApplicationParallelismType.SERIAL, echoDescription, null, null, null));
             System.out.println("Echo on FSD deployment Id: " + echoAppDeployId);
 
             //Register MPI
-            String mpiAppDeployId = airavataClient.registerApplicationDeployment(
+            String mpiAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(mpiModuleId, fsdResourceId,
                             "/home/bes/hellompi", ApplicationParallelismType.OPENMP_MPI, mpiDescription, null, null, null));
             System.out.println("MPI on FSD deployment Id: " + mpiAppDeployId);