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/07/21 06:42:16 UTC

[33/44] airavata git commit: fixed all compilation errors in the java client samples after the API changes.

http://git-wip-us.apache.org/repos/asf/airavata/blob/7be309d7/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 7294bbb..13311c2 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
@@ -38,6 +38,7 @@ import org.apache.airavata.model.application.io.DataType;
 import org.apache.airavata.model.application.io.InputDataObjectType;
 import org.apache.airavata.model.application.io.OutputDataObjectType;
 import org.apache.airavata.model.error.AiravataClientException;
+import org.apache.airavata.model.security.AuthzToken;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -184,12 +185,12 @@ public class RegisterSampleApplications {
             hostAliases.add("alias1");
             hostAliases.add("alias2");
             computeResourceDescription.setHostAliases(hostAliases);
-            localhostId = airavataClient.registerComputeResource(computeResourceDescription);
+            localhostId = airavataClient.registerComputeResource(new AuthzToken(""), computeResourceDescription);
             ResourceJobManager resourceJobManager = RegisterSampleApplicationsUtils.
                     createResourceJobManager(ResourceJobManagerType.FORK, null, null, null);
             LOCALSubmission submission = new LOCALSubmission();
             submission.setResourceJobManager(resourceJobManager);
-            airavataClient.addLocalSubmissionDetails(localhostId, 1, submission);
+            airavataClient.addLocalSubmissionDetails(new AuthzToken(""), localhostId, 1, submission);
             System.out.println("LocalHost Resource Id is " + localhostId);
 
         } catch (TException e) {
@@ -270,7 +271,7 @@ public class RegisterSampleApplications {
 		ComputeResourceDescription computeResourceDescription = RegisterSampleApplicationsUtils
 				.createComputeResourceDescription(hostName, hostDesc, null, null);
 
-		fsdResourceId = airavataClient.registerComputeResource(computeResourceDescription);
+		fsdResourceId = airavataClient.registerComputeResource(new AuthzToken(""), computeResourceDescription);
 
 		if (fsdResourceId.isEmpty())
 			throw new AiravataClientException();
@@ -283,7 +284,7 @@ public class RegisterSampleApplications {
 //		ucrJobSubmission.setAuthenticationMode(AuthenticationMode.MYPROXY_ISSUED);
 		jobSubmission.setJobSubmissionProtocol(JobSubmissionProtocol.UNICORE);
 
-		airavataClient.addUNICOREJobSubmissionDetails(fsdResourceId, 0, ucrJobSubmission);
+		airavataClient.addUNICOREJobSubmissionDetails(new AuthzToken(""), fsdResourceId, 0, ucrJobSubmission);
 
 		return jobSubmission.getJobSubmissionInterfaceId();
 	}
@@ -293,47 +294,47 @@ public class RegisterSampleApplications {
             System.out.println("\n #### Registering Application Modules #### \n");
 
             //Register Echo
-            echoModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            echoModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             echoName, "1.0", echoDescription));
             System.out.println("Echo Module Id " + echoModuleId);
 
-            mpiModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            mpiModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             mpiName, "1.0", mpiDescription));
             System.out.println("MPI Module Id " + mpiModuleId);
 
 
             //Register Amber
-            amberModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            amberModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             amberName, "12.0", amberDescription));
             System.out.println("Amber Module Id " + amberModuleId);
 
             //Register AutoDock
-            autoDockModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            autoDockModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             autoDockName, "4.2", autoDockDescription));
             System.out.println("AutoDock Module Id " + autoDockModuleId);
 
             //Register ESPRESSO
-            espressoModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            espressoModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             espressoName, "5.0.3", espressoDescription));
             System.out.println("ESPRESSO Module Id " + espressoModuleId);
 
             //Register GROMACS
-            gromacsModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            gromacsModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             gromacsName, "4.6.5", gromacsDescription));
             System.out.println("GROMACS Module Id " + gromacsModuleId);
 
             //Register LAMMPS
-            lammpsModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            lammpsModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             lammpsName, "20Mar14", lammpsDescription));
 
-            lammpsModuleId1 = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            lammpsModuleId1 = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             lammpsName, "28Jun14-base", lammpsDescription));
 
