You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2012/10/29 14:55:19 UTC
svn commit: r1403295 - in /airavata/sandbox/airavata-registry-rest: ./
src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/
src/main/java/org/apache/airavata/services/registry/rest/resources/
src/main/java/org/apache/airavata/serv...
Author: chathuri
Date: Mon Oct 29 13:55:19 2012
New Revision: 1403295
URL: http://svn.apache.org/viewvc?rev=1403295&view=rev
Log:
committing new descriptor classes
Added:
airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/WorkflowNodeIODataMapping.java
airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/ApplicationDescriptorTypes.java
airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/HostTypes.java
Modified:
airavata/sandbox/airavata-registry-rest/README.txt
airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/ApplicationDescriptor.java
airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/ServiceDescriptor.java
airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/WorkflowNodeIODataList.java
airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryResource.java
Modified: airavata/sandbox/airavata-registry-rest/README.txt
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/README.txt?rev=1403295&r1=1403294&r2=1403295&view=diff
==============================================================================
--- airavata/sandbox/airavata-registry-rest/README.txt (original)
+++ airavata/sandbox/airavata-registry-rest/README.txt Mon Oct 29 13:55:19 2012
@@ -37,26 +37,25 @@ To test
############## Host descriptrors ##########################
curl --request GET http://localhost:9080/airavata-services/registry/api/hostdescriptor/exist?descriptorName=ember
- curl -H "Accept: text/plain" -X POST -d 'host=<type:hostDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:hostName>testHost1</type:hostName><type:hostAddress>aaaa</type:hostAddress></type:hostDescription>' http://localhost:9080/airavata-services/registry/api/hostdescriptor/save
- curl -H "Accept: text/plain" -X POST -d 'host=<type:hostDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:hostName>testHost1</type:hostName><type:hostAddress>aaaabbbbbbb</type:hostAddress></type:hostDescription>' http://localhost:9080/airavata-services/registry/api/hostdescriptor/update
- curl --request GET http://localhost:9080/airavata-services/registry/api/host/description?hostName=testHost1
+ curl -H "Accept: text/plain" -X POST -H "Content-Type: text/xml" -d '<type:hostDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:hostName>LocalHost111</type:hostName><type:hostAddress>127.0.0.1</type:hostAddress></type:hostDescription>' http://localhost:9080/airavata-services/registry/api/hostdescriptor/save
+ curl -H "Accept: text/plain" -X POST -H "Content-Type: text/xml" -d '<type:hostDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:hostName>aaaaa</type:hostName><type:hostAddress>dsdddssdd</type:hostAddress></type:hostDescription>' http://localhost:9080/airavata-services/registry/api/hostdescriptor/update curl --request GET http://localhost:9080/airavata-services/registry/api/host/description?hostName=testHost1
curl --request DELETE http://localhost:9080/airavata-services/registry/api/hostdescriptor/delete?hostName=testHost1
curl --request GET http://localhost:9080/airavata-services/registry/api/get/hostdescriptors
############## Service descriptrors ##########################
curl --request GET http://localhost:9080/airavata-services/registry/api/servicedescriptor/exist?descriptorName=echo
- curl -H "Accept: text/plain" -X POST -d 'service=<type:serviceDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:name>echo1</type:name><type:inputParameters><type:parameterName>echo1_input</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:inputParameters><type:outputParameters><type:parameterName>echo1_output</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:outputParameters></type:serviceDescription>' http://localhost:9080/airavata-services/registry/api/servicedescriptor/save
- curl -H "Accept: text/plain" -X POST -d 'service=<type:serviceDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:name>echo1</type:name><type:inputParameters><type:parameterName>echo11_input</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:inputParameters><type:outputParameters><type:parameterName>echo11_output</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:outputParameters></type:serviceDescription>' http://localhost:9080/airavata-services/registry/api/servicedescriptor/update
+ curl -H "Accept: text/plain" -X POST -H "Content-Type: text/xml" -d '<type:serviceDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:name>echo1</type:name><type:inputParameters><type:parameterName>echo1_input</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:inputParameters><type:outputParameters><type:parameterName>echo1_output</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:outputParameters></type:serviceDescription>' http://localhost:9080/airavata-services/registry/api/servicedescriptor/save
+ curl -H "Accept: text/plain" -X POST -H "Content-Type: text/xml" -d '<type:serviceDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:name>echo1</type:name><type:inputParameters><type:parameterName>echo11_input</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:inputParameters><type:outputParameters><type:parameterName>echo11_output</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:outputParameters></type:serviceDescription>' http://localhost:9080/airavata-services/registry/api/servicedescriptor/update
curl --request GET http://localhost:9080/airavata-services/registry/api/servicedescriptor/description?serviceName=echo1
curl --request DELETE http://localhost:9080/airavata-services/registry/api/servicedescriptor/delete?serviceName=echo1
curl --request GET http://localhost:9080/airavata-services/registry/api/get/servicedescriptors
############## Application descriptrors ##########################
curl --request GET 'http://localhost:9080/airavata-services/registry/api/applicationdescriptor/exist?serviceName=echo&hostName=LocalHost&descriptorName=LocalHost_application'
- curl -H "Accept: text/plain" -X POST -d 'service=<type:serviceDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:name>echo</type:name><type:inputParameters><type:parameterName>echo_input</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:inputParameters><type:outputParameters><type:parameterName>echo_output</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:outputParameters></type:serviceDescription>&host=<type:hostDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:hostName>LocalHost</type:hostName><type:hostAddress>127.0.0.1</type:hostAddress></type:hostDescription>&application=<type:applicationDeploymentDescription xmlns:type="http
://schemas.airavata.apache.org/gfac/type"><type:applicationName>LocalHost_application1</type:applicationName><type:executableLocation>/Users/chathuri/airavata/source/trunk_new/samples/echo.sh</type:executableLocation><type:scratchWorkingDirectory>/tmp1</type:scratchWorkingDirectory></type:applicationDeploymentDescription>' http://localhost:9080/airavata-services/registry/api/applicationdescriptor/build/save
- curl -H "Accept: text/plain" -X POST -d 'serviceName=echo&hostName=LocalHost&application=<type:applicationDeploymentDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:applicationName>LocalHost_application2</type:applicationName><type:executableLocation>/Users/chathuri/airavata/source/trunk_new/samples/echo.sh</type:executableLocation><type:scratchWorkingDirectory>/tmp1</type:scratchWorkingDirectory></type:applicationDeploymentDescription>' http://localhost:9080/airavata-services/registry/api/applicationdescriptor/save
- curl -H "Accept: text/plain" -X POST -d 'service=<type:serviceDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:name>echo</type:name><type:inputParameters><type:parameterName>echo_input</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:inputParameters><type:outputParameters><type:parameterName>echo_output</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:outputParameters></type:serviceDescription>&host=<type:hostDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:hostName>LocalHost</type:hostName><type:hostAddress>127.0.0.1</type:hostAddress></type:hostDescription>&application=<type:applicationDeploymentDescription xmlns:type="http
://schemas.airavata.apache.org/gfac/type"><type:applicationName>LocalHost_application2</type:applicationName><type:executableLocation>xccccccccxc</type:executableLocation><type:scratchWorkingDirectory>/sdddsdsds</type:scratchWorkingDirectory></type:applicationDeploymentDescription>' http://localhost:9080/airavata-services/registry/api/applicationdescriptor/update/descriptor
- curl -H "Accept: text/plain" -X POST -d 'serviceName=echo&hostName=LocalHost&application=<type:applicationDeploymentDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:applicationName>LocalHost_application2</type:applicationName><type:executableLocation>xccccccccxc11111</type:executableLocation><type:scratchWorkingDirectory>/sdddsdsds1111</type:scratchWorkingDirectory></type:applicationDeploymentDescription>' http://localhost:9080/airavata-services/registry/api/applicationdescriptor/update
+ curl -H "Accept: text/plain" -X POST -H "Content-Type: text/xml" -d '<type:serviceDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:name>echo</type:name><type:inputParameters><type:parameterName>echo_input</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:inputParameters><type:outputParameters><type:parameterName>echo_output</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:outputParameters></type:serviceDescription>&host=<type:hostDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:hostName>LocalHost</type:hostName><type:hostAddress>127.0.0.1</type:hostAddress></type:hostDescription>&application=<type:applicationDeploymentDescript
ion xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:applicationName>LocalHost_application1</type:applicationName><type:executableLocation>/Users/chathuri/airavata/source/trunk_new/samples/echo.sh</type:executableLocation><type:scratchWorkingDirectory>/tmp1</type:scratchWorkingDirectory></type:applicationDeploymentDescription>' http://localhost:9080/airavata-services/registry/api/applicationdescriptor/build/save
+ curl -H "Accept: text/plain" -X POST -H "Content-Type: text/xml" -d 'serviceName=echo&hostName=LocalHost&<type:applicationDeploymentDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:applicationName>LocalHost_application2</type:applicationName><type:executableLocation>/Users/chathuri/airavata/source/trunk_new/samples/echo.sh</type:executableLocation><type:scratchWorkingDirectory>/tmp1</type:scratchWorkingDirectory></type:applicationDeploymentDescription>' http://localhost:9080/airavata-services/registry/api/applicationdescriptor/save
+ curl -H "Accept: text/plain" -X POST -H "Content-Type: text/xml" -d 'service=<type:serviceDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:name>echo</type:name><type:inputParameters><type:parameterName>echo_input</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:inputParameters><type:outputParameters><type:parameterName>echo_output</type:parameterName><type:parameterDescription xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><type:parameterType type="String"><name>String</name></type:parameterType></type:outputParameters></type:serviceDescription>&host=<type:hostDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:hostName>LocalHost</type:hostName><type:hostAddress>127.0.0.1</type:hostAddress></type:hostDescription>&application=<type:applicationDeployment
Description xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:applicationName>LocalHost_application2</type:applicationName><type:executableLocation>xccccccccxc</type:executableLocation><type:scratchWorkingDirectory>/sdddsdsds</type:scratchWorkingDirectory></type:applicationDeploymentDescription>' http://localhost:9080/airavata-services/registry/api/applicationdescriptor/update/descriptor
+ curl -H "Accept: text/plain" -X POST -H "Content-Type: text/xml" -d 'serviceName=echo&hostName=LocalHost&application=<type:applicationDeploymentDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:applicationName>LocalHost_application2</type:applicationName><type:executableLocation>xccccccccxc11111</type:executableLocation><type:scratchWorkingDirectory>/sdddsdsds1111</type:scratchWorkingDirectory></type:applicationDeploymentDescription>' http://localhost:9080/airavata-services/registry/api/applicationdescriptor/update
curl --request GET 'http://localhost:9080/airavata-services/registry/api/applicationdescriptor/description?serviceName=echo&hostName=LocalHost&applicationName=LocalHost_application2'
curl --request GET 'http://localhost:9080/airavata-services/registry/api/applicationdescriptors/alldescriptors/host/service?serviceName=echo&hostName=LocalHost'
curl --request GET 'http://localhost:9080/airavata-services/registry/api/applicationdescriptor/alldescriptors/service?serviceName=echo'
@@ -96,6 +95,7 @@ To test
curl -H "Accept: text/plain" -X POST -d 'instanceId=testWFInstanceID&executionStatus=FINISHED' http://localhost:9080/airavata-services/registry/api/update/workflowinstancestatus/instanceid
curl -H "Accept: text/plain" -X POST -d 'experimentId=testWFInstanceID&workflowInstanceId=testWFInstanceID&executionStatus=STARTED&statusUpdateTime=2012-10-23 00:00:00' http://localhost:9080/airavata-services/registry/api/update/workflowinstancestatus/experimentid
curl --request GET 'http://localhost:9080/airavata-services/registry/api/get/workflowinstancestatus?instanceId=testWFInstanceID'
+ curl -H "Accept: text/plain" -X POST -d 'experimentID=ff7338c9-f9ad-4d86-b486-1e8e9c3a9cc4&nodeID=TempConvertSoap_FahrenheitToCelsius&workflowInstanceId=ff7338c9-f9ad-4d86-b486-1e8e9c3a9cc4&data=testInputdata' http://localhost:9080/airavata-services/registry/api/update/workflownodeinput
********* Sample JSON message for Application and service *****************
Modified: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/ApplicationDescriptor.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/ApplicationDescriptor.java?rev=1403295&r1=1403294&r2=1403295&view=diff
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/ApplicationDescriptor.java (original)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/ApplicationDescriptor.java Mon Oct 29 13:55:19 2012
@@ -39,91 +39,126 @@ public class ApplicationDescriptor {
private int processorsPerNode;
private int minMemory;
private int maxMemory;
+ private String applicationDescType;
- public String getApplicationName() {
- return applicationName;
- }
- public void setApplicationName(String applicationName) {
- this.applicationName = applicationName;
- }
- public String getHostdescName() {
- return hostdescName;
- }
- public void setHostdescName(String hostdescName) {
- this.hostdescName = hostdescName;
- }
- public ServiceDescriptor getServiceDesc() {
- return serviceDesc;
- }
- public void setServiceDesc(ServiceDescriptor serviceDesc) {
- this.serviceDesc = serviceDesc;
- }
- public String getExecutablePath() {
- return executablePath;
- }
- public void setExecutablePath(String executablePath) {
- this.executablePath = executablePath;
- }
- public String getWorkingDir() {
- return workingDir;
- }
- public void setWorkingDir(String workingDir) {
- this.workingDir = workingDir;
- }
- public String getJobType() {
- return jobType;
- }
- public void setJobType(String jobType) {
- this.jobType = jobType;
- }
- public String getProjectNumber() {
- return projectNumber;
- }
- public void setProjectNumber(String projectNumber) {
- this.projectNumber = projectNumber;
- }
- public String getQueueName() {
- return queueName;
- }
- public void setQueueName(String queueName) {
- this.queueName = queueName;
- }
- public int getMaxWallTime() {
- return maxWallTime;
- }
- public void setMaxWallTime(int maxWallTime) {
- this.maxWallTime = maxWallTime;
- }
- public int getCpuCount() {
- return cpuCount;
- }
- public void setCpuCount(int cpuCount) {
- this.cpuCount = cpuCount;
- }
- public int getNodeCount() {
- return nodeCount;
- }
- public void setNodeCount(int nodeCount) {
- this.nodeCount = nodeCount;
- }
- public int getProcessorsPerNode() {
- return processorsPerNode;
- }
- public void setProcessorsPerNode(int processorsPerNode) {
- this.processorsPerNode = processorsPerNode;
- }
- public int getMinMemory() {
- return minMemory;
- }
- public void setMinMemory(int minMemory) {
- this.minMemory = minMemory;
- }
- public int getMaxMemory() {
- return maxMemory;
- }
- public void setMaxMemory(int maxMemory) {
- this.maxMemory = maxMemory;
- }
+ public String getApplicationName() {
+ return applicationName;
+ }
+ public void setApplicationName(String applicationName) {
+ this.applicationName = applicationName;
+ }
+
+ public String getHostdescName() {
+ return hostdescName;
+ }
+
+ public void setHostdescName(String hostdescName) {
+ this.hostdescName = hostdescName;
+ }
+
+ public ServiceDescriptor getServiceDesc() {
+ return serviceDesc;
+ }
+
+ public void setServiceDesc(ServiceDescriptor serviceDesc) {
+ this.serviceDesc = serviceDesc;
+ }
+
+ public String getExecutablePath() {
+ return executablePath;
+ }
+
+ public void setExecutablePath(String executablePath) {
+ this.executablePath = executablePath;
+ }
+
+ public String getWorkingDir() {
+ return workingDir;
+ }
+
+ public void setWorkingDir(String workingDir) {
+ this.workingDir = workingDir;
+ }
+
+ public String getJobType() {
+ return jobType;
+ }
+
+ public void setJobType(String jobType) {
+ this.jobType = jobType;
+ }
+
+ public String getProjectNumber() {
+ return projectNumber;
+ }
+
+ public void setProjectNumber(String projectNumber) {
+ this.projectNumber = projectNumber;
+ }
+
+ public String getQueueName() {
+ return queueName;
+ }
+
+ public void setQueueName(String queueName) {
+ this.queueName = queueName;
+ }
+
+ public int getMaxWallTime() {
+ return maxWallTime;
+ }
+
+ public void setMaxWallTime(int maxWallTime) {
+ this.maxWallTime = maxWallTime;
+ }
+
+ public int getCpuCount() {
+ return cpuCount;
+ }
+
+ public void setCpuCount(int cpuCount) {
+ this.cpuCount = cpuCount;
+ }
+
+ public int getNodeCount() {
+ return nodeCount;
+ }
+
+ public void setNodeCount(int nodeCount) {
+ this.nodeCount = nodeCount;
+ }
+
+ public int getProcessorsPerNode() {
+ return processorsPerNode;
+ }
+
+ public void setProcessorsPerNode(int processorsPerNode) {
+ this.processorsPerNode = processorsPerNode;
+ }
+
+ public int getMinMemory() {
+ return minMemory;
+ }
+
+ public void setMinMemory(int minMemory) {
+ this.minMemory = minMemory;
+ }
+
+ public int getMaxMemory() {
+ return maxMemory;
+ }
+
+ public void setMaxMemory(int maxMemory) {
+ this.maxMemory = maxMemory;
+ }
+
+ public String getApplicationDescType() {
+ return applicationDescType;
+ }
+
+ public void setApplicationDescType(String applicationDescType) {
+ this.applicationDescType = applicationDescType;
+ }
}
Modified: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/ServiceDescriptor.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/ServiceDescriptor.java?rev=1403295&r1=1403294&r2=1403295&view=diff
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/ServiceDescriptor.java (original)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/ServiceDescriptor.java Mon Oct 29 13:55:19 2012
@@ -28,27 +28,40 @@ import javax.xml.bind.annotation.XmlRoot
@XmlRootElement(name = "service")
public class ServiceDescriptor {
- private String serviceDocument;
+ private String serviceName;
+ private String description;
private List<ServiceParameters> inputParams;
private List<ServiceParameters> outputParams;
- public String getServiceDocument() {
- return serviceDocument;
- }
- public void setServiceDocument(String serviceDocument) {
- this.serviceDocument = serviceDocument;
- }
- public List<ServiceParameters> getInputParams() {
- return inputParams;
- }
- public void setInputParams(List<ServiceParameters> inputParams) {
- this.inputParams = inputParams;
- }
- public List<ServiceParameters> getOutputParams() {
- return outputParams;
- }
- public void setOutputParams(List<ServiceParameters> outputParams) {
- this.outputParams = outputParams;
- }
+ public String getServiceName() {
+ return serviceName;
+ }
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
+
+ public List<ServiceParameters> getInputParams() {
+ return inputParams;
+ }
+
+ public void setInputParams(List<ServiceParameters> inputParams) {
+ this.inputParams = inputParams;
+ }
+
+ public List<ServiceParameters> getOutputParams() {
+ return outputParams;
+ }
+
+ public void setOutputParams(List<ServiceParameters> outputParams) {
+ this.outputParams = outputParams;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
}
Modified: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/WorkflowNodeIODataList.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/WorkflowNodeIODataList.java?rev=1403295&r1=1403294&r2=1403295&view=diff
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/WorkflowNodeIODataList.java (original)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/WorkflowNodeIODataList.java Mon Oct 29 13:55:19 2012
@@ -1,19 +1,18 @@
package org.apache.airavata.services.registry.rest.resourcemappings;
-import org.apache.airavata.registry.api.workflow.WorkflowNodeIOData;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class WorkflowNodeIODataList {
- WorkflowNodeIOData[] workflowNodeIODatas = null;
+ WorkflowNodeIODataMapping[] workflowNodeIODataMappings = null;
- public WorkflowNodeIOData[] getWorkflowNodeIODatas() {
- return workflowNodeIODatas;
+ public WorkflowNodeIODataMapping[] getWorkflowNodeIODataMappings() {
+ return workflowNodeIODataMappings;
}
- public void setWorkflowNodeIODatas(WorkflowNodeIOData[] workflowNodeIODatas) {
- this.workflowNodeIODatas = workflowNodeIODatas;
+ public void setWorkflowNodeIODataMappings(WorkflowNodeIODataMapping[] workflowNodeIODataMappings) {
+ this.workflowNodeIODataMappings = workflowNodeIODataMappings;
}
}
Added: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/WorkflowNodeIODataMapping.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/WorkflowNodeIODataMapping.java?rev=1403295&view=auto
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/WorkflowNodeIODataMapping.java (added)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resourcemappings/WorkflowNodeIODataMapping.java Mon Oct 29 13:55:19 2012
@@ -0,0 +1,77 @@
+/*
+ *
+ * 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.services.registry.rest.resourcemappings;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class WorkflowNodeIODataMapping {
+ private String experimentId;
+ private String workflowName;
+ private String workflowId;
+ private String workflowInstanceId;
+ private String workflowNodeType;
+
+ public WorkflowNodeIODataMapping() {
+ }
+
+ public String getExperimentId() {
+ return experimentId;
+ }
+
+ public String getWorkflowName() {
+ return workflowName;
+ }
+
+ public String getWorkflowId() {
+ return workflowId;
+ }
+
+ public String getWorkflowInstanceId() {
+ return workflowInstanceId;
+ }
+
+ public void setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
+ }
+
+ public void setWorkflowName(String workflowName) {
+ this.workflowName = workflowName;
+ }
+
+ public void setWorkflowId(String workflowId) {
+ this.workflowId = workflowId;
+ }
+
+ public void setWorkflowInstanceId(String workflowInstanceId) {
+ this.workflowInstanceId = workflowInstanceId;
+ }
+
+ public String getWorkflowNodeType() {
+ return workflowNodeType;
+ }
+
+ public void setWorkflowNodeType(String workflowNodeType) {
+ this.workflowNodeType = workflowNodeType;
+ }
+}
+
Modified: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryResource.java?rev=1403295&r1=1403294&r2=1403295&view=diff
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryResource.java (original)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryResource.java Mon Oct 29 13:55:19 2012
@@ -9,10 +9,15 @@ import org.apache.airavata.registry.api.
import org.apache.airavata.registry.api.exception.gateway.*;
import org.apache.airavata.registry.api.exception.worker.*;
import org.apache.airavata.registry.api.workflow.*;
+import org.apache.airavata.schemas.gfac.*;
+import org.apache.airavata.schemas.gfac.impl.InputParameterTypeImpl;
import org.apache.airavata.services.registry.rest.resourcemappings.*;
import org.apache.airavata.registry.api.AiravataExperiment;
import org.apache.airavata.services.registry.rest.resourcemappings.WorkflowInstanceMapping;
+import org.apache.airavata.services.registry.rest.utils.HostTypes;
import org.apache.airavata.services.registry.rest.utils.RestServicesConstants;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
import org.apache.xmlbeans.XmlException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -22,13 +27,12 @@ import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import javax.xml.stream.XMLStreamException;
import java.net.URI;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
/**
@@ -536,21 +540,29 @@ import java.util.Map;
@POST
@Path("hostdescriptor/save")
- @Consumes(MediaType.TEXT_XML)
- @Produces(MediaType.TEXT_PLAIN)
- public Response addHostDescriptor(String host) {
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+ public Response addHostDescriptor(HostDescriptor host) {
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
- HostDescription hostDescription = HostDescription.fromXML(host);
+ HostDescription hostDescription = new HostDescription();
+ hostDescription.getType().setHostAddress(host.getHostAddress());
+ hostDescription.getType().setHostName(host.getHostname());
+ if(host.getHostType().equals(HostTypes.GLOBUS_HOST_TYPE)){
+ ((GlobusHostType)hostDescription.getType()).addGlobusGateKeeperEndPoint(host.getGlobusGateKeeperEndPoint().get(0));
+ ((GlobusHostType)hostDescription.getType()).addGridFTPEndPoint(host.getGridFTPEndPoint().get(0));
+ }else if (host.getHostType().equals(HostTypes.GSISSH_HOST_TYPE)){
+ ((GsisshHostType)hostDescription).addGridFTPEndPoint(host.getGridFTPEndPoint().get(0));
+ } else if (host.getHostType().equals(HostTypes.EC2_HOST_TYPE)){
+ ((Ec2HostType)hostDescription).addImageID(host.getImageID().get(0));
+ ((Ec2HostType)hostDescription).addInstanceID(host.getInstanceID().get(0));
+ }
airavataRegistry.addHostDescriptor(hostDescription);
Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
return builder.build();
} catch (DescriptorAlreadyExistsException e){
Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
return builder.build();
- } catch (XmlException e) {
- Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
- return builder.build();
} catch (RegistryException e) {
Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
return builder.build();
@@ -559,18 +571,26 @@ import java.util.Map;
@POST
@Path("hostdescriptor/update")
- @Consumes(MediaType.TEXT_XML)
- @Produces(MediaType.TEXT_PLAIN)
- public Response updateHostDescriptor(String host) {
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+ public Response updateHostDescriptor(HostDescriptor host) {
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
- HostDescription hostDescription = HostDescription.fromXML(host);
+ HostDescription hostDescription = new HostDescription();
+ hostDescription.getType().setHostAddress(host.getHostAddress());
+ hostDescription.getType().setHostName(host.getHostname());
+ if(host.getHostType().equals(HostTypes.GLOBUS_HOST_TYPE)){
+ ((GlobusHostType)hostDescription.getType()).addGlobusGateKeeperEndPoint(host.getGlobusGateKeeperEndPoint().get(0));
+ ((GlobusHostType)hostDescription.getType()).addGridFTPEndPoint(host.getGridFTPEndPoint().get(0));
+ }else if (host.getHostType().equals(HostTypes.GSISSH_HOST_TYPE)){
+ ((GsisshHostType)hostDescription).addGridFTPEndPoint(host.getGridFTPEndPoint().get(0));
+ } else if (host.getHostType().equals(HostTypes.EC2_HOST_TYPE)){
+ ((Ec2HostType)hostDescription).addImageID(host.getImageID().get(0));
+ ((Ec2HostType)hostDescription).addInstanceID(host.getInstanceID().get(0));
+ }
airavataRegistry.updateHostDescriptor(hostDescription);
Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
return builder.build();
- }catch (XmlException e) {
- Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
- return builder.build();
} catch (DescriptorDoesNotExistsException e) {
Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
return builder.build();
@@ -582,14 +602,68 @@ import java.util.Map;
@GET
@Path("host/description")
- @Produces("text/xml")
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response getHostDescriptor(@QueryParam("hostName") String hostName) {
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
- String result = airavataRegistry.getHostDescriptor(hostName).toXML();
- if (result != null) {
+ List<String> hostType = new ArrayList<String>();
+ List<String> gridFTPEndPoint = new ArrayList<String>();
+ List<String> globusGateKeeperEndPoint = new ArrayList<String>();
+ List<String> imageID = new ArrayList<String>();
+ List<String> instanceID = new ArrayList<String>();
+
+ HostDescription hostDescription = airavataRegistry.getHostDescriptor(hostName);
+ HostDescriptor hostDescriptor = new HostDescriptor();
+ hostDescriptor.setHostname(hostDescription.getType().getHostName());
+ hostDescriptor.setHostAddress(hostDescription.getType().getHostAddress());
+
+ HostDescriptionType hostDescriptionType = hostDescription.getType();
+ if (hostDescriptionType instanceof GlobusHostType){
+ GlobusHostType globusHostType = (GlobusHostType) hostDescriptionType;
+ hostType.add(HostTypes.GLOBUS_HOST_TYPE);
+ String[] globusGateKeeperEndPointArray = globusHostType.getGlobusGateKeeperEndPointArray();
+ for (int i = 0; i < globusGateKeeperEndPointArray.length ; i++){
+ globusGateKeeperEndPoint.add(globusGateKeeperEndPointArray[i]);
+ }
+
+ String[] gridFTPEndPointArray = globusHostType.getGridFTPEndPointArray();
+ for (int i = 0; i < gridFTPEndPointArray.length ; i++){
+ gridFTPEndPoint.add(globusGateKeeperEndPointArray[i]);
+ }
+
+ }else if (hostDescriptionType instanceof GsisshHostType){
+ GsisshHostType gsisshHostType = (GsisshHostType) hostDescriptionType;
+ hostType.add(HostTypes.GSISSH_HOST_TYPE);
+
+ String[] gridFTPEndPointArray = gsisshHostType.getGridFTPEndPointArray();
+ for (int i = 0; i < gridFTPEndPointArray.length ; i++){
+ gridFTPEndPoint.add(gridFTPEndPointArray[i]);
+ }
+ } else if (hostDescriptionType instanceof Ec2HostType) {
+ Ec2HostType ec2HostType = (Ec2HostType) hostDescriptionType;
+ hostType.add(HostTypes.EC2_HOST_TYPE);
+
+ String[] imageIDArray = ec2HostType.getImageIDArray();
+ for (int i = 0; i < imageIDArray.length ; i++){
+ imageID.add(imageIDArray[i]);
+ }
+
+ String[] instanceIDArray = ec2HostType.getInstanceIDArray();
+ for (int i = 0; i < instanceIDArray.length ; i++){
+ instanceID.add(instanceIDArray[i]);
+ }
+ } else {
+ hostType.add(HostTypes.HOST_DESCRIPTION_TYPE);
+ }
+ hostDescriptor.setGlobusGateKeeperEndPoint(globusGateKeeperEndPoint);
+ hostDescriptor.setGridFTPEndPoint(gridFTPEndPoint);
+ hostDescriptor.setImageID(imageID);
+ hostDescriptor.setInstanceID(instanceID);
+ hostDescriptor.setHostType(hostType);
+ if (hostDescription != null) {
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
- builder.entity(result);
+ builder.entity(hostDescription);
return builder.build();
} else {
Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
@@ -623,6 +697,7 @@ import java.util.Map;
@GET
@Path("get/hostdescriptors")
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response getHostDescriptors() {
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
@@ -631,9 +706,59 @@ import java.util.Map;
HostDescriptionList list = new HostDescriptionList();
HostDescriptor[] hostDescriptions = new HostDescriptor[hostDescriptionList.size()];
for (int i = 0; i < hostDescriptionList.size(); i++) {
+ List<String> hostType = new ArrayList<String>();
+ List<String> gridFTPEndPoint = new ArrayList<String>();
+ List<String> globusGateKeeperEndPoint = new ArrayList<String>();
+ List<String> imageID = new ArrayList<String>();
+ List<String> instanceID = new ArrayList<String>();
HostDescriptor hostDescriptor = new HostDescriptor();
- String document = hostDescriptionList.get(i).toXML();
- hostDescriptor.setHostDocument(document);
+ hostDescriptor.setHostname(hostDescriptionList.get(i).getType().getHostName());
+ hostDescriptor.setHostAddress(hostDescriptionList.get(i).getType().getHostAddress());
+
+ HostDescriptionType hostDescriptionType = hostDescriptionList.get(i).getType();
+ if (hostDescriptionType instanceof GlobusHostType){
+ GlobusHostType globusHostType = (GlobusHostType) hostDescriptionType;
+ hostType.add(HostTypes.GLOBUS_HOST_TYPE);
+ String[] globusGateKeeperEndPointArray = globusHostType.getGlobusGateKeeperEndPointArray();
+ for (int j = 0; j < globusGateKeeperEndPointArray.length ; j++){
+ globusGateKeeperEndPoint.add(globusGateKeeperEndPointArray[j]);
+ }
+
+ String[] gridFTPEndPointArray = globusHostType.getGridFTPEndPointArray();
+ for (int j = 0; j < gridFTPEndPointArray.length ; j++){
+ gridFTPEndPoint.add(globusGateKeeperEndPointArray[j]);
+ }
+
+ }else if (hostDescriptionType instanceof GsisshHostType){
+ GsisshHostType gsisshHostType = (GsisshHostType) hostDescriptionType;
+ hostType.add(HostTypes.GSISSH_HOST_TYPE);
+
+ String[] gridFTPEndPointArray = gsisshHostType.getGridFTPEndPointArray();
+ for (int j = 0; j < gridFTPEndPointArray.length ; j++){
+ gridFTPEndPoint.add(gridFTPEndPointArray[j]);
+ }
+ } else if (hostDescriptionType instanceof Ec2HostType) {
+ Ec2HostType ec2HostType = (Ec2HostType) hostDescriptionType;
+ hostType.add(HostTypes.EC2_HOST_TYPE);
+
+ String[] imageIDArray = ec2HostType.getImageIDArray();
+ for (int j = 0; j < imageIDArray.length ; j++){
+ imageID.add(imageIDArray[j]);
+ }
+
+ String[] instanceIDArray = ec2HostType.getInstanceIDArray();
+ for (int j = 0; j < instanceIDArray.length ; j++){
+ instanceID.add(instanceIDArray[j]);
+ }
+ } else {
+ hostType.add(HostTypes.HOST_DESCRIPTION_TYPE);
+ }
+ hostDescriptor.setGlobusGateKeeperEndPoint(globusGateKeeperEndPoint);
+ hostDescriptor.setGridFTPEndPoint(gridFTPEndPoint);
+ hostDescriptor.setImageID(imageID);
+ hostDescriptor.setInstanceID(instanceID);
+ hostDescriptor.setHostType(hostType);
+
hostDescriptions[i] = hostDescriptor;
}
list.setHostDescriptions(hostDescriptions);
@@ -679,21 +804,47 @@ import java.util.Map;
@POST
@Path("servicedescriptor/save")
- @Consumes(MediaType.TEXT_XML)
- @Produces(MediaType.TEXT_PLAIN)
- public Response addServiceDescriptor(String service){
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+ public Response addServiceDescriptor(ServiceDescriptor service){
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
- ServiceDescription serviceDescription = ServiceDescription.fromXML(service);
+ ServiceDescription serviceDescription = new ServiceDescription();
+ serviceDescription.getType().setName(service.getServiceName());
+ serviceDescription.getType().setDescription(service.getDescription());
+ List<ServiceParameters> inputParams = service.getInputParams();
+ InputParameterType[] inputParameterTypeArray = new InputParameterType[inputParams.size()];
+ for (int i = 0; i < inputParams.size(); i++){
+ InputParameterType parameter = InputParameterType.Factory.newInstance();
+ parameter.setParameterName(inputParams.get(i).getType());
+ parameter.setParameterValueArray(new String[]{inputParams.get(i).getName()});
+ ParameterType parameterType = parameter.addNewParameterType();
+ parameterType.setType(DataType.Enum.forString(inputParams.get(i).getDataType()));
+ parameterType.setName(inputParams.get(i).getDataType());
+ parameter.setParameterType(parameterType);
+ inputParameterTypeArray[i] = parameter;
+ }
+ serviceDescription.getType().setInputParametersArray(inputParameterTypeArray);
+
+ List<ServiceParameters> outputParams = service.getOutputParams();
+ OutputParameterType[] outputParameterTypeArray = new OutputParameterType[outputParams.size()];
+ for (int i = 0; i < outputParams.size(); i++){
+ OutputParameterType parameter = OutputParameterType.Factory.newInstance();
+ parameter.setParameterName(outputParams.get(i).getType());
+ parameter.setParameterName(outputParams.get(i).getName());
+ ParameterType parameterType = parameter.addNewParameterType();
+ parameterType.setType(DataType.Enum.forString(outputParams.get(i).getDataType()));
+ parameterType.setName(outputParams.get(i).getDataType());
+ parameter.setParameterType(parameterType);
+ outputParameterTypeArray[i] = parameter;
+ }
+ serviceDescription.getType().setOutputParametersArray(outputParameterTypeArray);
airavataRegistry.addServiceDescriptor(serviceDescription);
Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
return builder.build();
} catch (DescriptorAlreadyExistsException e){
Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
return builder.build();
- } catch (XmlException e) {
- Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
- return builder.build();
} catch (RegistryException e) {
Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
return builder.build();
@@ -702,21 +853,47 @@ import java.util.Map;
@POST
@Path("servicedescriptor/update")
- @Consumes(MediaType.TEXT_XML)
- @Produces(MediaType.TEXT_PLAIN)
- public Response updateServiceDescriptor(String service) {
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+ public Response updateServiceDescriptor(ServiceDescriptor service) {
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
- ServiceDescription serviceDescription = ServiceDescription.fromXML(service);
+ ServiceDescription serviceDescription = new ServiceDescription();
+ serviceDescription.getType().setName(service.getServiceName());
+ serviceDescription.getType().setDescription(service.getDescription());
+ List<ServiceParameters> inputParams = service.getInputParams();
+ InputParameterType[] inputParameterTypeArray = new InputParameterType[inputParams.size()];
+ for (int i = 0; i < inputParams.size(); i++){
+ InputParameterType parameter = InputParameterType.Factory.newInstance();
+ parameter.setParameterName(inputParams.get(i).getType());
+ parameter.setParameterValueArray(new String[]{inputParams.get(i).getName()});
+ ParameterType parameterType = parameter.addNewParameterType();
+ parameterType.setType(DataType.Enum.forString(inputParams.get(i).getDataType()));
+ parameterType.setName(inputParams.get(i).getDataType());
+ parameter.setParameterType(parameterType);
+ inputParameterTypeArray[i] = parameter;
+ }
+ serviceDescription.getType().setInputParametersArray(inputParameterTypeArray);
+
+ List<ServiceParameters> outputParams = service.getOutputParams();
+ OutputParameterType[] outputParameterTypeArray = new OutputParameterType[outputParams.size()];
+ for (int i = 0; i < outputParams.size(); i++){
+ OutputParameterType parameter = OutputParameterType.Factory.newInstance();
+ parameter.setParameterName(outputParams.get(i).getType());
+ parameter.setParameterName(outputParams.get(i).getName());
+ ParameterType parameterType = parameter.addNewParameterType();
+ parameterType.setType(DataType.Enum.forString(outputParams.get(i).getDataType()));
+ parameterType.setName(outputParams.get(i).getDataType());
+ parameter.setParameterType(parameterType);
+ outputParameterTypeArray[i] = parameter;
+ }
+ serviceDescription.getType().setOutputParametersArray(outputParameterTypeArray);
airavataRegistry.updateServiceDescriptor(serviceDescription);
Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
return builder.build();
} catch (DescriptorAlreadyExistsException e){
Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
return builder.build();
- } catch (XmlException e) {
- Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
- return builder.build();
} catch (RegistryException e) {
Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
return builder.build();
@@ -725,14 +902,43 @@ import java.util.Map;
@GET
@Path("servicedescriptor/description")
- @Produces("text/xml")
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response getServiceDescriptor(@QueryParam("serviceName") String serviceName){
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
- String result = airavataRegistry.getServiceDescriptor(serviceName).toXML();
- if (result != null) {
+ ServiceDescription serviceDescription = airavataRegistry.getServiceDescriptor(serviceName);
+ ServiceDescriptor serviceDescriptor = new ServiceDescriptor();
+ serviceDescriptor.setServiceName(serviceDescription.getType().getName());
+ serviceDescriptor.setDescription(serviceDescription.getType().getDescription());
+ InputParameterType[] inputParametersArray = serviceDescription.getType().getInputParametersArray();
+ OutputParameterType[] outputParametersArray = serviceDescription.getType().getOutputParametersArray();
+ List<ServiceParameters> inputParams = new ArrayList<ServiceParameters>();
+ List<ServiceParameters> outputParams = new ArrayList<ServiceParameters>();
+
+ for (int i = 0; i < inputParametersArray.length; i++){
+ ServiceParameters serviceParameters = new ServiceParameters();
+ serviceParameters.setType(inputParametersArray[i].getParameterName());
+ serviceParameters.setName(inputParametersArray[i].getParameterValueArray().toString());
+ serviceParameters.setDescription(inputParametersArray[i].getParameterDescription());
+ serviceParameters.setDataType(inputParametersArray[i].getParameterType().getType().toString());
+ inputParams.add(serviceParameters);
+ }
+ serviceDescriptor.setInputParams(inputParams);
+
+ for (int i = 0; i < outputParametersArray.length; i++){
+ ServiceParameters serviceParameters = new ServiceParameters();
+ serviceParameters.setType(outputParametersArray[i].getParameterName());
+ serviceParameters.setName(outputParametersArray[i].getParameterName());
+ serviceParameters.setDescription(outputParametersArray[i].getParameterDescription());
+ serviceParameters.setDataType(outputParametersArray[i].getParameterType().getType().toString());
+ inputParams.add(serviceParameters);
+ }
+ serviceDescriptor.setOutputParams(outputParams);
+
+ if (serviceDescription != null) {
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
- builder.entity(result);
+ builder.entity(serviceDescription);
return builder.build();
} else {
Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
@@ -764,6 +970,7 @@ import java.util.Map;
@GET
@Path("get/servicedescriptors")
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response getServiceDescriptors(){
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
@@ -773,7 +980,32 @@ import java.util.Map;
ServiceDescriptor[] serviceDescriptions = new ServiceDescriptor[serviceDescriptors.size()];
for (int i = 0; i < serviceDescriptors.size(); i++) {
ServiceDescriptor serviceDescriptor = new ServiceDescriptor();
- serviceDescriptor.setServiceDocument(serviceDescriptors.get(i).toXML());
+ serviceDescriptor.setServiceName(serviceDescriptors.get(i).getType().getName());
+ serviceDescriptor.setDescription(serviceDescriptors.get(i).getType().getDescription());
+ InputParameterType[] inputParametersArray = serviceDescriptors.get(i).getType().getInputParametersArray();
+ OutputParameterType[] outputParametersArray = serviceDescriptors.get(i).getType().getOutputParametersArray();
+ List<ServiceParameters> inputParams = new ArrayList<ServiceParameters>();
+ List<ServiceParameters> outputParams = new ArrayList<ServiceParameters>();
+
+ for (int j = 0; j < inputParametersArray.length; j++){
+ ServiceParameters serviceParameters = new ServiceParameters();
+ serviceParameters.setType(inputParametersArray[j].getParameterName());
+ serviceParameters.setName(inputParametersArray[j].getParameterValueArray().toString());
+ serviceParameters.setDescription(inputParametersArray[j].getParameterDescription());
+ serviceParameters.setDataType(inputParametersArray[j].getParameterType().getType().toString());
+ inputParams.add(serviceParameters);
+ }
+ serviceDescriptor.setInputParams(inputParams);
+
+ for (int j = 0; j < outputParametersArray.length; j++){
+ ServiceParameters serviceParameters = new ServiceParameters();
+ serviceParameters.setType(outputParametersArray[j].getParameterName());
+ serviceParameters.setName(outputParametersArray[j].getParameterName());
+ serviceParameters.setDescription(outputParametersArray[j].getParameterDescription());
+ serviceParameters.setDataType(outputParametersArray[j].getParameterType().getType().toString());
+ inputParams.add(serviceParameters);
+ }
+ serviceDescriptor.setOutputParams(outputParams);
serviceDescriptions[i] = serviceDescriptor;
}
list.setServiceDescriptions(serviceDescriptions);
@@ -821,40 +1053,46 @@ import java.util.Map;
@POST
@Path("applicationdescriptor/build/save")
- @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
- @Produces(MediaType.TEXT_PLAIN)
- public Response addApplicationDescriptor(@FormParam("service") String service,
- @FormParam("host") String host,
- @FormParam("application") String application){
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public Response addApplicationDescriptor(ApplicationDescriptor applicationDescriptor){
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
- ServiceDescription serviceDescription = ServiceDescription.fromXML(service);
- String serviceName = serviceDescription.getType().getName();
- HostDescription hostDescription = HostDescription.fromXML(host);
- String hostName = hostDescription.getType().getHostName();
- ApplicationDeploymentDescription applicationDeploymentDescription = ApplicationDeploymentDescription.fromXML(application);
- airavataRegistry.addApplicationDescriptor(serviceName, hostName, applicationDeploymentDescription);
+ String hostdescName = applicationDescriptor.getHostdescName();
+ if(!airavataRegistry.isHostDescriptorExists(hostdescName)){
+ Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+ return builder.build();
+ }
+ ApplicationDeploymentDescription applicationDeploymentDescription = new ApplicationDeploymentDescription();
+ applicationDeploymentDescription.getType().getApplicationName().setStringValue(applicationDescriptor.getApplicationName());
+ applicationDeploymentDescription.getType().setExecutableLocation(applicationDescriptor.getExecutablePath());
+ applicationDeploymentDescription.getType().setOutputDataDirectory(applicationDescriptor.getWorkingDir());
+
+ //set advanced options according app desc type
+
+
+ String serviceName = applicationDescriptor.getServiceDesc().getServiceName();
+ airavataRegistry.addApplicationDescriptor(serviceName, hostdescName, applicationDeploymentDescription);
Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
return builder.build();
} catch (DescriptorAlreadyExistsException e){
Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
return builder.build();
- } catch (XmlException e) {
- Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
- return builder.build();
} catch (RegistryException e) {
Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
return builder.build();
}
}
+
+
@POST
@Path("applicationdescriptor/save")
- @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+ @Consumes(MediaType.TEXT_XML)
@Produces(MediaType.TEXT_PLAIN)
public Response addApplicationDesc(@FormParam("serviceName") String serviceName,
@FormParam("hostName") String hostName,
- @FormParam("application") String application) {
+ String application) {
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
ApplicationDeploymentDescription applicationDeploymentDescription = ApplicationDeploymentDescription.fromXML(application);
@@ -876,11 +1114,11 @@ import java.util.Map;
@POST
@Path("applicationdescriptor/update/descriptor")
- @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+ @Consumes(MediaType.TEXT_XML)
@Produces(MediaType.TEXT_PLAIN)
- public Response udpateApplicationDescriptorByDescriptors(@FormParam("service") String service,
- @FormParam("host") String host,
- @FormParam("application") String application) {
+ public Response udpateApplicationDescriptorByDescriptors(String service,
+ String host,
+ String application) {
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
ServiceDescription serviceDescription = ServiceDescription.fromXML(service);
@@ -904,11 +1142,11 @@ import java.util.Map;
@POST
@Path("applicationdescriptor/update")
- @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+ @Consumes(MediaType.TEXT_XML)
@Produces(MediaType.TEXT_PLAIN)
public Response updateApplicationDescriptor(@FormParam("serviceName") String serviceName,
@FormParam("hostName")String hostName,
- @FormParam("application") String application){
+ String application){
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
ApplicationDeploymentDescription applicationDeploymentDescription = ApplicationDeploymentDescription.fromXML(application);
@@ -972,78 +1210,78 @@ import java.util.Map;
}
}
- @GET
- @Path("applicationdescriptor/alldescriptors/service")
- @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
- public Response getApplicationDescriptors(@QueryParam("serviceName") String serviceName) {
- airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
- try{
- Map<String, ApplicationDeploymentDescription> applicationDeploymentDescriptionMap = airavataRegistry.getApplicationDescriptors(serviceName);
- ApplicationDescriptorList applicationDescriptorList = new ApplicationDescriptorList();
- ApplicationDescriptor[] applicationDescriptors = new ApplicationDescriptor[applicationDeploymentDescriptionMap.size()];
- int i = 0;
- for(String hostName : applicationDeploymentDescriptionMap.keySet()){
- ApplicationDeploymentDescription applicationDeploymentDescription = applicationDeploymentDescriptionMap.get(hostName);
- ApplicationDescriptor applicationDescriptor = new ApplicationDescriptor();
- applicationDescriptor.setHostdescName(hostName);
- applicationDescriptor.setAppDocument(applicationDeploymentDescription.toXML());
- applicationDescriptors[i] = applicationDescriptor;
- i++;
- }
- applicationDescriptorList.setApplicationDescriptors(applicationDescriptors);
- if(applicationDeploymentDescriptionMap.size() != 0){
- Response.ResponseBuilder builder = Response.status(Response.Status.OK);
- builder.entity(applicationDescriptorList);
- return builder.build();
- } else {
- Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
- return builder.build();
- }
- } catch (MalformedDescriptorException e) {
- Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
- return builder.build();
- } catch (RegistryException e) {
- Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
- return builder.build();
- }
- }
-
- @GET
- @Path("applicationdescriptor/alldescriptors")
- @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
- public Response getApplicationDescriptors(){
- airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
- try{
- Map<String[], ApplicationDeploymentDescription> applicationDeploymentDescriptionMap = airavataRegistry.getApplicationDescriptors();
- ApplicationDescriptorList applicationDescriptorList = new ApplicationDescriptorList();
- ApplicationDescriptor[] applicationDescriptors = new ApplicationDescriptor[applicationDeploymentDescriptionMap.size()];
- int i = 0;
- for (String[] descriptors : applicationDeploymentDescriptionMap.keySet()){
- ApplicationDescriptor applicationDescriptor = new ApplicationDescriptor();
- ApplicationDeploymentDescription applicationDeploymentDescription = applicationDeploymentDescriptionMap.get(descriptors);
- applicationDescriptor.setServiceDescName(descriptors[0]);
- applicationDescriptor.setHostdescName(descriptors[1]);
- applicationDescriptor.setAppDocument(applicationDeploymentDescription.toXML());
- applicationDescriptors[i] = applicationDescriptor;
- i++;
- }
- applicationDescriptorList.setApplicationDescriptors(applicationDescriptors);
- if(applicationDeploymentDescriptionMap.size() != 0){
- Response.ResponseBuilder builder = Response.status(Response.Status.OK);
- builder.entity(applicationDescriptorList);
- return builder.build();
- } else {
- Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
- return builder.build();
- }
- } catch (MalformedDescriptorException e) {
- Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
- return builder.build();
- } catch (RegistryException e) {
- Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
- return builder.build();
- }
- }
+// @GET
+// @Path("applicationdescriptor/alldescriptors/service")
+// @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+// public Response getApplicationDescriptors(@QueryParam("serviceName") String serviceName) {
+// airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
+// try{
+// Map<String, ApplicationDeploymentDescription> applicationDeploymentDescriptionMap = airavataRegistry.getApplicationDescriptors(serviceName);
+// ApplicationDescriptorList applicationDescriptorList = new ApplicationDescriptorList();
+// ApplicationDescriptor[] applicationDescriptors = new ApplicationDescriptor[applicationDeploymentDescriptionMap.size()];
+// int i = 0;
+// for(String hostName : applicationDeploymentDescriptionMap.keySet()){
+// ApplicationDeploymentDescription applicationDeploymentDescription = applicationDeploymentDescriptionMap.get(hostName);
+// ApplicationDescriptor applicationDescriptor = new ApplicationDescriptor();
+// applicationDescriptor.setHostdescName(hostName);
+// applicationDescriptor.setAppDocument(applicationDeploymentDescription.toXML());
+// applicationDescriptors[i] = applicationDescriptor;
+// i++;
+// }
+// applicationDescriptorList.setApplicationDescriptors(applicationDescriptors);
+// if(applicationDeploymentDescriptionMap.size() != 0){
+// Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+// builder.entity(applicationDescriptorList);
+// return builder.build();
+// } else {
+// Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+// return builder.build();
+// }
+// } catch (MalformedDescriptorException e) {
+// Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+// return builder.build();
+// } catch (RegistryException e) {
+// Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+// return builder.build();
+// }
+// }
+
+// @GET
+// @Path("applicationdescriptor/alldescriptors")
+// @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+// public Response getApplicationDescriptors(){
+// airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
+// try{
+// Map<String[], ApplicationDeploymentDescription> applicationDeploymentDescriptionMap = airavataRegistry.getApplicationDescriptors();
+// ApplicationDescriptorList applicationDescriptorList = new ApplicationDescriptorList();
+// ApplicationDescriptor[] applicationDescriptors = new ApplicationDescriptor[applicationDeploymentDescriptionMap.size()];
+// int i = 0;
+// for (String[] descriptors : applicationDeploymentDescriptionMap.keySet()){
+// ApplicationDescriptor applicationDescriptor = new ApplicationDescriptor();
+// ApplicationDeploymentDescription applicationDeploymentDescription = applicationDeploymentDescriptionMap.get(descriptors);
+// applicationDescriptor.setServiceDescName(descriptors[0]);
+// applicationDescriptor.setHostdescName(descriptors[1]);
+// applicationDescriptor.setAppDocument(applicationDeploymentDescription.toXML());
+// applicationDescriptors[i] = applicationDescriptor;
+// i++;
+// }
+// applicationDescriptorList.setApplicationDescriptors(applicationDescriptors);
+// if(applicationDeploymentDescriptionMap.size() != 0){
+// Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+// builder.entity(applicationDescriptorList);
+// return builder.build();
+// } else {
+// Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+// return builder.build();
+// }
+// } catch (MalformedDescriptorException e) {
+// Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+// return builder.build();
+// } catch (RegistryException e) {
+// Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+// return builder.build();
+// }
+// }
@DELETE
@Path("applicationdescriptor/delete")
@@ -1830,8 +2068,7 @@ import java.util.Map;
@POST
@Path("update/workflownodeoutput")
@Produces(MediaType.TEXT_PLAIN)
- public Response updateWorkflowNodeOutput(@FormParam("experimentID") String experimentID,
- @FormParam("nodeID") String nodeID,
+ public Response updateWorkflowNodeOutput(@FormParam("nodeID") String nodeID,
@FormParam("workflowInstanceID") String workflowInstanceID,
@FormParam("data") String data) {
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
@@ -1856,12 +2093,20 @@ import java.util.Map;
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
List<WorkflowNodeIOData> workflowNodeIODataList = airavataRegistry.searchWorkflowInstanceNodeInput(experimentIdRegEx, workflowNameRegEx, nodeNameRegEx);
- WorkflowNodeIOData[] workflowNodeIODataCollection = new WorkflowNodeIOData[workflowNodeIODataList.size()];
+ WorkflowNodeIODataMapping[] workflowNodeIODataCollection = new WorkflowNodeIODataMapping[workflowNodeIODataList.size()];
WorkflowNodeIODataList workflowNodeIOData = new WorkflowNodeIODataList();
for (int i = 0; i<workflowNodeIODataList.size(); i++){
- workflowNodeIODataCollection[i] = workflowNodeIODataList.get(i);
+ WorkflowNodeIOData nodeIOData = workflowNodeIODataList.get(i);
+ WorkflowNodeIODataMapping workflowNodeIODataMapping = new WorkflowNodeIODataMapping();
+
+ workflowNodeIODataMapping.setExperimentId(nodeIOData.getExperimentId());
+ workflowNodeIODataMapping.setWorkflowId(nodeIOData.getWorkflowId());
+ workflowNodeIODataMapping.setWorkflowInstanceId(nodeIOData.getWorkflowInstanceId());
+ workflowNodeIODataMapping.setWorkflowName(nodeIOData.getWorkflowName());
+ workflowNodeIODataMapping.setWorkflowNodeType(nodeIOData.getNodeType().toString());
+ workflowNodeIODataCollection[i] = workflowNodeIODataMapping;
}
- workflowNodeIOData.setWorkflowNodeIODatas(workflowNodeIODataCollection);
+ workflowNodeIOData.setWorkflowNodeIODataMappings(workflowNodeIODataCollection);
if (workflowNodeIODataList.size() != 0) {
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
builder.entity(workflowNodeIOData);
@@ -1885,12 +2130,20 @@ import java.util.Map;
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
List<WorkflowNodeIOData> workflowNodeIODataList = airavataRegistry.searchWorkflowInstanceNodeOutput(experimentIdRegEx, workflowNameRegEx, nodeNameRegEx);
- WorkflowNodeIOData[] workflowNodeIODataCollection = new WorkflowNodeIOData[workflowNodeIODataList.size()];
+ WorkflowNodeIODataMapping[] workflowNodeIODataCollection = new WorkflowNodeIODataMapping[workflowNodeIODataList.size()];
WorkflowNodeIODataList workflowNodeIOData = new WorkflowNodeIODataList();
for (int i = 0; i<workflowNodeIODataList.size(); i++){
- workflowNodeIODataCollection[i] = workflowNodeIODataList.get(i);
+ WorkflowNodeIOData nodeIOData = workflowNodeIODataList.get(i);
+ WorkflowNodeIODataMapping workflowNodeIODataMapping = new WorkflowNodeIODataMapping();
+
+ workflowNodeIODataMapping.setExperimentId(nodeIOData.getExperimentId());
+ workflowNodeIODataMapping.setWorkflowId(nodeIOData.getWorkflowId());
+ workflowNodeIODataMapping.setWorkflowInstanceId(nodeIOData.getWorkflowInstanceId());
+ workflowNodeIODataMapping.setWorkflowName(nodeIOData.getWorkflowName());
+ workflowNodeIODataMapping.setWorkflowNodeType(nodeIOData.getNodeType().toString());
+ workflowNodeIODataCollection[i] = workflowNodeIODataMapping;
}
- workflowNodeIOData.setWorkflowNodeIODatas(workflowNodeIODataCollection);
+ workflowNodeIOData.setWorkflowNodeIODataMappings(workflowNodeIODataCollection);
if (workflowNodeIODataList.size() != 0) {
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
builder.entity(workflowNodeIOData);
@@ -1913,12 +2166,20 @@ import java.util.Map;
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
List<WorkflowNodeIOData> workflowNodeIODataList = airavataRegistry.getWorkflowInstanceNodeInput(workflowInstanceId, nodeType);
- WorkflowNodeIOData[] workflowNodeIODataCollection = new WorkflowNodeIOData[workflowNodeIODataList.size()];
+ WorkflowNodeIODataMapping[] workflowNodeIODataCollection = new WorkflowNodeIODataMapping[workflowNodeIODataList.size()];
WorkflowNodeIODataList workflowNodeIOData = new WorkflowNodeIODataList();
for (int i = 0; i<workflowNodeIODataList.size(); i++){
- workflowNodeIODataCollection[i] = workflowNodeIODataList.get(i);
+ WorkflowNodeIOData nodeIOData = workflowNodeIODataList.get(i);
+ WorkflowNodeIODataMapping workflowNodeIODataMapping = new WorkflowNodeIODataMapping();
+
+ workflowNodeIODataMapping.setExperimentId(nodeIOData.getExperimentId());
+ workflowNodeIODataMapping.setWorkflowId(nodeIOData.getWorkflowId());
+ workflowNodeIODataMapping.setWorkflowInstanceId(nodeIOData.getWorkflowInstanceId());
+ workflowNodeIODataMapping.setWorkflowName(nodeIOData.getWorkflowName());
+ workflowNodeIODataMapping.setWorkflowNodeType(nodeIOData.getNodeType().toString());
+ workflowNodeIODataCollection[i] = workflowNodeIODataMapping;
}
- workflowNodeIOData.setWorkflowNodeIODatas(workflowNodeIODataCollection);
+ workflowNodeIOData.setWorkflowNodeIODataMappings(workflowNodeIODataCollection);
if (workflowNodeIODataList.size() != 0) {
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
builder.entity(workflowNodeIOData);
@@ -1941,12 +2202,19 @@ import java.util.Map;
airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
List<WorkflowNodeIOData> workflowNodeIODataList = airavataRegistry.getWorkflowInstanceNodeOutput(workflowInstanceId, nodeType);
- WorkflowNodeIOData[] workflowNodeIODataCollection = new WorkflowNodeIOData[workflowNodeIODataList.size()];
+ WorkflowNodeIODataMapping[] workflowNodeIODataCollection = new WorkflowNodeIODataMapping[workflowNodeIODataList.size()];
WorkflowNodeIODataList workflowNodeIOData = new WorkflowNodeIODataList();
for (int i = 0; i<workflowNodeIODataList.size(); i++){
- workflowNodeIODataCollection[i] = workflowNodeIODataList.get(i);
- }
- workflowNodeIOData.setWorkflowNodeIODatas(workflowNodeIODataCollection);
+ WorkflowNodeIOData nodeIOData = workflowNodeIODataList.get(i);
+ WorkflowNodeIODataMapping workflowNodeIODataMapping = new WorkflowNodeIODataMapping();
+
+ workflowNodeIODataMapping.setExperimentId(nodeIOData.getExperimentId());
+ workflowNodeIODataMapping.setWorkflowId(nodeIOData.getWorkflowId());
+ workflowNodeIODataMapping.setWorkflowInstanceId(nodeIOData.getWorkflowInstanceId());
+ workflowNodeIODataMapping.setWorkflowName(nodeIOData.getWorkflowName());
+ workflowNodeIODataMapping.setWorkflowNodeType(nodeIOData.getNodeType().toString());
+ workflowNodeIODataCollection[i] = workflowNodeIODataMapping; }
+ workflowNodeIOData.setWorkflowNodeIODataMappings(workflowNodeIODataCollection);
if (workflowNodeIODataList.size() != 0) {
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
builder.entity(workflowNodeIOData);
Added: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/ApplicationDescriptorTypes.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/ApplicationDescriptorTypes.java?rev=1403295&view=auto
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/ApplicationDescriptorTypes.java (added)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/ApplicationDescriptorTypes.java Mon Oct 29 13:55:19 2012
@@ -0,0 +1,29 @@
+/*
+ *
+ * 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.services.registry.rest.utils;
+
+public class ApplicationDescriptorTypes {
+ public static final String APP_DEP_DESC_TYPE = "ApplicationDeploymentDescriptionType";
+ public static final String BATCH_APP_DEP_DESC_TYPE = "BatchApplicationDeploymentDescriptionType";
+ public static final String GRAM_APP_DEP_DESC_TYPE = "GramApplicationDeploymentType";
+ public static final String HADOOP_APP_DEP_DESC_TYPE = "HadoopApplicationDeploymentDescriptionType";
+}
Added: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/HostTypes.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/HostTypes.java?rev=1403295&view=auto
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/HostTypes.java (added)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/HostTypes.java Mon Oct 29 13:55:19 2012
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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.services.registry.rest.utils;
+
+public class HostTypes {
+ public static final String GLOBUS_HOST_TYPE = "GlobusHostType";
+ public static final String GSISSH_HOST_TYPE = "GsisshHostType";
+ public static final String EC2_HOST_TYPE = "Ec2HostType";
+ public static final String HOST_DESCRIPTION_TYPE = "HostDescriptionType";
+
+}