You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2014/05/21 07:42:02 UTC

[1/3] git commit: adding gridftp model

Repository: airavata
Updated Branches:
  refs/heads/master 2710f6e3a -> 029cfac40


adding gridftp model


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

Branch: refs/heads/master
Commit: af312c32e4f3daf994c3c1db30a586bc33849524
Parents: 23c1184
Author: Saminda Wijeratne <sa...@gmail.com>
Authored: Tue May 20 22:38:03 2014 -0700
Committer: Saminda Wijeratne <sa...@gmail.com>
Committed: Tue May 20 22:38:03 2014 -0700

----------------------------------------------------------------------
 .../applicationCatalogAPI.thrift                          | 10 ++++++++++
 .../applicationCatalogDataModel.thrift                    |  8 +++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/af312c32/airavata-api/thrift-interface-descriptions/applicationCatalogAPI.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/applicationCatalogAPI.thrift b/airavata-api/thrift-interface-descriptions/applicationCatalogAPI.thrift
index 4517889..e098442 100644
--- a/airavata-api/thrift-interface-descriptions/applicationCatalogAPI.thrift
+++ b/airavata-api/thrift-interface-descriptions/applicationCatalogAPI.thrift
@@ -87,6 +87,11 @@ service ApplicationCatalogAPI {
             2: airavataErrors.AiravataClientException ace,
             3: airavataErrors.AiravataSystemException ase) 
             