@@ -342,44 +343,44 @@ public class RegisterSampleApplications {
             System.out.println("LAMMPS Module Id for LSF " + lammpsModuleId1);
 
             //Register NWChem
-            nwChemModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            nwChemModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             nwChemName, "6.3", nwChemDescription));
             System.out.println("NWChem Module Id " + nwChemModuleId);
 
             //Register Trinity
-            trinityModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            trinityModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             trinityName, "r20130225", trinityDescription));
             System.out.println("Trinity Module Id " + trinityModuleId);
 
             //Register WRF
-            wrfModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            wrfModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             wrfName, "3.5.1", wrfDescription));
             System.out.println("WRF Module Id " + wrfModuleId);
 
             //Register PHASTA
-            phastaModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            phastaModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             phastaName, "1.0", phastaDescription));
             System.out.println("phasta Module Id " + phastaModuleId);
 
-            monteXModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            monteXModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             monteXName, "1.0", monteXDescription));
             System.out.println("Tinker Monte Module Id " + monteXModuleId);
 
-            gaussianModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            gaussianModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             gaussianName, "1.0", gaussianDescription));
             //Register GAMESS
-            gamessModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            gamessModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             gamessName, "17May13", gamessDescription));
             System.out.println("Gamess Module Id " + gamessModuleId);
             //Register Ultrascan
-            ultrascanModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            ultrascanModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             ultrascanName, "1.0", ultrascanDescription));
             System.out.println("Ultrascan Module Id " + ultrascanModuleId);
@@ -491,7 +492,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(RegisterSampleApplicationsUtils.createAppOutput("STDERR",
                     "", DataType.STDERR, false, true, null));
 
-            gamessInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            gamessInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("gamess", "gamess",
                             appModules, applicationInputs, applicationOutputs));
 
@@ -524,7 +525,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output1);
             applicationOutputs.add(output2);
 
-            echoLocalInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            echoLocalInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(echoName, echoDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Local Echo Application Interface Id " + echoLocalInterfaceId);
@@ -567,7 +568,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output2);
 
 
-            echoInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            echoInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(echoName, echoDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Echo Application Interface Id " + echoInterfaceId);
@@ -624,7 +625,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output3);
 
 
-            mpiInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            mpiInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(mpiName, mpiDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("MPI Application Interface Id " + mpiInterfaceId);
@@ -670,7 +671,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output5);
             applicationOutputs.add(output6);
 
-            amberInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            amberInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(amberName, amberDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Amber Application Interface Id " + amberInterfaceId);
@@ -709,7 +710,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output1);
             applicationOutputs.add(output2);
 
-            autoDockInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            autoDockInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(autoDockName, autoDockDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("AutoDock Application Interface Id " + autoDockInterfaceId);
@@ -747,7 +748,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output3);
             applicationOutputs.add(output4);
 
-            espressoInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            espressoInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(espressoName, espressoDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Espresso Application Interface Id " + espressoInterfaceId);
@@ -787,7 +788,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output4);
             applicationOutputs.add(output5);
 
-            gromacsInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            gromacsInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(gromacsName, gromacsDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Gromacs Application Interface Id " + gromacsInterfaceId);
@@ -821,7 +822,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output2);
             applicationOutputs.add(output3);
 
-            lammpsInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            lammpsInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(lammpsName, lammpsDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("LAMMPS Application Interface Id " + lammpsInterfaceId);
@@ -855,7 +856,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output2);
             applicationOutputs.add(output3);
 
-            nwChemInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            nwChemInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(nwChemName, nwChemDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("NWChem Application Interface Id " + nwChemInterfaceId);
@@ -894,7 +895,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output3);
             applicationOutputs.add(output4);
 
-            trinityInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            trinityInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(trinityName, trinityDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Trinity Application Interface Id " + trinityInterfaceId);
@@ -941,7 +942,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output3);
             applicationOutputs.add(output4);
 
