You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by pa...@apache.org on 2011/10/27 23:39:00 UTC
svn commit: r1190045 [1/2] - in /incubator/airavata/trunk/modules:
commons/gfac-schema/schemas/
commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/
commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/
commons/r...
Author: patanachai
Date: Thu Oct 27 21:38:59 2011
New Revision: 1190045
URL: http://svn.apache.org/viewvc?rev=1190045&view=rev
Log:
AIRAVATA-171 all new schema
Added:
incubator/airavata/trunk/modules/commons/gfac-schema/schemas/ApplicationDeploymentDescription.xsd
incubator/airavata/trunk/modules/commons/gfac-schema/schemas/BasicTypes.xsd
incubator/airavata/trunk/modules/commons/gfac-schema/schemas/GFacParameterTypes.xsd
incubator/airavata/trunk/modules/commons/gfac-schema/schemas/ServiceDescription.xsd
Removed:
incubator/airavata/trunk/modules/commons/gfac-schema/schemas/ApplicationDescription.xsd
incubator/airavata/trunk/modules/commons/gfac-schema/schemas/ServiceMap.xsd
incubator/airavata/trunk/modules/commons/gfac-schema/schemas/gfac-parameter.xsd
Modified:
incubator/airavata/trunk/modules/commons/gfac-schema/schemas/HostDescription.xsd
incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ActualParameter.java
incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java
incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java
incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryTest.java
incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/LocalProvider.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/SSHProvider.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/GramRSLGenerator.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java
incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java
Added: incubator/airavata/trunk/modules/commons/gfac-schema/schemas/ApplicationDeploymentDescription.xsd
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/schemas/ApplicationDeploymentDescription.xsd?rev=1190045&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/schemas/ApplicationDeploymentDescription.xsd (added)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/schemas/ApplicationDeploymentDescription.xsd Thu Oct 27 21:38:59 2011
@@ -0,0 +1,101 @@
+<!--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. -->
+
+<schema targetNamespace="http://schemas.airavata.apache.org/gfac/type" xmlns:gfac="http://schemas.airavata.apache.org/gfac/type"
+ xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+ <include schemaLocation="BasicTypes.xsd" />
+
+ <element name="applicationDeploymentDescription" type="gfac:applicationDeploymentDescriptionType" />
+
+ <complexType name="applicationDeploymentDescriptionType">
+ <sequence>
+ <element name="authorInfo" type="gfac:authorInfoType" minOccurs="0" maxOccurs="unbounded" />
+ <element name="documentInfo" type="gfac:documentInfoType" minOccurs="0" maxOccurs="1" />
+ <element name="applicationName" minOccurs="1" maxOccurs="1">
+ <complexType>
+ <simpleContent>
+ <extension base="xsd:string">
+ <attribute name="targetNamespace" type="xsd:string" use="required" />
+ </extension>
+ </simpleContent>
+ </complexType>
+ </element>
+ <element name="executableLocation" type="xsd:string" minOccurs="1" maxOccurs="1" />
+ <element name="applicationEnvironment" type="gfac:nameValuePairType" minOccurs="0" maxOccurs="unbounded" />
+ <element name="standardError" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element name="standardInput" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element name="standardOutput" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element name="inputDataDirectory" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element name="outputDataDirectory" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element name="scratchWorkingDirectory" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element name="staticWorkingDirectory" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ </complexType>
+
+ <complexType name="batchApplicationDeploymentDescriptionType">
+ <complexContent>
+ <extension base="gfac:applicationDeploymentDescriptionType">
+ <sequence>
+ <element name="jobType" type="gfac:jobTypeType" minOccurs="0" maxOccurs="1" />
+ <element name="projectAccount" type="gfac:projectAccountType" minOccurs="0" maxOccurs="1" />
+ <element name="queue" type="gfac:queueType" minOccurs="0" maxOccurs="1" />
+ <!-- Explicitly set the maximum walltime for a single execution of the executable. The units is in minutes. -->
+ <element name="maxWallTime" type="xsd:int" minOccurs="0" maxOccurs="1" />
+ <!-- The number of processors to use for the job -->
+ <element name="cpuCount" type="xsd:int" minOccurs="0" maxOccurs="1" />
+ <element name="nodeCount" type="xsd:int" minOccurs="0" maxOccurs="1" />
+ <element name="processorsPerNode" type="xsd:int" minOccurs="0" maxOccurs="1" />
+ <element name="minMemory" type="xsd:int" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="gramApplicationDeploymentType">
+ <complexContent>
+ <extension base="gfac:batchApplicationDeploymentDescriptionType">
+ <sequence>
+ <element name="rslparm" type="gfac:RSLParmType" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <simpleType name="jobTypeType">
+ <restriction base="xsd:string">
+ <enumeration value="serial" />
+ <enumeration value="mpi" />
+ <enumeration value="openMP" />
+ </restriction>
+ </simpleType>
+
+ <complexType name="projectAccountType">
+ <sequence>
+ <element name="projectAccountNumber" type="xsd:string" minOccurs="1" maxOccurs="1" />
+ <element name="projectAccountDescription" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element ref="gfac:anyMetadata" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+
+ <complexType name="queueType">
+ <sequence>
+ <element name="queueName" type="xsd:string" minOccurs="1" maxOccurs="1" />
+ <element name="queueDescription" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ </complexType>
+
+ <complexType name="RSLParmType">
+ <simpleContent>
+ <extension base="xsd:string">
+ <attribute name="name" type="xsd:string" use="required" />
+ </extension>
+ </simpleContent>
+ </complexType>
+
+</schema>
Added: incubator/airavata/trunk/modules/commons/gfac-schema/schemas/BasicTypes.xsd
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/schemas/BasicTypes.xsd?rev=1190045&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/schemas/BasicTypes.xsd (added)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/schemas/BasicTypes.xsd Thu Oct 27 21:38:59 2011
@@ -0,0 +1,50 @@
+<!--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. -->
+
+<schema targetNamespace="http://schemas.airavata.apache.org/gfac/type" xmlns:gfac="http://schemas.airavata.apache.org/gfac/type"
+ xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+ <element name="anyMetadata" type="xsd:anyType" />
+
+ <complexType name="authorInfoType">
+ <sequence>
+ <element name="author" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element name="modificationDate" type="xsd:dateTime" minOccurs="0" maxOccurs="1" />
+ <element name="organization" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element name="address" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element name="contactInfo" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element ref="gfac:anyMetadata" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+
+ <complexType name="documentInfoType">
+ <sequence>
+ <element name="documentName" minOccurs="1" maxOccurs="1">
+ <complexType>
+ <simpleContent>
+ <extension base="xsd:string">
+ <attribute name="targetNamespace" type="xsd:string" use="required" />
+ </extension>
+ </simpleContent>
+ </complexType>
+ </element>
+ <element name="creationDate" type="xsd:dateTime" minOccurs="0" maxOccurs="1" />
+ <element name="documentDescription" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element ref="gfac:anyMetadata" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+
+ <complexType name="nameValuePairType">
+ <sequence>
+ <element name="name" type="xsd:string" minOccurs="1" maxOccurs="1" />
+ <element name="value" type="xsd:string" minOccurs="1" maxOccurs="1" />
+ <element name="description" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ </complexType>
+
+</schema>
\ No newline at end of file
Added: incubator/airavata/trunk/modules/commons/gfac-schema/schemas/GFacParameterTypes.xsd
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/schemas/GFacParameterTypes.xsd?rev=1190045&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/schemas/GFacParameterTypes.xsd (added)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/schemas/GFacParameterTypes.xsd Thu Oct 27 21:38:59 2011
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="UTF-8"?> <!--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. -->
+
+<schema elementFormDefault="unqualified"
+ targetNamespace="http://schemas.airavata.apache.org/gfac/type" xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gfac="http://schemas.airavata.apache.org/gfac/type">
+
+ <element name="GFacParameter" type="gfac:ParameterType" />
+
+ <complexType abstract="true" name="ParameterType">
+ <sequence>
+ <element name="name" type="xsd:string" minOccurs="1" maxOccurs="1" />
+ </sequence>
+ <attribute name="type" type="gfac:DataType" use="required"/>
+ </complexType>
+
+ <simpleType name="DataType">
+ <restriction base="xsd:string">
+ <enumeration value="String" />
+ <enumeration value="Double" />
+ <enumeration value="Integer" />
+ <enumeration value="Float" />
+ <enumeration value="Boolean" />
+ <enumeration value="File" />
+ <enumeration value="StringArray" />
+ <enumeration value="DoubleArray" />
+ <enumeration value="IntegerArray" />
+ <enumeration value="FloatArray" />
+ <enumeration value="BooleanArray" />
+ <enumeration value="FileArray" />
+ <enumeration value="DataID" />
+ <enumeration value="DataIDArray" />
+ </restriction>
+ </simpleType>
+
+ <complexType name="StringParameterType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="value" nillable="true" type="xsd:string" />
+ </sequence>
+ <attribute name="type" fixed="String" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="DoubleParameterType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="value" nillable="true" type="xsd:double" />
+ </sequence>
+ <attribute name="type" fixed="Double" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="IntegerParameterType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="value" nillable="true" type="xsd:int" />
+ </sequence>
+ <attribute name="type" fixed="Integer" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="FloatParameterType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="value" nillable="true" type="xsd:float" />
+ </sequence>
+ <attribute name="type" fixed="Float" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="BooleanParameterType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="value" nillable="true" type="xsd:boolean" />
+ </sequence>
+ <attribute name="type" fixed="Boolean" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="FileParameterType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="value" nillable="true" type="xsd:anyURI" />
+ </sequence>
+ <attribute name="type" fixed="File" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="DataIDType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="value" nillable="true" type="xsd:anyURI" />
+ </sequence>
+ <attribute name="type" fixed="File" />
+ <attribute name="location" type="xsd:string" use="optional" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="StringArrayType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence >
+ <element name="value" nillable="true" maxOccurs="unbounded" type="xsd:string"/>
+ </sequence>
+ <attribute name="type" fixed="StringArray" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="DoubleArrayType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="value" nillable="true" maxOccurs="unbounded" type="xsd:double"/>
+ </sequence>
+ <attribute name="type" fixed="IntegerArray" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="IntegerArrayType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="value" nillable="true" maxOccurs="unbounded" type="xsd:int"/>
+ </sequence>
+ <attribute name="type" fixed="IntegerArray" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="FloatArrayType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="value" nillable="true" maxOccurs="unbounded" type="xsd:float"/>
+ </sequence>
+ <attribute name="type" fixed="StringArray" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="BooleanArrayType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="value" nillable="true" maxOccurs="unbounded" type="xsd:boolean"/>
+ </sequence>
+ <attribute name="type" fixed="BooleanArray" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="FileArrayType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="value" nillable="true" maxOccurs="unbounded" type="xsd:anyURI"/>
+ </sequence>
+ <attribute name="type" fixed="FileArray" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="DataIDArrayType">
+ <complexContent>
+ <extension base="gfac:ParameterType">
+ <sequence>
+ <element name="item" nillable="true" maxOccurs="unbounded" type="gfac:DataIDType"/>
+ </sequence>
+ <attribute name="type" fixed="DataIDArray" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
\ No newline at end of file
Modified: incubator/airavata/trunk/modules/commons/gfac-schema/schemas/HostDescription.xsd
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/schemas/HostDescription.xsd?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/schemas/HostDescription.xsd (original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/schemas/HostDescription.xsd Thu Oct 27 21:38:59 2011
@@ -1,38 +1,38 @@
-<!--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. -->
-
-<schema targetNamespace="http://schemas.airavata.apache.org/gfac/type"
- xmlns:gfac="http://schemas.airavata.apache.org/gfac/type" xmlns="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
-
- <element name="hostDescription" type="gfac:hostDescriptionType" />
-
- <!-- Globus Host Description -->
- <complexType name="globusHostType">
- <complexContent>
- <extension base="gfac:hostDescriptionType">
- <sequence>
- <element minOccurs="0" name="globusGateKeeperEndPoint" type="string" />
- <element minOccurs="0" name="gridFTPEndPoint" type="string" />
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Host Description -->
- <complexType name="hostDescriptionType">
- <sequence>
- <element minOccurs="0" name="name" type="string" />
- <element minOccurs="0" name="address" type="string" />
- </sequence>
- </complexType>
+<?xml version="1.0" encoding="UTF-8"?><!--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. -->
+
+<schema targetNamespace="http://schemas.airavata.apache.org/gfac/type" xmlns:gfac="http://schemas.airavata.apache.org/gfac/type"
+ xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+ <include schemaLocation="BasicTypes.xsd" />
+
+ <element name="hostDescription" type="gfac:hostDescriptionType" />
+
+ <!-- Globus Host Description -->
+ <complexType name="globusHostType">
+ <complexContent>
+ <extension base="gfac:hostDescriptionType">
+ <sequence>
+ <element name="globusGateKeeperEndPoint" type="xsd:string" minOccurs="1" maxOccurs="unbounded" />
+ <element name="gridFTPEndPoint" type="xsd:string" minOccurs="1" maxOccurs="unbounded" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Host Description -->
+ <complexType name="hostDescriptionType">
+ <sequence>
+ <element name="authorInfo" type="gfac:authorInfoType" minOccurs="0" maxOccurs="unbounded" />
+ <element name="documentInfo" type="gfac:documentInfoType" minOccurs="0" maxOccurs="1" />
+ <element name="hostName" type="xsd:string" minOccurs="1" maxOccurs="1" />
+ <element name="hostAddress" type="xsd:string" minOccurs="1" maxOccurs="1" />
+ </sequence>
+ </complexType>
</schema>
\ No newline at end of file
Added: incubator/airavata/trunk/modules/commons/gfac-schema/schemas/ServiceDescription.xsd
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/schemas/ServiceDescription.xsd?rev=1190045&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/schemas/ServiceDescription.xsd (added)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/schemas/ServiceDescription.xsd Thu Oct 27 21:38:59 2011
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?><!--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. -->
+
+<schema targetNamespace="http://schemas.airavata.apache.org/gfac/type" xmlns:gfac="http://schemas.airavata.apache.org/gfac/type"
+ xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+ <include schemaLocation="BasicTypes.xsd" />
+ <include schemaLocation="GFacParameterTypes.xsd" />
+
+ <element name="serviceDescription" type="gfac:serviceDescriptionType" />
+
+ <complexType name="serviceDescriptionType">
+ <sequence>
+ <element name="name" type="xsd:string" minOccurs="0" />
+ <element name="description" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element name="service" type="gfac:serviceType" minOccurs="1" maxOccurs="1" />
+ <element name="authorInfo" type="gfac:authorInfoType" minOccurs="0" maxOccurs="unbounded" />
+ <element name="documentInfo" type="gfac:documentInfoType" minOccurs="0" maxOccurs="1" />
+ <element name="inputParameters" type="gfac:inputParameterType" minOccurs="0" maxOccurs="unbounded" nillable="true" />
+ <element name="outputParameters" type="gfac:outputParameterType" minOccurs="0" maxOccurs="unbounded" nillable="true" />
+ </sequence>
+ </complexType>
+
+ <complexType name="serviceType">
+ <sequence>
+ <element name="serviceName" minOccurs="1" maxOccurs="1">
+ <complexType>
+ <simpleContent>
+ <extension base="xsd:string">
+ <attribute name="targetNamespace" type="xsd:string" use="required" />
+ </extension>
+ </simpleContent>
+ </complexType>
+ </element>
+ <element name="serviceDescription" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element ref="gfac:anyMetadata" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+
+ <complexType name="parameter">
+ <sequence>
+ <element name="parameterName" type="xsd:string" minOccurs="1" maxOccurs="1" />
+ <element name="parameterDescription" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <element ref="gfac:anyMetadata" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ </complexType>
+
+ <complexType name="inputParameterType">
+ <complexContent>
+ <extension base="gfac:parameter">
+ <sequence>
+ <element name="parameterType" type="gfac:ParameterType" minOccurs="1" maxOccurs="1" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="outputParameterType">
+ <complexContent>
+ <extension base="gfac:parameter">
+ <sequence>
+ <element name="parameterType" type="gfac:ParameterType" minOccurs="1" maxOccurs="1" />
+ <element name="stdOutRegExp" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
\ No newline at end of file
Modified: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ActualParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ActualParameter.java?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ActualParameter.java (original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ActualParameter.java Thu Oct 27 21:38:59 2011
@@ -21,10 +21,11 @@
package org.apache.airavata.commons.gfac.type;
+import org.apache.airavata.commons.gfac.type.Type;
import org.apache.airavata.schemas.gfac.DataType;
import org.apache.airavata.schemas.gfac.GFacParameterDocument;
import org.apache.airavata.schemas.gfac.ParameterType;
-import org.apache.airavata.schemas.gfac.StringParameter;
+import org.apache.airavata.schemas.gfac.StringParameterType;
import org.apache.xmlbeans.SchemaType;
import org.apache.xmlbeans.XmlException;
@@ -37,7 +38,7 @@ public class ActualParameter implements
this.paramDoc.addNewGFacParameter();
//default type is String
- this.paramDoc.getGFacParameter().changeType(StringParameter.type);
+ this.paramDoc.getGFacParameter().changeType(StringParameterType.type);
}
public ActualParameter(SchemaType type) {
Modified: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java (original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java Thu Oct 27 21:38:59 2011
@@ -21,13 +21,13 @@
package org.apache.airavata.commons.gfac.type;
-import org.apache.airavata.schemas.gfac.BooleanParameter;
+import org.apache.airavata.schemas.gfac.BooleanParameterType;
import org.apache.airavata.schemas.gfac.DataType;
-import org.apache.airavata.schemas.gfac.DoubleParameter;
-import org.apache.airavata.schemas.gfac.FileParameter;
-import org.apache.airavata.schemas.gfac.FloatParameter;
-import org.apache.airavata.schemas.gfac.IntegerParameter;
-import org.apache.airavata.schemas.gfac.StringParameter;
+import org.apache.airavata.schemas.gfac.DoubleParameterType;
+import org.apache.airavata.schemas.gfac.FileParameterType;
+import org.apache.airavata.schemas.gfac.FloatParameterType;
+import org.apache.airavata.schemas.gfac.IntegerParameterType;
+import org.apache.airavata.schemas.gfac.StringParameterType;
/*
* TODO use XML meta data instead of static coding
@@ -36,34 +36,34 @@ import org.apache.airavata.schemas.gfac.
public class MappingFactory {
public static String toString(ActualParameter param){
if(param.hasType(DataType.STRING)){
- return ((StringParameter)param.getType()).getValue();
+ return ((StringParameterType)param.getType()).getValue();
}else if (param.hasType(DataType.INTEGER)){
- return String.valueOf(((IntegerParameter)param.getType()).getValue());
+ return String.valueOf(((IntegerParameterType)param.getType()).getValue());
}else if (param.hasType(DataType.DOUBLE)){
- return String.valueOf(((DoubleParameter)param.getType()).getValue());
+ return String.valueOf(((DoubleParameterType)param.getType()).getValue());
}else if (param.hasType(DataType.BOOLEAN)){
- return String.valueOf(((BooleanParameter)param.getType()).getValue());
+ return String.valueOf(((BooleanParameterType)param.getType()).getValue());
}else if (param.hasType(DataType.FILE)){
- return ((FileParameter)param.getType()).getValue();
+ return ((FileParameterType)param.getType()).getValue();
}else if (param.hasType(DataType.FLOAT)){
- return String.valueOf(((FloatParameter)param.getType()).getValue());
+ return String.valueOf(((FloatParameterType)param.getType()).getValue());
}
return null;
}
public static void fromString(ActualParameter param, String val){
if(param.hasType(DataType.STRING)){
- ((StringParameter)param.getType()).setValue(val);
+ ((StringParameterType)param.getType()).setValue(val);
}else if (param.hasType(DataType.INTEGER)){
- ((IntegerParameter)param.getType()).setValue(Integer.parseInt(val));
+ ((IntegerParameterType)param.getType()).setValue(Integer.parseInt(val));
}else if (param.hasType(DataType.DOUBLE)){
- ((DoubleParameter)param.getType()).setValue(Double.parseDouble(val));
+ ((DoubleParameterType)param.getType()).setValue(Double.parseDouble(val));
}else if (param.hasType(DataType.BOOLEAN)){
- ((BooleanParameter)param.getType()).setValue(Boolean.parseBoolean(val));
+ ((BooleanParameterType)param.getType()).setValue(Boolean.parseBoolean(val));
}else if (param.hasType(DataType.FILE)){
- ((FileParameter)param.getType()).setValue(val);
+ ((FileParameterType)param.getType()).setValue(val);
}else if (param.hasType(DataType.FLOAT)){
- ((FloatParameter)param.getType()).setValue(Float.parseFloat(val));
+ ((FloatParameterType)param.getType()).setValue(Float.parseFloat(val));
}
}
}
Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java Thu Oct 27 21:38:59 2011
@@ -302,7 +302,7 @@ public class JCRRegistry extends Observa
try {
session = getSession();
Node hostNode = getHostNode(session);
- Node node = getOrAddNode(hostNode, host.getType().getName());
+ Node node = getOrAddNode(hostNode, host.getType().getHostName());
node.setProperty(XML_PROPERTY_NAME, host.toXML());
session.save();
@@ -349,7 +349,7 @@ public class JCRRegistry extends Observa
Node deployNode = getDeploymentNode(session);
Node serviceNode = getOrAddNode(deployNode, serviceId);
Node hostNode = getOrAddNode(serviceNode, hostId);
- Node appName = getOrAddNode(hostNode, app.getType().getName());
+ Node appName = getOrAddNode(hostNode, app.getType().getApplicationName().getStringValue());
appName.setProperty(XML_PROPERTY_NAME, app.toXML());
session.save();
@@ -496,7 +496,7 @@ public class JCRRegistry extends Observa
Node app = nodes.nextNode();
Property prop = app.getProperty(XML_PROPERTY_NAME);
ApplicationDeploymentDescription appDesc = ApplicationDeploymentDescription.fromXML(prop.getString());
- if (appDesc.getType().getName().matches(applicationName)) {
+ if (appDesc.getType().getApplicationName().getStringValue().matches(applicationName)) {
app.remove();
}
}
@@ -523,7 +523,7 @@ public class JCRRegistry extends Observa
Node app = nodes.nextNode();
Property prop = app.getProperty(XML_PROPERTY_NAME);
ApplicationDeploymentDescription appDesc = ApplicationDeploymentDescription.fromXML(prop.getString());
- if (appDesc.getType().getName().matches(applicationName)) {
+ if (appDesc.getType().getApplicationName().getStringValue().matches(applicationName)) {
result.add(appDesc);
}
}
Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java Thu Oct 27 21:38:59 2011
@@ -82,6 +82,7 @@ public class WebServiceUtil {
}
private static void generateElementFromType(Parameter parameter, StringBuilder builder) {
+ /*
String type = parameter.getType().getType().toString();
if (type.equals("String")) {
builder.append("<xs:element minOccurs=\"0\" name=\"");
@@ -109,7 +110,7 @@ public class WebServiceUtil {
// builder.append(parameter.getName());
// builder.append("\" nillable=\"true\" type=\"ax22:File\"/>");
}
-
+ */
}
}
Modified: incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryTest.java?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryTest.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryTest.java Thu Oct 27 21:38:59 2011
@@ -29,7 +29,10 @@ import java.util.List;
import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
import org.apache.airavata.schemas.gfac.GlobusHostType;
+import org.apache.airavata.schemas.gfac.InputParameterType;
+import org.apache.airavata.schemas.gfac.OutputParameterType;
import org.apache.airavata.schemas.gfac.Parameter;
+import org.apache.xmlbeans.XmlString;
import org.junit.Test;
public class JCRRegistryTest {
@@ -52,14 +55,14 @@ public class JCRRegistryTest {
* Host
*/
HostDescription host = new HostDescription();
- host.getType().setName(hostId);
- host.getType().setAddress(address);
+ host.getType().setHostName(hostId);
+ host.getType().setHostAddress(address);
jcrRegistry.saveHostDescription(host);
HostDescription hostR = jcrRegistry.getHostDescription(hostId);
- if (!(hostR.getType().getName().equals(hostId) && hostR.getType().getAddress().equals(address))) {
+ if (!(hostR.getType().getHostName().equals(hostId) && hostR.getType().getHostAddress().equals(address))) {
fail("Save and Load Host Description Fail with Different Value");
}
@@ -67,16 +70,17 @@ public class JCRRegistryTest {
* Test for polymorphism
*/
HostDescription globus = new HostDescription(GlobusHostType.type);
- globus.getType().setName(hostId2);
- globus.getType().setAddress(address);
+ globus.getType().setHostName(hostId2);
+ globus.getType().setHostAddress(address);
- ((GlobusHostType)globus.getType()).setGridFTPEndPoint("xxxxxxx");
+ XmlString point = ((GlobusHostType)globus.getType()).addNewGridFTPEndPoint();
+ point.setStringValue("xxxxxxx");
jcrRegistry.saveHostDescription(globus);
HostDescription hg = jcrRegistry.getHostDescription(hostId2);
- if (!(hg.getType().getName().equals(hostId2) && hg.getType().getAddress().equals(address))) {
+ if (!(hg.getType().getHostName().equals(hostId2) && hg.getType().getHostAddress().equals(address))) {
fail("Save and Load Host Description Fail with Different Value");
}
@@ -101,21 +105,19 @@ public class JCRRegistryTest {
ServiceDescription serv = new ServiceDescription();
serv.getType().setName(serviceId);
- Parameter input = Parameter.Factory.newInstance();
- input.setName("echo_input");
- input.addNewType();
- List<Parameter> inputList = new ArrayList<Parameter>();
+ InputParameterType input = InputParameterType.Factory.newInstance();
+ input.setParameterName("echo_input");
+ List<InputParameterType> inputList = new ArrayList<InputParameterType>();
inputList.add(input);
- Parameter[] inputParamList = inputList.toArray(new Parameter[inputList
+ InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
.size()]);
- Parameter output = Parameter.Factory.newInstance();
- output.setName("echo_output");
- output.addNewType();
- List<Parameter> outputList = new ArrayList<Parameter>();
+ OutputParameterType output = OutputParameterType.Factory.newInstance();
+ output.setParameterName("echo_output");
+ List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
outputList.add(output);
- Parameter[] outputParamList = outputList
- .toArray(new Parameter[outputList.size()]);
+ OutputParameterType[] outputParamList = outputList
+ .toArray(new OutputParameterType[outputList.size()]);
serv.getType().setInputParametersArray(inputParamList);
serv.getType().setOutputParametersArray(outputParamList);
Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java (original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java Thu Oct 27 21:38:59 2011
@@ -43,6 +43,7 @@ import org.apache.airavata.core.gfac.not
import org.apache.airavata.core.gfac.services.GenericService;
import org.apache.airavata.registry.api.Axis2Registry;
import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.schemas.gfac.OutputParameterType;
import org.apache.airavata.schemas.gfac.Parameter;
import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
import org.apache.airavata.schemas.wec.ContextHeaderDocument;
@@ -184,13 +185,13 @@ public class GFacMessageReciever impleme
}
for (Parameter parameter : newInputs) {
- OMElement element = input.getFirstChildWithName(new QName(parameter.getName()));
+ OMElement element = input.getFirstChildWithName(new QName(parameter.getParameterName()));
if (element == null) {
throw new Exception("Parameter is not found in the message");
}
- inputParam.add(parameter.getName(), ActualParameter.fromXML(element.getText()));
+ inputParam.add(parameter.getParameterName(), ActualParameter.fromXML(element.getText()));
}
/*
@@ -198,14 +199,14 @@ public class GFacMessageReciever impleme
*/
ParameterContextImpl outputParam = new ParameterContextImpl();
- List<Parameter> newOutputs = null;
+ List<OutputParameterType> newOutputs = null;
for (int i = 0; i < serviceDescriptionType.getOutputParametersArray().length; i++) {
newOutputs.add(serviceDescriptionType.getOutputParametersArray(i));
}
// List<Parameter> outputs = serviceDescription.getOutputParameters();
- for (Parameter parameter : newOutputs) {
- outputParam.add(parameter.getName(), new ActualParameter(parameter.getType().schemaType()));
+ for (OutputParameterType parameter : newOutputs) {
+ outputParam.add(parameter.getParameterName(), new ActualParameter(parameter.getParameterType().schemaType()));
}
invocationContext.setInput(inputParam);
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java Thu Oct 27 21:38:59 2011
@@ -32,7 +32,6 @@ import org.apache.airavata.core.gfac.con
import org.apache.airavata.core.gfac.exception.ExtensionException;
import org.apache.airavata.core.gfac.extension.DataServiceChain;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.ShellApplicationDeploymentType;
/**
* This plugin fills out all information that is missing in {@link ApplicationDeploymentDescription} based on Unix
@@ -50,45 +49,44 @@ public class RegistryDataService extends
/*
* if there is no setting in deployment description, use from host
*/
- if (appDesc.getTmpDir() == null) {
- appDesc.setTmpDir("/tmp");
+ if (appDesc.getScratchWorkingDirectory() == null) {
+ appDesc.setScratchWorkingDirectory("/tmp");
}
/*
* Working dir
*/
- if (appDesc.getWorkingDir() == null) {
+ if (appDesc.getStaticWorkingDirectory() == null) {
String date = new Date().toString();
date = date.replaceAll(" ", "_");
date = date.replaceAll(":", "_");
- String tmpDir = appDesc.getTmpDir() + File.separator + appDesc.getName() + "_" + date + "_"
- + UUID.randomUUID();
+ String tmpDir = appDesc.getScratchWorkingDirectory() + File.separator
+ + appDesc.getApplicationName().getStringValue() + "_" + date + "_" + UUID.randomUUID();
- appDesc.setWorkingDir(tmpDir);
+ appDesc.setStaticWorkingDirectory(tmpDir);
}
/*
* Input and Output Directory
*/
- if (appDesc.getInputDir() == null) {
- appDesc.setInputDir(appDesc.getWorkingDir() + File.separator + "inputData");
+ if (appDesc.getInputDataDirectory() == null) {
+ appDesc.setInputDataDirectory(appDesc.getScratchWorkingDirectory() + File.separator + "inputData");
}
- if (appDesc.getOutputDir() == null) {
- appDesc.setOutputDir(appDesc.getWorkingDir() + File.separator + "outputData");
+ if (appDesc.getOutputDataDirectory() == null) {
+ appDesc.setOutputDataDirectory(appDesc.getScratchWorkingDirectory() + File.separator + "outputData");
}
/*
* Stdout and Stderr for Shell
*/
- if (ShellApplicationDeploymentType.class.isAssignableFrom(appDesc.getClass())) {
- ShellApplicationDeploymentType shell = (ShellApplicationDeploymentType) appDesc;
- if (shell.getStdOut() == null) {
- shell.setStdOut(appDesc.getWorkingDir() + File.separator + appDesc.getName() + ".stdout");
- }
- if (shell.getStdErr() == null) {
- shell.setStdErr(appDesc.getWorkingDir() + File.separator + appDesc.getName() + ".stderr");
- }
+ if (appDesc.getStandardOutput() == null) {
+ appDesc.setStandardOutput(appDesc.getScratchWorkingDirectory() + File.separator
+ + appDesc.getApplicationName().getStringValue() + ".stdout");
+ }
+ if (appDesc.getStandardError() == null) {
+ appDesc.setStandardError(appDesc.getScratchWorkingDirectory() + File.separator
+ + appDesc.getApplicationName().getStringValue() + ".stderr");
}
} else {
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java Thu Oct 27 21:38:59 2011
@@ -39,10 +39,9 @@ import org.apache.airavata.core.gfac.ext
import org.apache.airavata.core.gfac.utils.GfacUtils;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.DataType;
-import org.apache.airavata.schemas.gfac.FileParameter;
+import org.apache.airavata.schemas.gfac.FileParameterType;
import org.apache.airavata.schemas.gfac.GlobusHostType;
import org.apache.airavata.schemas.gfac.HostDescriptionType;
-import org.apache.airavata.schemas.gfac.ShellApplicationDeploymentType;
import org.ietf.jgss.GSSCredential;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -64,16 +63,15 @@ public class GridFtpOutputStaging extend
for (Iterator<String> iterator = outputContext.getNames(); iterator.hasNext();) {
String key = iterator.next();
-
+
if (outputContext.getValue(key).hasType(DataType.FILE)) {
- FileParameter fileParameter = (FileParameter) outputContext.getValue(key).getType();
-
+ FileParameterType fileParameter = (FileParameterType) outputContext.getValue(key).getType();
+
/*
* Determine scheme
*/
URI uri = URI.create(fileParameter.getValue());
if (uri.getScheme().equalsIgnoreCase(GridFtp.GSIFTP_SCHEME)) {
-
/*
* src complete URI
@@ -81,15 +79,14 @@ public class GridFtpOutputStaging extend
File file = new File(uri.getPath());
String srcFilePath = file.getName();
- ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
- if (app instanceof ShellApplicationDeploymentType) {
- srcFilePath = app.getOutputDir() + File.separator + srcFilePath;
- }
+ ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp()
+ .getType();
+ srcFilePath = app.getOutputDataDirectory() + File.separator + srcFilePath;
HostDescriptionType hostDescription = context.getExecutionDescription().getHost().getType();
if (hostDescription instanceof GlobusHostType) {
gridFTPTransfer(context, uri, srcFilePath);
- } else if (GfacUtils.isLocalHost(hostDescription.getAddress())) {
+ } else if (GfacUtils.isLocalHost(hostDescription.getHostAddress())) {
updateFile(context, uri, srcFilePath);
}
}
@@ -116,8 +113,17 @@ public class GridFtpOutputStaging extend
GSSCredential gssCred = ((GSISecurityContext) context.getSecurityContext(MYPROXY_SECURITY_CONTEXT))
.getGssCredentails();
GlobusHostType host = (GlobusHostType) context.getExecutionDescription().getHost().getType();
- URI srcURI = GfacUtils.createGsiftpURI(host.getGridFTPEndPoint(), remoteSrcFile);
- ftp.transfer(srcURI, dest, gssCred, true);
+
+ for (String endpoint : host.getGridFTPEndPointArray()) {
+ try {
+ URI srcURI = GfacUtils.createGsiftpURI(endpoint, remoteSrcFile);
+ ftp.transfer(srcURI, dest, gssCred, true);
+ return;
+ } catch (ToolsException e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+
}
private void updateFile(InvocationContext context, URI dest, String localFile) throws SecurityException,
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java Thu Oct 27 21:38:59 2011
@@ -39,10 +39,9 @@ import org.apache.airavata.core.gfac.ext
import org.apache.airavata.core.gfac.utils.GfacUtils;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.DataType;
-import org.apache.airavata.schemas.gfac.FileParameter;
+import org.apache.airavata.schemas.gfac.FileParameterType;
import org.apache.airavata.schemas.gfac.GlobusHostType;
import org.apache.airavata.schemas.gfac.HostDescriptionType;
-import org.apache.airavata.schemas.gfac.ShellApplicationDeploymentType;
import org.ietf.jgss.GSSCredential;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -66,7 +65,7 @@ public class GridFtpInputStaging extends
for (Iterator<String> iterator = inputContext.getNames(); iterator.hasNext();) {
String key = iterator.next();
if (inputContext.getValue(key).hasType(DataType.FILE)) {
- FileParameter fileParameter = (FileParameter) inputContext.getValue(key).getType();
+ FileParameterType fileParameter = (FileParameterType) inputContext.getValue(key).getType();
/*
* Determine scheme
@@ -81,14 +80,12 @@ public class GridFtpInputStaging extends
String destFilePath = file.getName();
ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
- if (app instanceof ShellApplicationDeploymentType) {
- destFilePath = app.getInputDir() + File.separator + destFilePath;
- }
+ destFilePath = app.getInputDataDirectory() + File.separator + destFilePath;
HostDescriptionType hostDescription = context.getExecutionDescription().getHost().getType();
if (hostDescription instanceof GlobusHostType) {
gridFTPTransfer(context, uri, destFilePath);
- } else if (GfacUtils.isLocalHost(hostDescription.getAddress())) {
+ } else if (GfacUtils.isLocalHost(hostDescription.getHostAddress())) {
downloadFile(context, uri, destFilePath);
}
@@ -121,8 +118,16 @@ public class GridFtpInputStaging extends
GSSCredential gssCred = ((GSISecurityContext) context.getSecurityContext(MYPROXY_SECURITY_CONTEXT))
.getGssCredentails();
GlobusHostType host = (GlobusHostType) context.getExecutionDescription().getHost().getType();
- URI inputURI = GfacUtils.createGsiftpURI(host.getGridFTPEndPoint(), remoteFile);
- ftp.transfer(src, inputURI, gssCred, true);
+
+ for (String endpoint : host.getGridFTPEndPointArray()) {
+ try {
+ URI inputURI = GfacUtils.createGsiftpURI(endpoint, remoteFile);
+ ftp.transfer(src, inputURI, gssCred, true);
+ return;
+ } catch (ToolsException e) {
+ log.error(e.getMessage(), e);
+ }
+ }
}
private void downloadFile(InvocationContext context, URI src, String localFile) throws SecurityException,
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java Thu Oct 27 21:38:59 2011
@@ -43,10 +43,9 @@ import org.apache.airavata.core.gfac.ext
import org.apache.airavata.core.gfac.utils.GfacUtils;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.DataType;
-import org.apache.airavata.schemas.gfac.FileParameter;
+import org.apache.airavata.schemas.gfac.FileParameterType;
import org.apache.airavata.schemas.gfac.GlobusHostType;
import org.apache.airavata.schemas.gfac.HostDescriptionType;
-import org.apache.airavata.schemas.gfac.ShellApplicationDeploymentType;
import org.ietf.jgss.GSSCredential;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -70,7 +69,7 @@ public class HttpInputStaging extends Pr
for (Iterator<String> iterator = inputContext.getNames(); iterator.hasNext();) {
String key = iterator.next();
if (inputContext.getValue(key).hasType(DataType.FILE)) {
- FileParameter fileParameter = (FileParameter) inputContext.getValue(key).getType();
+ FileParameterType fileParameter = (FileParameterType) inputContext.getValue(key).getType();
/*
* Determine scheme
@@ -84,9 +83,7 @@ public class HttpInputStaging extends Pr
String destFilePath = file.getName();
ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
- if (app instanceof ShellApplicationDeploymentType) {
- destFilePath = app.getInputDir() + File.separator + destFilePath;
- }
+ destFilePath = app.getInputDataDirectory() + File.separator + destFilePath;
HostDescriptionType hostDescription = context.getExecutionDescription().getHost().getType();
if (hostDescription instanceof GlobusHostType) {
@@ -124,21 +121,28 @@ public class HttpInputStaging extends Pr
.getGssCredentails();
GlobusHostType host = (GlobusHostType) context.getExecutionDescription().getHost().getType();
- URI destURI = GfacUtils.createGsiftpURI(host.getGridFTPEndPoint(), remoteLocation);
-
- InputStream in = null;
- try {
- in = src.toURL().openStream();
- ftp.updateFile(destURI, gssCred, in);
- } finally {
+
+ for (String endpoint : host.getGridFTPEndPointArray()) {
try {
- if (in != null) {
- in.close();
+ URI destURI = GfacUtils.createGsiftpURI(endpoint, remoteLocation);
+ InputStream in = null;
+ try {
+ in = src.toURL().openStream();
+ ftp.updateFile(destURI, gssCred, in);
+ } finally {
+ try {
+ if (in != null) {
+ in.close();
+ }
+ } catch (Exception e) {
+ log.warn("Cannot close URL inputstream");
+ }
}
- } catch (Exception e) {
- log.warn("Cannot close URL inputstream");
+ return;
+ } catch (ToolsException e) {
+ log.error(e.getMessage(), e);
}
- }
+ }
}
private void downloadFile(InvocationContext context, URI src, String localFile) throws IOException {
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java Thu Oct 27 21:38:59 2011
@@ -25,6 +25,7 @@ import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.Iterator;
import java.util.Map;
import org.apache.airavata.commons.gfac.type.ActualParameter;
@@ -40,8 +41,8 @@ import org.apache.airavata.core.gfac.pro
import org.apache.airavata.core.gfac.provider.utils.JobSubmissionListener;
import org.apache.airavata.core.gfac.utils.GfacUtils;
import org.apache.airavata.core.gfac.utils.OutputUtils;
+import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.GlobusHostType;
-import org.apache.airavata.schemas.gfac.ShellApplicationDeploymentType;
import org.apache.xmlbeans.XmlException;
import org.globus.gram.GramAttributes;
import org.globus.gram.GramException;
@@ -61,8 +62,8 @@ public class GramProvider extends Abstra
private JobSubmissionListener listener;
public void makeDirectory(InvocationContext invocationContext) throws ProviderException {
- GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
- ShellApplicationDeploymentType app = (ShellApplicationDeploymentType) invocationContext.getExecutionDescription().getApp().getType();
+ GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
+ ApplicationDeploymentDescriptionType app = invocationContext.getExecutionDescription().getApp().getType();
GridFtp ftp = new GridFtp();
@@ -70,41 +71,62 @@ public class GramProvider extends Abstra
gssContext = (GSISecurityContext) invocationContext.getSecurityContext(MYPROXY_SECURITY_CONTEXT);
GSSCredential gssCred = gssContext.getGssCredentails();
- String hostgridFTP = host.getGridFTPEndPoint();
- if (host.getGridFTPEndPoint() == null) {
- hostgridFTP = host.getAddress();
- }
-
- URI tmpdirURI = GfacUtils.createGsiftpURI(hostgridFTP, app.getTmpDir());
- URI workingDirURI = GfacUtils.createGsiftpURI(hostgridFTP, app.getWorkingDir());
- URI inputURI = GfacUtils.createGsiftpURI(hostgridFTP, app.getInputDir());
- URI outputURI = GfacUtils.createGsiftpURI(hostgridFTP, app.getOutputDir());
-
- log.info("Host FTP = " + hostgridFTP);
- log.info("temp directory = " + tmpdirURI);
- log.info("Working directory = " + workingDirURI);
- log.info("Input directory = " + inputURI);
- log.info("Output directory = " + outputURI);
-
- ftp.makeDir(tmpdirURI, gssCred);
- ftp.makeDir(workingDirURI, gssCred);
- ftp.makeDir(inputURI, gssCred);
- } catch (URISyntaxException e) {
- throw new ProviderException("URI is malformatted:" + e.getMessage(), e);
+ String[] hostgridFTP = host.getGridFTPEndPointArray();
+ if (hostgridFTP == null || hostgridFTP.length == 0) {
+ hostgridFTP = new String[] { host.getHostAddress() };
+ }
+
+ boolean success = false;
+ ProviderException pe = new ProviderException("");
+
+ for (String endpoint : host.getGridFTPEndPointArray()) {
+ try {
+
+ URI tmpdirURI = GfacUtils.createGsiftpURI(endpoint, app.getScratchWorkingDirectory());
+ URI workingDirURI = GfacUtils.createGsiftpURI(endpoint, app.getStaticWorkingDirectory());
+ URI inputURI = GfacUtils.createGsiftpURI(endpoint, app.getInputDataDirectory());
+ URI outputURI = GfacUtils.createGsiftpURI(endpoint, app.getOutputDataDirectory());
+
+ log.info("Host FTP = " + hostgridFTP);
+ log.info("temp directory = " + tmpdirURI);
+ log.info("Working directory = " + workingDirURI);
+ log.info("Input directory = " + inputURI);
+ log.info("Output directory = " + outputURI);
+
+ ftp.makeDir(tmpdirURI, gssCred);
+ ftp.makeDir(workingDirURI, gssCred);
+ ftp.makeDir(inputURI, gssCred);
+ success = true;
+ break;
+ } catch (URISyntaxException e) {
+ pe = new ProviderException("URI is malformatted:" + e.getMessage(), e);
+
+ } catch (ToolsException e) {
+ pe = new ProviderException(e.getMessage(), e);
+ }
+ }
+ if (success == false) {
+ throw pe;
+ }
} catch (SecurityException e) {
throw new ProviderException(e.getMessage(), e);
- } catch (ToolsException e) {
- throw new ProviderException(e.getMessage(), e);
}
}
public void setupEnvironment(InvocationContext invocationContext) throws ProviderException {
- GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
+ GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
log.info("Searching for Gate Keeper");
- gateKeeper = host.getGlobusGateKeeperEndPoint();
- if (gateKeeper == null) {
- gateKeeper = host.getAddress();
+
+
+ String tmp[] = host.getGlobusGateKeeperEndPointArray();
+ if (tmp == null || tmp.length == 0) {
+ gateKeeper = host.getHostAddress();
+ }else{
+ /*
+ * TODO: algorithm for correct gatekeeper selection
+ */
+ gateKeeper = tmp[0];
}
log.info("Using Globus GateKeeper " + gateKeeper);
@@ -125,9 +147,9 @@ public class GramProvider extends Abstra
}
public void executeApplication(InvocationContext invocationContext) throws ProviderException {
- GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
- ShellApplicationDeploymentType app = (ShellApplicationDeploymentType) invocationContext.getExecutionDescription().getApp().getType();
-
+ GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
+ ApplicationDeploymentDescriptionType app = invocationContext.getExecutionDescription().getApp().getType();
+
StringBuffer buf = new StringBuffer();
try {
@@ -139,10 +161,10 @@ public class GramProvider extends Abstra
log.info("Request to contact:" + gateKeeper);
- buf.append("Finished launching job, Host = ").append(host.getAddress()).append(" RSL = ")
- .append(job.getRSL()).append(" working directory = ").append(app.getWorkingDir())
- .append(" tempDirectory = ").append(app.getTmpDir()).append(" Globus GateKeeper cantact = ")
- .append(gateKeeper);
+ buf.append("Finished launching job, Host = ").append(host.getHostAddress()).append(" RSL = ")
+ .append(job.getRSL()).append(" working directory = ").append(app.getStaticWorkingDirectory())
+ .append(" tempDirectory = ").append(app.getScratchWorkingDirectory())
+ .append(" Globus GateKeeper cantact = ").append(gateKeeper);
invocationContext.getExecutionContext().getNotifier().info(invocationContext, buf.toString());
/*
@@ -178,7 +200,8 @@ public class GramProvider extends Abstra
int jobStatus = listener.getStatus();
if (jobStatus == GramJob.STATUS_FAILED) {
int errCode = listener.getError();
- String errorMsg = "Job " + job.getID() + " on host " + host.getAddress() + " Error Code = " + errCode;
+ String errorMsg = "Job " + job.getID() + " on host " + host.getHostAddress() + " Error Code = "
+ + errCode;
JobSubmissionFault error = new JobSubmissionFault(this, new Exception(errorMsg), "GFAC HOST",
gateKeeper, job.getRSL());
if (errCode == 8) {
@@ -190,7 +213,7 @@ public class GramProvider extends Abstra
}
} catch (GramException e) {
- JobSubmissionFault error = new JobSubmissionFault(this, e, host.getAddress(), gateKeeper, job.getRSL());
+ JobSubmissionFault error = new JobSubmissionFault(this, e, host.getHostAddress(), gateKeeper, job.getRSL());
if (listener.getError() == 8) {
error.setReason(JobSubmissionFault.JOB_CANCEL);
} else {
@@ -215,52 +238,68 @@ public class GramProvider extends Abstra
}
public Map<String, ?> processOutput(InvocationContext invocationContext) throws ProviderException {
- GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
- ShellApplicationDeploymentType app = (ShellApplicationDeploymentType) invocationContext.getExecutionDescription().getApp().getType();
+ GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
+ ApplicationDeploymentDescriptionType app = invocationContext.getExecutionDescription().getApp().getType();
GridFtp ftp = new GridFtp();
try {
GSSCredential gssCred = gssContext.getGssCredentails();
- /*
- * Stdout and Stderror
- */
-
- String hostgridFTP = host.getGridFTPEndPoint();
- if (host.getGridFTPEndPoint() == null) {
- hostgridFTP = host.getAddress();
+ String[] hostgridFTP = host.getGridFTPEndPointArray();
+ if (hostgridFTP == null || hostgridFTP.length == 0) {
+ hostgridFTP = new String[] { host.getHostAddress() };
}
- URI stdoutURI = GfacUtils.createGsiftpURI(hostgridFTP, app.getStdOut());
- URI stderrURI = GfacUtils.createGsiftpURI(hostgridFTP, app.getStdErr());
-
- log.info("STDOUT:" + stdoutURI.toString());
- log.info("STDERR:" + stderrURI.toString());
+ boolean success = false;
+ ProviderException pe = new ProviderException("");
- File logDir = new File("./service_logs");
- if (!logDir.exists()) {
- logDir.mkdir();
- }
-
- // Get the Stdouts and StdErrs
- String timeStampedServiceName = GfacUtils.createUniqueNameForService(invocationContext.getServiceName());
- File localStdOutFile = File.createTempFile(timeStampedServiceName, "stdout");
- File localStdErrFile = File.createTempFile(timeStampedServiceName, "stderr");
+ for (String endpoint : host.getGridFTPEndPointArray()) {
- String stdout = ftp.readRemoteFile(stdoutURI, gssCred, localStdOutFile);
- String stderr = ftp.readRemoteFile(stderrURI, gssCred, localStdErrFile);
+ try {
- return OutputUtils.fillOutputFromStdout(invocationContext.<ActualParameter> getOutput(), stdout);
+ /*
+ * Stdout and Stderror
+ */
+
+ URI stdoutURI = GfacUtils.createGsiftpURI(endpoint, app.getStandardOutput());
+ URI stderrURI = GfacUtils.createGsiftpURI(endpoint, app.getStandardError());
+
+ log.info("STDOUT:" + stdoutURI.toString());
+ log.info("STDERR:" + stderrURI.toString());
+
+ File logDir = new File("./service_logs");
+ if (!logDir.exists()) {
+ logDir.mkdir();
+ }
+
+ // Get the Stdouts and StdErrs
+ String timeStampedServiceName = GfacUtils.createUniqueNameForService(invocationContext
+ .getServiceName());
+ File localStdOutFile = File.createTempFile(timeStampedServiceName, "stdout");
+ File localStdErrFile = File.createTempFile(timeStampedServiceName, "stderr");
+
+ String stdout = ftp.readRemoteFile(stdoutURI, gssCred, localStdOutFile);
+ String stderr = ftp.readRemoteFile(stderrURI, gssCred, localStdErrFile);
+
+ return OutputUtils.fillOutputFromStdout(invocationContext.<ActualParameter> getOutput(), stdout);
+ } catch (ToolsException e) {
+ throw new ProviderException(e.getMessage(), e);
+ } catch (URISyntaxException e) {
+ throw new ProviderException("URI is malformatted:" + e.getMessage(), e);
+ }
+ }
+
+ /*
+ * If the execution reach here, all GridFTP Endpoint is failed.
+ */
+ throw pe;
- } catch (XmlException e){
+ } catch (XmlException e) {
throw new ProviderException("Cannot read output:" + e.getMessage(), e);
- } catch (URISyntaxException e) {
- throw new ProviderException("URI is malformatted:" + e.getMessage(), e);
} catch (IOException e) {
throw new ProviderException(e.getMessage(), e);
} catch (SecurityException e) {
throw new ProviderException(e.getMessage(), e);
- } catch (ToolsException e) {
- throw new ProviderException(e.getMessage(), e);
}
+
}
}
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/LocalProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/LocalProvider.java?rev=1190045&r1=1190044&r2=1190045&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/LocalProvider.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/LocalProvider.java Thu Oct 27 21:38:59 2011
@@ -29,6 +29,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -42,7 +43,7 @@ import org.apache.airavata.core.gfac.uti
import org.apache.airavata.core.gfac.utils.InputUtils;
import org.apache.airavata.core.gfac.utils.OutputUtils;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.ShellApplicationDeploymentType;
+import org.apache.airavata.schemas.gfac.NameValuePairType;
import org.apache.xmlbeans.XmlException;
/**
@@ -104,17 +105,17 @@ public class LocalProvider extends Abstr
public void makeDirectory(InvocationContext invocationContext) throws ProviderException {
ApplicationDeploymentDescriptionType app = invocationContext.getExecutionDescription().getApp().getType();
- log.info("working diectroy = " + app.getWorkingDir());
- log.info("temp directory = " + app.getTmpDir());
+ log.info("working diectroy = " + app.getStaticWorkingDirectory());
+ log.info("temp directory = " + app.getScratchWorkingDirectory());
- makeFileSystemDir(app.getWorkingDir());
- makeFileSystemDir(app.getTmpDir());
- makeFileSystemDir(app.getInputDir());
- makeFileSystemDir(app.getOutputDir());
+ makeFileSystemDir(app.getStaticWorkingDirectory());
+ makeFileSystemDir(app.getScratchWorkingDirectory());
+ makeFileSystemDir(app.getInputDataDirectory());
+ makeFileSystemDir(app.getOutputDataDirectory());
}
public void setupEnvironment(InvocationContext context) throws ProviderException {
- ShellApplicationDeploymentType app = (ShellApplicationDeploymentType) context.getExecutionDescription().getApp().getType();
+ ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
// input parameter
ArrayList<String> tmp = new ArrayList<String>();
@@ -128,32 +129,35 @@ public class LocalProvider extends Abstr
/*
* Builder Command
*/
- cmdList.add(app.getExecutable());
+ cmdList.add(app.getExecutableLocation());
cmdList.addAll(tmp);
// create process builder from command
this.builder = new ProcessBuilder(cmdList);
// get the env of the host and the application
- ShellApplicationDeploymentType.Env.Entry[] env = app.getEnv().getEntryArray();
+ NameValuePairType[] env = app.getApplicationEnvironmentArray();
- Map<String, String> nv = null;
- for (int i = 0; i < env.length; i++) {
- String key = app.getEnv().getEntryArray(i).getKey();
- String value = app.getEnv().getEntryArray(i).getValue();
- nv.put(key, value);
- }
+ if (env != null) {
+ Map<String, String> nv = new HashMap<String, String>();
+ for (int i = 0; i < env.length; i++) {
+ String key = env[i].getName();
+ String value = env[i].getValue();
+ nv.put(key, value);
+ }
- if ((app.getEnv() != null) && (app.getEnv().getEntryArray().length != 0)) {
- builder.environment().putAll(nv);
+ if ((app.getApplicationEnvironmentArray() != null) && (app.getApplicationEnvironmentArray().length != 0)
+ && nv.size() > 0) {
+ builder.environment().putAll(nv);
+ }
}
// extra env's
- builder.environment().put(GFacConstants.INPUT_DATA_DIR_VAR_NAME, app.getInputDir());
- builder.environment().put(GFacConstants.OUTPUT_DATA_DIR_VAR_NAME, app.getOutputDir());
+ builder.environment().put(GFacConstants.INPUT_DATA_DIR_VAR_NAME, app.getInputDataDirectory());
+ builder.environment().put(GFacConstants.OUTPUT_DATA_DIR_VAR_NAME, app.getOutputDataDirectory());
// working directory
- builder.directory(new File(app.getWorkingDir()));
+ builder.directory(new File(app.getStaticWorkingDirectory()));
// log info
log.info("Command = " + InputUtils.buildCommand(cmdList));
@@ -164,14 +168,14 @@ public class LocalProvider extends Abstr
}
public void executeApplication(InvocationContext context) throws ProviderException {
- ShellApplicationDeploymentType app = (ShellApplicationDeploymentType) context.getExecutionDescription().getApp().getType();
+ ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
try {
// running cmd
Process process = builder.start();
- Thread t1 = new ReadStreamWriteFile(process.getInputStream(), app.getStdOut());
- Thread t2 = new ReadStreamWriteFile(process.getErrorStream(), app.getStdErr());
+ Thread t1 = new ReadStreamWriteFile(process.getInputStream(), app.getStandardOutput());
+ Thread t2 = new ReadStreamWriteFile(process.getErrorStream(), app.getStandardError());
// start output threads
t1.setDaemon(true);
@@ -198,8 +202,8 @@ public class LocalProvider extends Abstr
StringBuffer buf = new StringBuffer();
buf.append("Executed ").append(InputUtils.buildCommand(cmdList))
- .append(" on the localHost, working directory = ").append(app.getWorkingDir())
- .append(" tempDirectory = ").append(app.getTmpDir()).append(" With the status ")
+ .append(" on the localHost, working directory = ").append(app.getStaticWorkingDirectory())
+ .append(" tempDirectory = ").append(app.getScratchWorkingDirectory()).append(" With the status ")
.append(String.valueOf(returnValue));
log.info(buf.toString());
@@ -213,14 +217,14 @@ public class LocalProvider extends Abstr
public Map<String, ?> processOutput(InvocationContext context) throws ProviderException {
- ShellApplicationDeploymentType app = (ShellApplicationDeploymentType) context.getExecutionDescription().getApp().getType();
+ ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
try {
- String stdOutStr = GfacUtils.readFileToString(app.getStdOut());
+ String stdOutStr = GfacUtils.readFileToString(app.getStandardOutput());
// set to context
return OutputUtils.fillOutputFromStdout(context.<ActualParameter> getOutput(), stdOutStr);
- } catch (XmlException e){
+ } catch (XmlException e) {
throw new ProviderException("Cannot read output:" + e.getMessage(), e);
} catch (IOException io) {
throw new ProviderException(io.getMessage(), io);