+  void addGridFTPDataMovementProtocol(1: required string computeResourceId, 2: required applicationCatalogDataModel.GridFTPDataMovement dataMovement)
+  	throws (1: airavataErrors.InvalidRequestException ire,
+            2: airavataErrors.AiravataClientException ace,
+            3: airavataErrors.AiravataSystemException ase)             
+            
   list<string> listComputeResourceDescriptions()
   	throws (1: airavataErrors.InvalidRequestException ire,
             2: airavataErrors.AiravataClientException ace,
@@ -116,6 +121,11 @@ service ApplicationCatalogAPI {
   	throws (1: airavataErrors.InvalidRequestException ire,
             2: airavataErrors.AiravataClientException ace,
             3: airavataErrors.AiravataSystemException ase) 
+              
+  applicationCatalogDataModel.GridFTPDataMovement getGridFTPDataMovementProtocol(1: required string gridFTPDataMovementResourceId)
+  	throws (1: airavataErrors.InvalidRequestException ire,
+            2: airavataErrors.AiravataClientException ace,
+            3: airavataErrors.AiravataSystemException ase) 
 
   bool isComputeResourceDescriptionRegistered(1: required string hostName)
   	throws (1: airavataErrors.InvalidRequestException ire,

http://git-wip-us.apache.org/repos/asf/airavata/blob/af312c32/airavata-api/thrift-interface-descriptions/applicationCatalogDataModel.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/applicationCatalogDataModel.thrift b/airavata-api/thrift-interface-descriptions/applicationCatalogDataModel.thrift
index 308b490..ba19a35 100644
--- a/airavata-api/thrift-interface-descriptions/applicationCatalogDataModel.thrift
+++ b/airavata-api/thrift-interface-descriptions/applicationCatalogDataModel.thrift
@@ -111,11 +111,17 @@ enum SecurityProtocol {
 
 
 struct SCPDataMovement {
-    1: required string dataSubmissionDataID = DEFAULT_ID,
+    1: required string dataMovementDataID = DEFAULT_ID,
     2: required SecurityProtocol securityProtocol,
     3: optional i32 sshPort = 22
 }
 
+struct GridFTPDataMovement {
+    1: required string dataMovementDataID = DEFAULT_ID,
+    2: required SecurityProtocol securityProtocol,
+    3: required list<string>  gridFTPEndPoint
+}
+
 struct SSHJobSubmission {
     1: required string jobSubmissionDataID = DEFAULT_ID,
     2: required ResourceJobManager resourceJobManager,


[2/3] git commit: adding the app catalog handler

Posted by sa...@apache.org.
adding the app catalog handler


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

Branch: refs/heads/master
Commit: e25c54174aaaa628214fb21826cc827bd7f391bb
Parents: af312c3
Author: Saminda Wijeratne <sa...@gmail.com>
Authored: Tue May 20 22:41:11 2014 -0700
Committer: Saminda Wijeratne <sa...@gmail.com>
Committed: Tue May 20 22:41:11 2014 -0700

----------------------------------------------------------------------
 .../handler/ApplicationCatalogHandler.java      | 463 +++++++++++++++++++
 1 file changed, 463 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/e25c5417/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/ApplicationCatalogHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/ApplicationCatalogHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/ApplicationCatalogHandler.java
new file mode 100644
index 0000000..fa5415a
--- /dev/null
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/ApplicationCatalogHandler.java
@@ -0,0 +1,463 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.api.server.handler;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.airavata.api.appcatalog.ApplicationCatalogAPI.Iface;
+import org.apache.airavata.api.appcatalog.applicationCatalogAPIConstants;
+import org.apache.airavata.common.exception.AiravataConfigurationException;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.model.appcatalog.ApplicationDeployment;
+import org.apache.airavata.model.appcatalog.ApplicationDescriptor;
+import org.apache.airavata.model.appcatalog.ApplicationInterface;
+import org.apache.airavata.model.appcatalog.ComputeResourceDescription;
+import org.apache.airavata.model.appcatalog.GSISSHJobSubmission;
+import org.apache.airavata.model.appcatalog.GlobusJobSubmission;
+import org.apache.airavata.model.appcatalog.JobSubmissionProtocol;
+import org.apache.airavata.model.appcatalog.SCPDataMovement;
+import org.apache.airavata.model.appcatalog.SSHJobSubmission;
+import org.apache.airavata.model.error.AiravataClientException;
+import org.apache.airavata.model.error.AiravataSystemException;
+import org.apache.airavata.model.error.InvalidRequestException;
+import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.registry.api.AiravataRegistryFactory;
+import org.apache.airavata.registry.api.AiravataUser;
+import org.apache.airavata.registry.api.Gateway;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.schemas.gfac.ExportProperties;
+import org.apache.airavata.schemas.gfac.GlobusHostType;
+import org.apache.airavata.schemas.gfac.GsisshHostType;
+import org.apache.airavata.schemas.gfac.SSHHostType;
+import org.apache.thrift.TException;
+
+public class ApplicationCatalogHandler implements Iface {
+
+	private AiravataRegistry2 getRegistry() throws RegistryException, AiravataConfigurationException{
+		return AiravataRegistryFactory.getRegistry(new Gateway("default"), new AiravataUser("admin"));
+	}
+	
+	@Override
+	public String GetAPIVersion() throws TException {
+		return applicationCatalogAPIConstants.AIRAVATA_API_VERSION;
+	}
+
+	@Override
+	public void addComputeResourceDescription(
+			ComputeResourceDescription computeResourceDescription)
+			throws InvalidRequestException, AiravataClientException,
+			AiravataSystemException, TException {
+		HostDescription host = new HostDescription();
+		host.getType().setHostName(generateId(computeResourceDescription.getHostName()));
+		if (computeResourceDescription.getIpAddresses().size()>0){
+			host.getType().setHostAddress(computeResourceDescription.getIpAddresses().iterator().next());	
+		}
+		if (computeResourceDescription.getJobSubmissionProtocolsSize()>0){
+			String jobSubmissionProtocolDataId=computeResourceDescription.getJobSubmissionProtocols().keySet().iterator().next();
+			JobSubmissionProtocol jobSubmissionProtocol = computeResourceDescription.getJobSubmissionProtocols().get(jobSubmissionProtocolDataId);
+			switch(jobSubmissionProtocol){
+			case SSH:
+				SSHJobSubmission sshJobSubmissionProtocol = getSSHJobSubmissionProtocol(jobSubmissionProtocolDataId);
+				host.getType().changeType(SSHHostType.type);
+				//TODO fill the data
+				break;
+			case GRAM:
+				GlobusJobSubmission globusJobSubmissionProtocol = getGlobusJobSubmissionProtocol(jobSubmissionProtocolDataId);
+				host.getType().changeType(GlobusHostType.type);
+				//TODO fill the data
+				break;
+			case GSISSH:
+				GSISSHJobSubmission gsisshJobSubmissionProtocol = getGSISSHJobSubmissionProtocol(jobSubmissionProtocolDataId);
+				host.getType().changeType(GsisshHostType.type);
+				//TODO fill the data
+				break;
+			}
+		}
+		try {
+			getRegistry().addHostDescriptor(host);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+	
+	private String generateId(
+			String prefix) {
+		return prefix+"_"+Calendar.getInstance().getTimeInMillis();
+	}
+
+	@Override
+	public List<String> listComputeResourceDescriptions()
+			throws InvalidRequestException, AiravataClientException,
+			AiravataSystemException, TException {
+		try {
+			List<HostDescription> hostDescriptors = getRegistry().getHostDescriptors();
+			List<String> ids = new ArrayList<String>();
+			for (HostDescription hostDescription : hostDescriptors) {
+				ids.add(hostDescription.getType().getHostName());
+			}
+			return ids;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public ComputeResourceDescription getComputeResourceDescription(
+			String computeResourceId) throws InvalidRequestException,
+			AiravataClientException, AiravataSystemException, TException {
+		try {
+			HostDescription hostDescriptor = getRegistry().getHostDescriptor(computeResourceId);
+			ComputeResourceDescription d = new ComputeResourceDescription();
+			d.setResourceId(computeResourceId);
+			d.getIpAddresses().add(hostDescriptor.getType().getHostAddress());
+			if (hostDescriptor.getType() instanceof SSHHostType){
+				d.getJobSubmissionProtocols().put(computeResourceId, JobSubmissionProtocol.SSH);
+			} else if (hostDescriptor.getType() instanceof GsisshHostType){
+				d.getJobSubmissionProtocols().put(computeResourceId, JobSubmissionProtocol.GSISSH);
+			} else if (hostDescriptor.getType() instanceof GlobusHostType){
+				d.getJobSubmissionProtocols().put(computeResourceId, JobSubmissionProtocol.GRAM);
+			}
+			return d;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+		
+	}
+
+	@Override
+	public SSHJobSubmission getSSHJobSubmissionProtocol(
+			String sshJobSubmissionProtocolResourceId)
+			throws InvalidRequestException, AiravataClientException,
+			AiravataSystemException, TException {
+		try {
+			HostDescription hostDescriptor = getRegistry().getHostDescriptor(sshJobSubmissionProtocolResourceId);
+			SSHJobSubmission d = new SSHJobSubmission();
+			d.setJobSubmissionDataID(sshJobSubmissionProtocolResourceId);
+			if (hostDescriptor.getType() instanceof SSHHostType){
+				d.setSshPort(22);
+			} else { 
+				throw new Exception("Saved job protocol is not SSH");
+			}
+			return d;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public GSISSHJobSubmission getGSISSHJobSubmissionProtocol(
+			String gsisshJobSubmissionProtocolResourceId)
+			throws InvalidRequestException, AiravataClientException,
+			AiravataSystemException, TException {
+		try {
+			HostDescription hostDescriptor = getRegistry().getHostDescriptor(gsisshJobSubmissionProtocolResourceId);
+			GSISSHJobSubmission d = new GSISSHJobSubmission();
+			d.setJobSubmissionDataID(gsisshJobSubmissionProtocolResourceId);
+			if (hostDescriptor.getType() instanceof GsisshHostType){
+				GsisshHostType gsisshHostType = (GsisshHostType)hostDescriptor.getType();
+				d.setInstalledPath(gsisshHostType.getInstalledPath());
+				d.setMonitorMode(gsisshHostType.getMonitorMode());
+				d.setPostJobCommands(Arrays.asList(gsisshHostType.getPostJobCommandsArray()));
+				d.setPreJobCommands(Arrays.asList(gsisshHostType.getPreJobCommandsArray()));
+				d.setSshPort(gsisshHostType.getPort());
+			} else { 
+				throw new Exception("Saved job protocol is not GSISSH");
+			}
+			return d;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public GlobusJobSubmission getGlobusJobSubmissionProtocol(
+			String globusJobSubmissionProtocolResourceId)
+			throws InvalidRequestException, AiravataClientException,
+			AiravataSystemException, TException {
+		try {
+			HostDescription hostDescriptor = getRegistry().getHostDescriptor(globusJobSubmissionProtocolResourceId);
+			GlobusJobSubmission d = new GlobusJobSubmission();
+			d.setJobSubmissionDataID(globusJobSubmissionProtocolResourceId);
+			if (hostDescriptor.getType() instanceof GlobusHostType){
+				GlobusHostType globusHostType = (GlobusHostType)hostDescriptor.getType();
+				d.setGlobusGateKeeperEndPoint(Arrays.asList(globusHostType.getGlobusGateKeeperEndPointArray()));
+			} else { 
+				throw new Exception("Saved job protocol is not Globus");
+			}
+			return d;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public SCPDataMovement getSCPDataMovementProtocol(
+			String scpDataMovementResourceId) throws InvalidRequestException,
+			AiravataClientException, AiravataSystemException, TException {
+		try {
+			HostDescription hostDescriptor = getRegistry().getHostDescriptor(scpDataMovementResourceId);
+			SCPDataMovement d = new SCPDataMovement();
+			d.setDataSubmissionDataID(scpDataMovementResourceId);
+			if (hostDescriptor.getType() instanceof GlobusHostType){
+				GlobusHostType globusHostType = (GlobusHostType)hostDescriptor.getType();
+				d.setSshPort(22);
+			} else { 
+				throw new Exception("Saved job protocol is not GSISSH");
+			}
+			return d;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public boolean isComputeResourceDescriptionRegistered(String hostName)
+			throws InvalidRequestException, AiravataClientException,
+			AiravataSystemException, TException {
+		try {
+			return getRegistry().isHostDescriptorExists(hostName);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public ComputeResourceDescription getComputeResourceDescriptionFromHostName(
+			String hostName) throws InvalidRequestException,
+			AiravataClientException, AiravataSystemException, TException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void addApplicationInterface(
+			ApplicationInterface applicationInterface)
+			throws InvalidRequestException, AiravataClientException,
+			AiravataSystemException, TException {
+		try {
+			ServiceDescription serviceDescription = ServiceDescription.fromXML(applicationInterface.getApplicationInterfaceData());
+			getRegistry().addServiceDescriptor(serviceDescription);
+			List<ApplicationDeployment> applicationDeployments = applicationInterface.getApplicationDeployments();
+			for (ApplicationDeployment deployment : applicationDeployments) {
+				String hostId = deployment.getComputeResourceDescription().getResourceId();
+				ApplicationDescriptor applicationDescriptor = deployment.getApplicationDescriptor();
+				getRegistry().addApplicationDescriptor(serviceDescription.getType().getName(), hostId, ApplicationDescription.fromXML(applicationDescriptor.getApplicationDescriptorData()));
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+		
+	}
+
+	@Override
+	public List<String> listApplicationInterfaceIds()
+			throws InvalidRequestException, AiravataClientException,
+			AiravataSystemException, TException {
+		try {
+			List<String> ids=new ArrayList<String>();
+			List<ServiceDescription> serviceDescriptors = getRegistry().getServiceDescriptors();
+			for (ServiceDescription serviceDescription : serviceDescriptors) {
+				ids.add(serviceDescription.getType().getName());
+			}
+			return ids;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public ApplicationInterface getApplicationInterface(
+			String applicationInterfaceId) throws InvalidRequestException,
+			AiravataClientException, AiravataSystemException, TException {
+		try {
+			ServiceDescription serviceDescriptor = getRegistry().getServiceDescriptor(applicationInterfaceId);
+			ApplicationInterface applicationInterface = new ApplicationInterface();
+			applicationInterface.setApplicationInterfaceId(applicationInterfaceId);
+			applicationInterface.setApplicationInterfaceData(serviceDescriptor.toXML());
+			Map<String, ApplicationDescription> applicationDescriptors = getRegistry().getApplicationDescriptors(applicationInterfaceId);
+			for (String hostId : applicationDescriptors.keySet()) {
+				ApplicationDeployment applicationDeployment = new ApplicationDeployment();
+				applicationDeployment.setComputeResourceDescription(getComputeResourceDescription(hostId));
+				ApplicationDescriptor applicationDescriptor = new ApplicationDescriptor();
+				applicationDescriptor.setApplicationDescriptorId(applicationDescriptors.get(hostId).getType().getApplicationName().getStringValue());
+				applicationDescriptor.setApplicationDescriptorData(applicationDescriptors.get(hostId).toXML());
+				applicationDeployment.setApplicationDescriptor(applicationDescriptor);
+				applicationInterface.addToApplicationDeployments(applicationDeployment);
+			}
+			return applicationInterface;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public void addApplicationDeployment(String applicationInterfaceId,
+			ApplicationDeployment applicationDeployment)
+			throws InvalidRequestException, AiravataClientException,
+			AiravataSystemException, TException {
+		try {
+			getRegistry().addApplicationDescriptor(applicationInterfaceId, applicationDeployment.getComputeResourceDescription().getResourceId(), ApplicationDescription.fromXML(applicationDeployment.getApplicationDescriptor().getApplicationDescriptorData()));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public List<String> listApplicationDeploymentIds(String applicationInterfaceId)
+			throws InvalidRequestException, AiravataClientException,
+			AiravataSystemException, TException {
+		try {
+			List<String> ids=new ArrayList<String>();
+			Map<String, ApplicationDescription> applicationDescriptors = getRegistry().getApplicationDescriptors(applicationInterfaceId);
+			for (String hostId : applicationDescriptors.keySet()) {
+				ids.add(applicationDescriptors.get(hostId).getType().getApplicationName().getStringValue());
+			}
+			return ids;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public ApplicationDeployment getApplicationDeployment(String applicationInterfaceId, 
+			String applicationDeploymentId) throws InvalidRequestException,
+			AiravataClientException, AiravataSystemException, TException {
+		try {
+			Map<String, ApplicationDescription> applicationDescriptors = getRegistry().getApplicationDescriptors(applicationInterfaceId);
+			for (String hostId : applicationDescriptors.keySet()) {
+				if (applicationDescriptors.get(hostId).getType().getApplicationName().getStringValue().equals(applicationDeploymentId)){
+					ApplicationDeployment applicationDeployment = new ApplicationDeployment();
+					applicationDeployment.setDeploymentId(applicationDescriptors.get(hostId).getType().getApplicationName().getStringValue());
+					ApplicationDescriptor applicationDescriptor=new ApplicationDescriptor();
+					applicationDescriptor.setApplicationDescriptorId(applicationDescriptors.get(hostId).getType().getApplicationName().getStringValue());
+					applicationDescriptor.setApplicationDescriptorData(applicationDescriptors.get(hostId).toXML());
+					applicationDeployment.setApplicationDescriptor(applicationDescriptor);
+					applicationDeployment.setComputeResourceDescription(getComputeResourceDescription(hostId));
+					return applicationDeployment;
+				}
+			}
+			return null;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public void addSSHJobSubmissionProtocol(String computeResourceId,
+			SSHJobSubmission jobSubmission) throws InvalidRequestException,
+			AiravataClientException, AiravataSystemException, TException {
+		try {
+			HostDescription hostDescriptor = getRegistry().getHostDescriptor(computeResourceId);
+			hostDescriptor.getType().changeType(SSHHostType.type);
+			SSHHostType s = (SSHHostType)hostDescriptor.getType();
+			getRegistry().updateHostDescriptor(hostDescriptor);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+		
+	}
+
+	@Override
+	public void addGSISSHJobSubmissionProtocol(String computeResourceId,
+			GSISSHJobSubmission jobSubmission) throws InvalidRequestException,
+			AiravataClientException, AiravataSystemException, TException {
+		try {
+			HostDescription hostDescriptor = getRegistry().getHostDescriptor(computeResourceId);
+			hostDescriptor.getType().changeType(GsisshHostType.type);
+			GsisshHostType s = (GsisshHostType)hostDescriptor.getType();
+			s.setInstalledPath(jobSubmission.getInstalledPath());
+			ExportProperties exports = s.addNewExports();
+			for(String export: jobSubmission.getExports()){
+				exports.addNewName().setValue(export);
+			}
+			s.setExports(exports);
+			s.setJobManager(jobSubmission.getResourceJobManager().toString());
+			s.setMonitorMode(jobSubmission.getMonitorMode());
+			s.setPort(22);
+			s.setPostJobCommandsArray(jobSubmission.getPostJobCommands().toArray(new String[]{}));
+			s.setPreJobCommandsArray(jobSubmission.getPreJobCommands().toArray(new String[]{}));
+			getRegistry().updateHostDescriptor(hostDescriptor);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public void addGlobusJobSubmissionProtocol(String computeResourceId,
+			GlobusJobSubmission jobSubmission) throws InvalidRequestException,
+			AiravataClientException, AiravataSystemException, TException {
+		try {
+			HostDescription hostDescriptor = getRegistry().getHostDescriptor(computeResourceId);
+			hostDescriptor.getType().changeType(GlobusHostType.type);
+			GlobusHostType s = (GlobusHostType)hostDescriptor.getType();
+			s.setGlobusGateKeeperEndPointArray(jobSubmission.getGlobusGateKeeperEndPoint().toArray(new String[]{}));
+			getRegistry().updateHostDescriptor(hostDescriptor);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+	}
+
+	@Override
+	public void addSCPDataMovementProtocol(String computeResourceId,
+			SCPDataMovement dataMovement) throws InvalidRequestException,
+			AiravataClientException, AiravataSystemException, TException {
+		try {
+			HostDescription hostDescriptor = getRegistry().getHostDescriptor(computeResourceId);
+			hostDescriptor.getType().changeType(GlobusHostType.type);
+			GlobusHostType s = (GlobusHostType)hostDescriptor.getType();
+			s.setGlobusGateKeeperEndPointArray(jobSubmission.getGlobusGateKeeperEndPoint().toArray(new String[]{}));
+			getRegistry().updateHostDescriptor(hostDescriptor);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AiravataSystemException();
+		}
+		
+	}
+	
+	
+	
+	
+
+}


[3/3] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata

Posted by sa...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata


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

Branch: refs/heads/master
Commit: 029cfac4077edb65f2ea4dc122d86af201bdb5f0
Parents: e25c541 2710f6e
Author: Saminda Wijeratne <sa...@gmail.com>
Authored: Tue May 20 22:41:17 2014 -0700
Committer: Saminda Wijeratne <sa...@gmail.com>
Committed: Tue May 20 22:41:17 2014 -0700

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   | 210 ++++++++++++++++---
 .../client/samples/CreateLaunchExperiment.java  |  24 ++-
 .../main/resources/airavata-server.properties   |   2 +-
 .../server/src/main/resources/log4j.properties  |   2 +-
 .../apache/airavata/gfac/GFacConfiguration.java |   2 +-
 .../core/handler/AppDescriptorCheckHandler.java |   4 +-
 .../airavata/gfac/core/handler/GFacHandler.java |  23 +-
 .../gfac/core/handler/GFacHandlerConfig.java    |   9 +-
 .../apache/airavata/job/TestGlobalHandler.java  |   4 +-
 .../org/apache/airavata/job/TestInHandler.java  |   4 +-
 .../org/apache/airavata/job/TestOutHandler.java |   4 +-
 .../airavata/job/TestThreadedHandler.java       |   4 +-
 .../gram/handler/GramDirectorySetupHandler.java |   4 +-
 .../gfac/gram/handler/GridFTPInputHandler.java  |   8 +-
 .../gfac/gram/handler/GridFTPOutputHandler.java |   9 +-
 .../handler/GSISSHDirectorySetupHandler.java    |   4 +-
 .../gfac/gsissh/handler/GSISSHInputHandler.java |   2 +-
 .../gsissh/handler/GSISSHOutputHandler.java     |   7 +-
 .../hadoop/handler/HDFSDataMovementHandler.java |   4 +-
 .../hadoop/handler/HadoopDeploymentHandler.java |   2 +-
 .../handler/LocalDirectorySetupHandler.java     |   4 +-
 .../handlers/GridPullMonitorHandler.java        |   4 +-
 .../ssh/handler/AdvancedSCPInputHandler.java    |  16 +-
 .../ssh/handler/AdvancedSCPOutputHandler.java   |  18 +-
 .../ssh/handler/SSHDirectorySetupHandler.java   |   4 +-
 .../gfac/ssh/handler/SSHInputHandler.java       |   8 +-
 .../gfac/ssh/handler/SSHOutputHandler.java      |   9 +-
 .../server/OrchestratorServerHandler.java       |  14 +-
 .../impl/ExperimentStatusValidator.java         |  45 ++++
 29 files changed, 337 insertions(+), 117 deletions(-)
----------------------------------------------------------------------