-            wrfInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            wrfInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(wrfName, wrfDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("WRF Application Interface Id " + wrfInterfaceId);
@@ -985,7 +986,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output4);
 
 
-            phastaInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            phastaInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(phastaName, phastaDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("phasta Application Interface Id " + phastaInterfaceId);
@@ -999,7 +1000,7 @@ public class RegisterSampleApplications {
         try {
             System.out.println("#### Registering Application Deployments on Localhost #### \n");
             //Register Echo
-            String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String echoAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, localhostId,
                             "/bin/echo", ApplicationParallelismType.SERIAL, echoDescription, null, null, null));
 
@@ -1034,7 +1035,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output2);
             applicationOutputs.add(output3);
 
-            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Gaussian", "Gaussian application",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Gaussian Application Interface Id " + addApplicationInterfaceId);
@@ -1086,7 +1087,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output2);
             applicationOutputs.add(output3);
 
-            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Tinker_Monte", "Monte application",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Monte Application Interface Id " + addApplicationInterfaceId);
@@ -1102,7 +1103,7 @@ public class RegisterSampleApplications {
             System.out.println("#### Registering Application Deployments on Stampede #### \n");
 
             //Register Echo
-            String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String echoAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, stampedeResourceId,
                             "/home1/01437/ogce/production/app_wrappers/echo_wrapper.sh", ApplicationParallelismType.SERIAL,
                             echoDescription, null, null,null));
@@ -1114,18 +1115,18 @@ public class RegisterSampleApplications {
             ApplicationDeploymentDescription amberStampedeDeployment = RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, stampedeResourceId,
                     "/opt/apps/intel13/mvapich2_1_9/amber/12.0/bin/sander.MPI -O", ApplicationParallelismType.MPI,
                     amberDescription, moduleLoadCMDs, null, null);
-            String amberAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,amberStampedeDeployment);
+            String amberAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,amberStampedeDeployment);
             System.out.println("Amber on stampede deployment Id " + amberAppDeployId);
 
             //Register ESPRESSO
-            String espressoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String espressoAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), 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(DEFAULT_GATEWAY,
+            String gromacsAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(gromacsModuleId, stampedeResourceId,
                             "/home1/01437/ogce/production/app_wrappers/gromacs_wrapper.sh", ApplicationParallelismType.MPI,
                             gromacsDescription, null, null ,null));
@@ -1134,7 +1135,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(DEFAULT_GATEWAY,
+            String lammpsAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(lammpsModuleId, stampedeResourceId,
                             "~/apps/ds_lammps/bin/lmp_stampede", ApplicationParallelismType.MPI,
                             lammpsDescription,null, preJobCommands, null));
@@ -1143,21 +1144,21 @@ public class RegisterSampleApplications {
             //Register NWChem
             List<String> nwChemModuleCmds = new ArrayList<String>();
             nwChemModuleCmds.add("module load nwchem");
-            String nwChemAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String nwChemAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), 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(DEFAULT_GATEWAY,
+            String trinityAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), 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(DEFAULT_GATEWAY,
+            String wrfAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(wrfModuleId, stampedeResourceId,
                             "/home1/01437/ogce/production/app_wrappers/wrf_wrapper.sh", ApplicationParallelismType.MPI,
                             wrfDescription, null, null , null));
@@ -1169,7 +1170,7 @@ public class RegisterSampleApplications {
 //            monteXModuleCmds.add("module load uberftp");
             monteXModuleCmds.add("module load fftw3");
 
-            String monteXAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String monteXAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(monteXModuleId, stampedeResourceId,
                             "/home1/00421/ccguser/apps/tinker/tinker/bin/monte.x", ApplicationParallelismType.OPENMP,
                             monteXDescription, monteXModuleCmds, null, null));
@@ -1184,7 +1185,7 @@ public class RegisterSampleApplications {
             System.out.println("#### Registering Application Deployments on Trestles #### \n");
 
             //Register Echo
-            String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String echoAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, trestlesResourceId,
                             "/home/ogce/production/app_wrappers/echo_wrapper.sh", ApplicationParallelismType.SERIAL,
                             echoDescription, null, null, null));
@@ -1193,21 +1194,21 @@ public class RegisterSampleApplications {
             //Register Amber
             List<String> moduleLoadCMDs = new ArrayList<String>();
             moduleLoadCMDs.add("module load amber");
-            String amberAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String amberAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, trestlesResourceId,
                             "/opt/amber/bin/sander.MPI -O", ApplicationParallelismType.MPI,
                             amberDescription, moduleLoadCMDs, null, null));
             System.out.println("Amber on trestles deployment Id " + amberAppDeployId);
 
             //Register GROMACS
