airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hes...@apache.org
Subject svn commit: r1403350 - /airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/DescriptorUtil.java
Date Mon, 29 Oct 2012 15:09:59 GMT
Author: heshan
Date: Mon Oct 29 15:09:58 2012
New Revision: 1403350

URL: http://svn.apache.org/viewvc?rev=1403350&view=rev
Log:
Adding a util class.

Added:
    airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/DescriptorUtil.java

Added: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/DescriptorUtil.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/DescriptorUtil.java?rev=1403350&view=auto
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/DescriptorUtil.java
(added)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/DescriptorUtil.java
Mon Oct 29 15:09:58 2012
@@ -0,0 +1,25 @@
+package org.apache.airavata.services.registry.rest.utils;
+
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.schemas.gfac.GlobusHostType;
+
+public class DescriptorUtil {
+
+    public static HostDescription createHostDescription(String hostName, String hostAddress,
+                                                        String hostEndpoint, String gatekeeperEndpoint)
{
+        HostDescription host = new HostDescription();
+        if("".equalsIgnoreCase(gatekeeperEndpoint) || "".equalsIgnoreCase(hostEndpoint))
{
+            host.getType().changeType(GlobusHostType.type);
+            host.getType().setHostName(hostName);
+            host.getType().setHostAddress(hostAddress);
+            ((GlobusHostType) host.getType()).
+                    setGridFTPEndPointArray(new String[]{hostEndpoint});
+            ((GlobusHostType) host.getType()).
+                    setGlobusGateKeeperEndPointArray(new String[]{gatekeeperEndpoint});
+        } else {
+            host.getType().setHostName(hostName);
+            host.getType().setHostAddress(hostAddress);
+        }
+        return host;
+    }
+}



Mime
View raw message