You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2011/10/30 17:40:59 UTC

svn commit: r1195190 - in /incubator/airavata/trunk/modules/commons/gfac-schema: schemas/ src/main/java/org/apache/airavata/commons/gfac/type/

Author: smarru
Date: Sun Oct 30 16:40:59 2011
New Revision: 1195190

URL: http://svn.apache.org/viewvc?rev=1195190&view=rev
Log:
Adding GSISSH Host Type, improvement for AIRAVATA-161

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/ApplicationDeploymentDescription.java
    incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/HostDescription.java
    incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java
    incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ServiceDescription.java
    incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/Type.java

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=1195190&r1=1195189&r2=1195190&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/schemas/HostDescription.xsd (original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/schemas/HostDescription.xsd Sun Oct 30 16:40:59 2011
@@ -1,38 +1,62 @@
-<?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">
+<?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" />
 
+	<!-- 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>
+
 	<!-- 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" />
+					<element name="gridFTPEndPoint" type="xsd:string"
+						minOccurs="1" maxOccurs="unbounded" />
+					<element name="globusGateKeeperEndPoint" 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>
+	
+		<!-- GSISSH Host Description -->
+	<complexType name="gsisshHostType">
+		<complexContent>
+			<extension base="gfac:hostDescriptionType">
+				<sequence>
+					<element name="gridFTPEndPoint" type="xsd:string"
+						minOccurs="0" maxOccurs="unbounded" />
+					<element name="gsisshHostAddress" type="xsd:string"
+						minOccurs="1" maxOccurs="unbounded" />
+				</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=1195190&r1=1195189&r2=1195190&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 Sun Oct 30 16:40:59 2011
@@ -29,39 +29,40 @@ import org.apache.airavata.schemas.gfac.
 import org.apache.xmlbeans.SchemaType;
 import org.apache.xmlbeans.XmlException;
 
-
 public class ActualParameter implements Type {
-    private GFacParameterDocument paramDoc;
 
-    public ActualParameter() {
-        this.paramDoc = GFacParameterDocument.Factory.newInstance();
-        this.paramDoc.addNewGFacParameter();
-        
-        //default type is String
-        this.paramDoc.getGFacParameter().changeType(StringParameterType.type);
-    }
-    
-    public ActualParameter(SchemaType type) {
-        this.paramDoc = GFacParameterDocument.Factory.newInstance();
-        this.paramDoc.addNewGFacParameter();        
-        this.paramDoc.getGFacParameter().changeType(type);
-    }
-    
-    public ParameterType getType(){
-        return this.paramDoc.getGFacParameter();
-    }
-    
-    public boolean hasType(DataType.Enum type){
-        return this.paramDoc.getGFacParameter().getType() == type; 
-    }
-    
-    public String toXML(){
-        return this.paramDoc.xmlText();
-    }
-    
-    public static ActualParameter fromXML(String xml) throws XmlException{
-        ActualParameter param = new ActualParameter();
-        param.paramDoc = GFacParameterDocument.Factory.parse(xml);
-        return param;
-    }
+	private static final long serialVersionUID = -6022759981837350675L;
+	private GFacParameterDocument paramDoc;
+
+	public ActualParameter() {
+		this.paramDoc = GFacParameterDocument.Factory.newInstance();
+		this.paramDoc.addNewGFacParameter();
+
+		// default type is String
+		this.paramDoc.getGFacParameter().changeType(StringParameterType.type);
+	}
+
+	public ActualParameter(SchemaType type) {
+		this.paramDoc = GFacParameterDocument.Factory.newInstance();
+		this.paramDoc.addNewGFacParameter();
+		this.paramDoc.getGFacParameter().changeType(type);
+	}
+
+	public ParameterType getType() {
+		return this.paramDoc.getGFacParameter();
+	}
+
+	public boolean hasType(DataType.Enum type) {
+		return this.paramDoc.getGFacParameter().getType() == type;
+	}
+
+	public String toXML() {
+		return this.paramDoc.xmlText();
+	}
+
+	public static ActualParameter fromXML(String xml) throws XmlException {
+		ActualParameter param = new ActualParameter();
+		param.paramDoc = GFacParameterDocument.Factory.parse(xml);
+		return param;
+	}
 }
\ No newline at end of file

Modified: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ApplicationDeploymentDescription.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ApplicationDeploymentDescription.java?rev=1195190&r1=1195189&r2=1195190&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ApplicationDeploymentDescription.java (original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ApplicationDeploymentDescription.java Sun Oct 30 16:40:59 2011
@@ -31,26 +31,29 @@ public class ApplicationDeploymentDescri
 	private ApplicationDeploymentDescriptionDocument appDocument;
 
 	public ApplicationDeploymentDescription() {
-		this.appDocument = ApplicationDeploymentDescriptionDocument.Factory.newInstance();
+		this.appDocument = ApplicationDeploymentDescriptionDocument.Factory
+				.newInstance();
 		this.appDocument.addNewApplicationDeploymentDescription();
 	}
 
-	public ApplicationDeploymentDescription(SchemaType type){
+	public ApplicationDeploymentDescription(SchemaType type) {
 		this();
 		this.appDocument.getApplicationDeploymentDescription().changeType(type);
 	}
-	
-	public ApplicationDeploymentDescriptionType getType(){
+
+	public ApplicationDeploymentDescriptionType getType() {
 		return this.appDocument.getApplicationDeploymentDescription();
 	}
-	
-	public String toXML(){
+
+	public String toXML() {
 		return appDocument.xmlText();
 	}
-	
-	public static ApplicationDeploymentDescription fromXML(String xml) throws XmlException{
+
+	public static ApplicationDeploymentDescription fromXML(String xml)
+			throws XmlException {
 		ApplicationDeploymentDescription app = new ApplicationDeploymentDescription();
-		app.appDocument = ApplicationDeploymentDescriptionDocument.Factory.parse(xml);
+		app.appDocument = ApplicationDeploymentDescriptionDocument.Factory
+				.parse(xml);
 		return app;
 	}
 }

Modified: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/HostDescription.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/HostDescription.java?rev=1195190&r1=1195189&r2=1195190&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/HostDescription.java (original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/HostDescription.java Sun Oct 30 16:40:59 2011
@@ -34,21 +34,21 @@ public class HostDescription implements 
 		this.hostDocument = HostDescriptionDocument.Factory.newInstance();
 		this.hostDocument.addNewHostDescription();
 	}
-	
+
 	public HostDescription(SchemaType type) {
 		this();
 		this.hostDocument.getHostDescription().changeType(type);
 	}
 
-	public HostDescriptionType getType(){
+	public HostDescriptionType getType() {
 		return this.hostDocument.getHostDescription();
 	}
-	
-	public String toXML(){
+
+	public String toXML() {
 		return hostDocument.xmlText();
 	}
-	
-	public static HostDescription fromXML(String xml) throws XmlException{
+
+	public static HostDescription fromXML(String xml) throws XmlException {
 		HostDescription host = new HostDescription();
 		host.hostDocument = HostDescriptionDocument.Factory.parse(xml);
 		return host;

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=1195190&r1=1195189&r2=1195190&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 Sun Oct 30 16:40:59 2011
@@ -34,36 +34,44 @@ import org.apache.airavata.schemas.gfac.
  * 
  */
 public class MappingFactory {
-	public static String toString(ActualParameter param){
-		if(param.hasType(DataType.STRING)){
-			return ((StringParameterType)param.getType()).getValue();
-		}else if (param.hasType(DataType.INTEGER)){
-			return String.valueOf(((IntegerParameterType)param.getType()).getValue());
-		}else if (param.hasType(DataType.DOUBLE)){
-			return String.valueOf(((DoubleParameterType)param.getType()).getValue());
-		}else if (param.hasType(DataType.BOOLEAN)){
-			return String.valueOf(((BooleanParameterType)param.getType()).getValue());
-		}else if (param.hasType(DataType.FILE)){
-			return ((FileParameterType)param.getType()).getValue();
-		}else if (param.hasType(DataType.FLOAT)){
-			return String.valueOf(((FloatParameterType)param.getType()).getValue());
+	public static String toString(ActualParameter param) {
+		if (param.hasType(DataType.STRING)) {
+			return ((StringParameterType) param.getType()).getValue();
+		} else if (param.hasType(DataType.INTEGER)) {
+			return String.valueOf(((IntegerParameterType) param.getType())
+					.getValue());
+		} else if (param.hasType(DataType.DOUBLE)) {
+			return String.valueOf(((DoubleParameterType) param.getType())
+					.getValue());
+		} else if (param.hasType(DataType.BOOLEAN)) {
+			return String.valueOf(((BooleanParameterType) param.getType())
+					.getValue());
+		} else if (param.hasType(DataType.FILE)) {
+			return ((FileParameterType) param.getType()).getValue();
+		} else if (param.hasType(DataType.FLOAT)) {
+			return String.valueOf(((FloatParameterType) param.getType())
+					.getValue());
 		}
 		return null;
 	}
-	
-	public static void fromString(ActualParameter param, String val){
-		if(param.hasType(DataType.STRING)){
-			((StringParameterType)param.getType()).setValue(val);
-		}else if (param.hasType(DataType.INTEGER)){
-			((IntegerParameterType)param.getType()).setValue(Integer.parseInt(val));
-		}else if (param.hasType(DataType.DOUBLE)){
-			((DoubleParameterType)param.getType()).setValue(Double.parseDouble(val));
-		}else if (param.hasType(DataType.BOOLEAN)){
-			((BooleanParameterType)param.getType()).setValue(Boolean.parseBoolean(val));
-		}else if (param.hasType(DataType.FILE)){
-			((FileParameterType)param.getType()).setValue(val);
-		}else if (param.hasType(DataType.FLOAT)){
-			((FloatParameterType)param.getType()).setValue(Float.parseFloat(val));
+
+	public static void fromString(ActualParameter param, String val) {
+		if (param.hasType(DataType.STRING)) {
+			((StringParameterType) param.getType()).setValue(val);
+		} else if (param.hasType(DataType.INTEGER)) {
+			((IntegerParameterType) param.getType()).setValue(Integer
+					.parseInt(val));
+		} else if (param.hasType(DataType.DOUBLE)) {
+			((DoubleParameterType) param.getType()).setValue(Double
+					.parseDouble(val));
+		} else if (param.hasType(DataType.BOOLEAN)) {
+			((BooleanParameterType) param.getType()).setValue(Boolean
+					.parseBoolean(val));
+		} else if (param.hasType(DataType.FILE)) {
+			((FileParameterType) param.getType()).setValue(val);
+		} else if (param.hasType(DataType.FLOAT)) {
+			((FloatParameterType) param.getType()).setValue(Float
+					.parseFloat(val));
 		}
 	}
 }

Modified: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ServiceDescription.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ServiceDescription.java?rev=1195190&r1=1195189&r2=1195190&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ServiceDescription.java (original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ServiceDescription.java Sun Oct 30 16:40:59 2011
@@ -27,6 +27,7 @@ import org.apache.xmlbeans.XmlException;
 
 public class ServiceDescription implements Type {
 
+	private static final long serialVersionUID = -4365350045872875217L;
 	private ServiceDescriptionDocument serviceDocument;
 
 	public ServiceDescription() {
@@ -34,15 +35,15 @@ public class ServiceDescription implemen
 		this.serviceDocument.addNewServiceDescription();
 	}
 
-	public ServiceDescriptionType getType(){
+	public ServiceDescriptionType getType() {
 		return this.serviceDocument.getServiceDescription();
 	}
-	
-	public String toXML(){
+
+	public String toXML() {
 		return serviceDocument.xmlText();
 	}
-	
-	public static ServiceDescription fromXML(String xml) throws XmlException{
+
+	public static ServiceDescription fromXML(String xml) throws XmlException {
 		ServiceDescription service = new ServiceDescription();
 		service.serviceDocument = ServiceDescriptionDocument.Factory.parse(xml);
 		return service;

Modified: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/Type.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/Type.java?rev=1195190&r1=1195189&r2=1195190&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/Type.java (original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/Type.java Sun Oct 30 16:40:59 2011
@@ -23,5 +23,5 @@ package org.apache.airavata.commons.gfac
 
 import java.io.Serializable;
 
-public interface Type extends Serializable {	
+public interface Type extends Serializable {
 }