-            String gromacsAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String gromacsAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), 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(DEFAULT_GATEWAY,
+            String lammpsAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(lammpsModuleId, trestlesResourceId,
                             "/home/ogce/production/app_wrappers/lammps_wrapper.sh", ApplicationParallelismType.MPI,
                             lammpsDescription, null, null , null));
@@ -1216,7 +1217,7 @@ public class RegisterSampleApplications {
             //Register GAMESS
             List<String> moduleLoadCmd = new ArrayList<String>();
             moduleLoadCmd.add("module load gamess");
-            String gamessAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String gamessAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(gamessModuleId, trestlesResourceId,
                             "/opt/gamess/rungms", ApplicationParallelismType.MPI,
                             gamessDescription, moduleLoadCmd, null,null));
@@ -1225,7 +1226,7 @@ public class RegisterSampleApplications {
 
             List<String> gaussianMouldes = new ArrayList<String>();
             gaussianMouldes.add("module load gaussian");
-            String gaussianAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String gaussianAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(gaussianModuleId, trestlesResourceId,
                             "g09", ApplicationParallelismType.OPENMP, gaussianDescription, gaussianMouldes , null, null));
             System.out.println("Gaussian on trestles deployment Id " + gaussianAppDeployId);
@@ -1240,7 +1241,7 @@ public class RegisterSampleApplications {
             System.out.println("#### Registering Application Deployments on Trestles #### \n");
 
             //Register Echo
-            String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String echoAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, lsfResourceId,
                             "/home/lg11w/executables/echo.sh", ApplicationParallelismType.SERIAL,
                             echoDescription, null, null, null));
@@ -1249,7 +1250,7 @@ public class RegisterSampleApplications {
             moduleLoadCmd.add("module load LAMMPS/28Jun14-base");
             //Register Echo
 
-            String lammpsDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String lammpsDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(lammpsModuleId, lsfResourceId,
                             "lmp_ghpcc", ApplicationParallelismType.MPI,
                             echoDescription, moduleLoadCmd, null, null));
@@ -1265,7 +1266,7 @@ public class RegisterSampleApplications {
             System.out.println("#### Registering Application Deployments on BigRed II #### \n");
 
             //Register Echo
-            String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String echoAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, bigredResourceId,
                             "/N/u/cgateway/BigRed2/production/app_wrappers/echo_wrapper.sh",
                             ApplicationParallelismType.SERIAL, echoDescription, null, null, null));
@@ -1275,7 +1276,7 @@ public class RegisterSampleApplications {
             List<String> amberModuleLoadCMDsBr2 = new ArrayList<String>();
             amberModuleLoadCMDsBr2.add("module load amber/gnu/mpi/12");
             amberModuleLoadCMDsBr2.add("module swap PrgEnv-cray PrgEnv-gnu");
-            String amberAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String amberAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, bigredResourceId,
                             "/N/soft/cle4/amber/gnu/mpi/12/amber12/bin/sander.MPI -O", ApplicationParallelismType.MPI,
                             amberDescription, amberModuleLoadCMDsBr2, null, null));
@@ -1283,7 +1284,7 @@ public class RegisterSampleApplications {
             System.out.println("Amber on bigredII deployment Id " + amberAppDeployId);
 
             //Register AutoDock
-            String autoDockDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String autoDockDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(autoDockModuleId, bigredResourceId,
                             "/N/u/cgateway/BigRed2/production/app_wrappers/auto_dock_wrapper.sh", ApplicationParallelismType.MPI,
                             autoDockDescription, null, null, null));
@@ -1313,7 +1314,7 @@ public class RegisterSampleApplications {
             System.out.println("#### Registering Application Deployments on FSD #### \n");
 
             //Register Echo
-            String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String echoAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, fsdResourceId,
                             "/bin/echo", ApplicationParallelismType.SERIAL, echoDescription, null, null, null));
             System.out.println("Echo on FSD deployment Id: " + echoAppDeployId);
@@ -1324,7 +1325,7 @@ public class RegisterSampleApplications {
 //                            "/home/bes/hellompi", ApplicationParallelismType.OPENMP_MPI, mpiDescription, null, null, null));
 
 
-            String mpiAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String mpiAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(mpiModuleId, fsdResourceId,
                             "us_mpi_analysis", ApplicationParallelismType.MPI, mpiDescription, null, null, null));
 
@@ -1365,7 +1366,7 @@ public class RegisterSampleApplications {
         ComputeResourceDescription computeResourceDescription = RegisterSampleApplicationsUtils.
                 createComputeResourceDescription(hostName, hostDesc, null, null);
         computeResourceDescription.setBatchQueues(batchQueues);
-        String computeResourceId = airavataClient.registerComputeResource(computeResourceDescription);
+        String computeResourceId = airavataClient.registerComputeResource(new AuthzToken(""), computeResourceDescription);
 
         if (computeResourceId.isEmpty()) throw new AiravataClientException();
 
@@ -1393,12 +1394,12 @@ public class RegisterSampleApplications {
         sshJobSubmission.setSecurityProtocol(securityProtocol);
         sshJobSubmission.setSshPort(portNumber);
         sshJobSubmission.setMonitorMode(MonitorMode.JOB_EMAIL_NOTIFICATION_MONITOR);
-        airavataClient.addSSHJobSubmissionDetails(computeResourceId, 1, sshJobSubmission);
+        airavataClient.addSSHJobSubmissionDetails(new AuthzToken(""), computeResourceId, 1, sshJobSubmission);
 
         SCPDataMovement scpDataMovement = new SCPDataMovement();
         scpDataMovement.setSecurityProtocol(securityProtocol);
         scpDataMovement.setSshPort(portNumber);
-        airavataClient.addSCPDataMovementDetails(computeResourceId, 1, scpDataMovement);
+        airavataClient.addSCPDataMovementDetails(new AuthzToken(""), computeResourceId, 1, scpDataMovement);
 
         return computeResourceId;
     }
@@ -1443,7 +1444,7 @@ public class RegisterSampleApplications {
             gatewayResourceProfile.addToComputeResourcePreferences(fsdResourcePreferences);
             gatewayResourceProfile.addToComputeResourcePreferences(lsfResourcePreferences);
 
-            String gatewayProfile = airavataClient.registerGatewayResourceProfile(gatewayResourceProfile);
+            String gatewayProfile = airavataClient.registerGatewayResourceProfile(new AuthzToken(""), gatewayResourceProfile);
             System.out.println("Gateway Profile is registered with Id " + gatewayProfile);
 
         } catch (TException e) {
@@ -1490,7 +1491,7 @@ public class RegisterSampleApplications {
             ultrascanMouldes.add("module load qt4/4.8.6");
             ultrascanMouldes.add("module load ultrascan3/3.3");
 
-            String ultrascanAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+            String ultrascanAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId, alamoResourceId,
                             "/home/us3/bin/us_mpi_analysis", ApplicationParallelismType.OPENMP, ultrascanDescription, ultrascanMouldes , null, null));
             System.out.println("Ultrascan on alamo deployment Id " + ultrascanAppDeployId);
@@ -1527,7 +1528,7 @@ public class RegisterSampleApplications {
             applicationOutputs.add(output2);
             applicationOutputs.add(output3);
 
-            String ultrascanInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            String ultrascanInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Ultrascan", "Ultrascan application",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Ultrascan Application Interface Id " + ultrascanInterfaceId);

http://git-wip-us.apache.org/repos/asf/airavata/blob/7be309d7/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 1a39de3..f5049db 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
@@ -42,6 +42,7 @@ import org.apache.airavata.model.application.io.DataType;
 import org.apache.airavata.model.application.io.InputDataObjectType;
 import org.apache.airavata.model.application.io.OutputDataObjectType;
 import org.apache.airavata.model.error.AiravataClientException;
+import org.apache.airavata.model.security.AuthzToken;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -159,7 +160,7 @@ public class RegisterUS3Application {
             System.out.println("\n #### Registering Application Modules #### \n");
 
             //Register Echo
-            ultrascanModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+            ultrascanModuleId = airavataClient.registerApplicationModule(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             "ultrascan", "1.0", "ultrascan application"));
             System.out.println("Ultrascan Module Id " + ultrascanModuleId);
@@ -191,7 +192,7 @@ public class RegisterUS3Application {
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
   
-            ultrascanAppId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+            ultrascanAppId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("ultrascan", "ultrascan application",
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("Ultrascan Application Interface Id " + ultrascanAppId);
@@ -206,17 +207,17 @@ public class RegisterUS3Application {
 			System.out.println("#### Registering Application Deployments on Stampede #### \n");
 
 			// Register Stampede
-			String ultascanStamplede = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
+			String ultascanStamplede = airavataClient.registerApplicationDeployment(new AuthzToken(""), 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(DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
+			String ultascanTrestles = airavataClient.registerApplicationDeployment(new AuthzToken(""), 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(DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
+			String ultascanLonestar = airavataClient.registerApplicationDeployment(new AuthzToken(""), 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(DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId,
+			String ultascanAlamo = airavataClient.registerApplicationDeployment(new AuthzToken(""), 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) {
@@ -252,7 +253,7 @@ public class RegisterUS3Application {
             gatewayResourceProfile.addToComputeResourcePreferences(lonestarResourcePreferences);
             gatewayResourceProfile.addToComputeResourcePreferences(alamoResourcePreferences);
 
-            String gatewayProfile = airavataClient.registerGatewayResourceProfile(gatewayResourceProfile);
+            String gatewayProfile = airavataClient.registerGatewayResourceProfile(new AuthzToken(""), gatewayResourceProfile);
             System.out.println("Gateway Profile is registered with Id " + gatewayProfile);
 
         } catch (TException e) {
@@ -265,7 +266,7 @@ public class RegisterUS3Application {
 		ComputeResourceDescription computeResourceDescription = RegisterSampleApplicationsUtils
 				.createComputeResourceDescription(hostName, hostDesc, null, null);
 
-		String computeResourceId = airavataClient.registerComputeResource(computeResourceDescription);
+		String computeResourceId = airavataClient.registerComputeResource(new AuthzToken(""), computeResourceDescription);
 
 		if (computeResourceId.isEmpty())
 			throw new AiravataClientException();
@@ -282,12 +283,12 @@ public class RegisterUS3Application {
 		sshJobSubmission.setResourceJobManager(resourceJobManager);
 		sshJobSubmission.setSecurityProtocol(securityProtocol);
 		sshJobSubmission.setSshPort(portNumber);
-		airavataClient.addSSHJobSubmissionDetails(computeResourceId, 1, sshJobSubmission);
+		airavataClient.addSSHJobSubmissionDetails(new AuthzToken(""), computeResourceId, 1, sshJobSubmission);
 
 		SCPDataMovement scpDataMovement = new SCPDataMovement();
 		scpDataMovement.setSecurityProtocol(securityProtocol);
 		scpDataMovement.setSshPort(portNumber);
-		airavataClient.addSCPDataMovementDetails(computeResourceId, 1, scpDataMovement);
+		airavataClient.addSCPDataMovementDetails(new AuthzToken(""), computeResourceId, 1, scpDataMovement);
 
 		return computeResourceId;
 	}
@@ -309,13 +310,13 @@ public class RegisterUS3Application {
 		sshJobSubmission.setResourceJobManager(resourceJobManager);
 		sshJobSubmission.setSecurityProtocol(securityProtocol);
 		sshJobSubmission.setSshPort(portNumber);
-		airavataClient.addSSHJobSubmissionDetails(computeResourceId, 1, sshJobSubmission);
-		ComputeResourceDescription computeResourceDescription = airavataClient.getComputeResource(computeResourceId);
+		airavataClient.addSSHJobSubmissionDetails(new AuthzToken(""), computeResourceId, 1, sshJobSubmission);
+		ComputeResourceDescription computeResourceDescription = airavataClient.getComputeResource(new AuthzToken(""), computeResourceId);
 		computeResourceDescription.getJobSubmissionInterfacesIterator();
 		SCPDataMovement scpDataMovement = new SCPDataMovement();
 		scpDataMovement.setSecurityProtocol(securityProtocol);
 		scpDataMovement.setSshPort(portNumber);
-		airavataClient.addSCPDataMovementDetails(computeResourceId, 1, scpDataMovement);
+		airavataClient.addSCPDataMovementDetails(new AuthzToken(""), computeResourceId, 1, scpDataMovement);
 
 		return computeResourceId;
 	}