airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject svn commit: r1139550 [4/6] - in /incubator/airavata/core/trunk/gfac: ./ .settings/ src/main/java/org/apache/airavata/core/gfac/context/ src/main/java/org/apache/airavata/core/gfac/context/impl/ src/main/java/org/apache/airavata/core/gfac/context/impl/u...
Date Sat, 25 Jun 2011 15:17:38 GMT
Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/registry/impl/XregistryServiceWrapper.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/registry/impl/XregistryServiceWrapper.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/registry/impl/XregistryServiceWrapper.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/registry/impl/XregistryServiceWrapper.java Sat Jun 25 15:17:35 2011
@@ -1,3 +1,24 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.airavata.core.gfac.registry.impl;
 
 import java.io.File;
@@ -26,372 +47,389 @@ import xregistry.generated.WsdlData;
 
 public class XregistryServiceWrapper implements RegistryService {
 
-	private XRegistryClient xregistryClient;
+    private XRegistryClient xregistryClient;
 
-	public XregistryServiceWrapper(String xregistryUrl, String trustedCertFile, GSSCredential sessionCredentail) throws GfacException {
-		try {
-			if (sessionCredentail != null && trustedCertFile != null) {
-				if (new File(trustedCertFile).isFile()) {
-					this.xregistryClient = new XRegistryClient(sessionCredentail, trustedCertFile, xregistryUrl);
-				} else {
-					TrustedCertificates certificates = TrustedCertificates.load(trustedCertFile);
-					TrustedCertificates.setDefaultTrustedCertificates(certificates);
-					X509Certificate[] trustedCertificates = certificates.getCertificates();
-					System.out.println("xregistryUrl=" + xregistryUrl);
-					System.out.println("trustedCertificates=" + trustedCertificates);
-					this.xregistryClient = new XRegistryClient(sessionCredentail, trustedCertificates, xregistryUrl);
-				}
-			} else {
-				throw new GfacException("Neither host certificate of gss credential is set", FaultCode.ErrorAtDependentService);
-			}
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-	
-	public XregistryServiceWrapper(String xregistryUrl, String trustedCertFile, String hostcertsKeyFile) throws GfacException {
-		try {
-			if (hostcertsKeyFile != null && trustedCertFile != null) {
-				if (new File(trustedCertFile).isFile()) {
-					this.xregistryClient = new XRegistryClient(hostcertsKeyFile, trustedCertFile, xregistryUrl);
-				} else {
-					TrustedCertificates certificates = TrustedCertificates.load(trustedCertFile);
-					TrustedCertificates.setDefaultTrustedCertificates(certificates);
-					X509Certificate[] trustedCertificates = certificates.getCertificates();
-					System.out.println("xregistryUrl=" + xregistryUrl);
-					System.out.println("hostcertsKeyFile=" + hostcertsKeyFile);
-					System.out.println("trustedCertificates=" + trustedCertificates);
-					this.xregistryClient = new XRegistryClient(hostcertsKeyFile, trustedCertificates, xregistryUrl);
-				}
-			} else {
-				throw new GfacException("Neither host certificate of gss credential is set", FaultCode.ErrorAtDependentService);
-			}
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public String[] app2Hosts(String appName) throws GfacException {
-		try {
-			return xregistryClient.app2Hosts(appName);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public String[] findAppDesc(String query) throws GfacException {
-		try {
-
-			FindAppDescResponseDocument.FindAppDescResponse.AppData[] xregAppDesc = xregistryClient.findAppDesc(query);
-			AppData[] appDesc = null;
-			if (xregAppDesc != null) {
-				List<AppData> appDescList = new ArrayList<AppData>();
-				for (int i = 0; i < xregAppDesc.length; i++) {
-					try {
-						FindAppDescResponseDocument.FindAppDescResponse.AppData xbeansData = xregAppDesc[i];
-						AppData resultAppData = new AppData(xbeansData.getName(), xbeansData.getOwner(), xbeansData.getHostName());
-						resultAppData.allowedAction = xbeansData.getAllowedAction();
-						resultAppData.resourceID = xbeansData.getName();
-						appDescList.add(resultAppData);
-					} catch (XmlValueOutOfRangeException e) {
-						throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(), FaultCode.ErrorAtDependentService);
-					}
-				}
-				appDesc = appDescList.toArray(new AppData[0]);
-			} else {
-				return null;
-			}
-
-			String[] finalResults = new String[appDesc.length];
-			for (int i = 0; i < appDesc.length; i++) {
-				finalResults[i] = appDesc[i].name + "#" + appDesc[i].secondryName;
-			}
-			return finalResults;
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public String[] findService(String serviceName) throws GfacException {
-		try {
-			WsdlData[] serviceInstanceData = xregistryClient.findServiceInstance(serviceName);
-			String[] results = new String[serviceInstanceData.length];
-			for (int i = 0; i < serviceInstanceData.length; i++) {
-				try {
-					results[i] = serviceInstanceData[i].getName().toString();
-				} catch (XmlValueOutOfRangeException e) {
-					throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(), FaultCode.ErrorAtDependentService);
-				}
-			}
-			return results;
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public String[] findServiceDesc(String serviceName) throws GfacException {
-		try {
-			ServiceDescData[] serviceDescData = xregistryClient.findServiceDesc(serviceName);
-			String[] results = new String[serviceDescData.length];
-			for (int i = 0; i < serviceDescData.length; i++) {
-				try {
-					results[i] = serviceDescData[i].getName().toString();
-				} catch (XmlValueOutOfRangeException e) {
-					throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(), FaultCode.ErrorAtDependentService);
-				}
-			}
-			return results;
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public String getAbstractWsdl(String wsdlQName) throws GfacException {
-		try {
-			return xregistryClient.getAbstractWsdl(QName.valueOf(wsdlQName));
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public String getAppDesc(String appQName, String hostName) throws GfacException {
-		try {
-			return xregistryClient.getAppDesc(appQName, hostName);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public String getConcreateWsdl(String wsdlQName) throws GfacException {
-		try {
-			return xregistryClient.getConcreateWsdl(QName.valueOf(wsdlQName));
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public String getHostDesc(String hostName) throws GfacException {
-		try {
-			return xregistryClient.getHostDesc(hostName);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public String getServiceMap(String serviceQName) throws GfacException {
-		try {
-			return xregistryClient.getServiceDesc(QName.valueOf(serviceQName));
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public String[] listApps() throws GfacException {
-		return findAppDesc("");
-	}
-
-	public String[] listAwsdl() throws GfacException {
-		return findServiceDesc("");
-	}
-
-	public String[] listHosts() throws GfacException {
-		try {
-			HostDescData[] hostDescData = xregistryClient.findHosts("");
-			String[] results = new String[hostDescData.length];
-			for (int i = 0; i < hostDescData.length; i++) {
-				try {
-					results[i] = hostDescData[i].getName().toString();
-				} catch (XmlValueOutOfRangeException e) {
-					throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(), FaultCode.ErrorAtDependentService);
-				}
-			}
-			return results;
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public void registerAppDesc(String appDescAsStr) throws GfacException {
-		try {
-			xregistryClient.registerAppDesc(appDescAsStr);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public void registerConcreteWsdl(String wsdlAsStr, int lifetimeAsSeconds) throws GfacException {
-		try {
-			xregistryClient.registerConcreteWsdl(wsdlAsStr, lifetimeAsSeconds);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public void registerOutputFiles(QName resourceId, String resourceName, String resourceType, String resourceDesc, String resourceDocument, String resourceParentTypedID, String owner) throws GfacException {
-		try {
-			xregistryClient.registerOGCEResource(resourceId, resourceName, resourceType, resourceDesc, resourceDocument, resourceParentTypedID, owner);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public void registerHostDesc(String hostDescAsStr) throws GfacException {
-		try {
-			xregistryClient.registerHostDesc(hostDescAsStr);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public void registerServiceMap(String serviceMapAsStr, String abstractWsdlAsString) throws GfacException {
-		try {
-			xregistryClient.registerServiceDesc(serviceMapAsStr, abstractWsdlAsString);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public void removeAppDesc(String appQName, String hostName) throws GfacException {
-		try {
-			xregistryClient.removeAppDesc(QName.valueOf(appQName), hostName);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public void removeAwsdl(String wsdlQName) throws GfacException {
-		throw new UnsupportedOperationException();
-	}
-
-	public void removeConcreteWsdl(String wsdlQName) throws GfacException {
-		try {
-			xregistryClient.removeConcreteWsdl(QName.valueOf(wsdlQName));
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public void removeHostDesc(String hostName) throws GfacException {
-		try {
-			xregistryClient.removeHostDesc(hostName);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public void removeServiceMap(String serviceQName) throws GfacException {
-		try {
-			xregistryClient.removeServiceDesc(QName.valueOf(serviceQName));
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public boolean isAuthorizedToAcsses(String resourceID, String actor, String action) throws GfacException {
-		try {
-			return xregistryClient.isAuthorizedToAcsses(null, resourceID, actor, action);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public void addCapability(String resource, String actor, boolean isUser, String action) throws GfacException {
-		try {
-			xregistryClient.addCapability(resource, actor, isUser, action);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public CapabilityToken[] getCapability(String resource, String actor, boolean isUser, String action) throws GfacException {
-		try {
-			return xregistryClient.findCapability(resource, actor, isUser, action);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public void removeCapability(String resourceID, String actor) throws GfacException {
-		try {
-			xregistryClient.removeCapability(resourceID, actor);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public AppData[] xfindAppDesc(String query) throws GfacException {
-		try {
-			xregistry.generated.FindAppDescResponseDocument.FindAppDescResponse.AppData[] xregAppDesc = xregistryClient.findAppDesc(query);
-			AppData[] appDesc = null;
-			if (xregAppDesc != null) {
-				List<AppData> appDescList = new ArrayList<AppData>();
-				for (int i = 0; i < xregAppDesc.length; i++) {
-					try {
-						xregistry.generated.FindAppDescResponseDocument.FindAppDescResponse.AppData xbeansData = xregAppDesc[i];
-						AppData resultAppData = new AppData(xbeansData.getName(), xbeansData.getOwner(), xbeansData.getHostName());
-						resultAppData.allowedAction = xbeansData.getAllowedAction();
-						resultAppData.resourceID = xbeansData.getName();
-						appDescList.add(resultAppData);
-					} catch (XmlValueOutOfRangeException e) {
-						throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(), FaultCode.ErrorAtDependentService);
-					}
-				}
-				appDesc = appDescList.toArray(new AppData[0]);
-			} else {
-				return null;
-			}
-			return appDesc;
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public DocData[] xfindHostDesc(String query) throws GfacException {
-		try {
-			HostDescData[] hostDescData = xregistryClient.findHosts(query);
-			if (hostDescData == null) {
-				return null;
-			}
-
-			List<DocData> results = new ArrayList<DocData>();
-			for (int i = 0; i < hostDescData.length; i++) {
-				try {
-					HostDescData host = hostDescData[i];
-					DocData data = new DocData(new QName(host.getResourceID()), host.getOwner());
-					data.allowedAction = host.getAllowedAction();
-					data.resourceID = new QName(host.getResourceID());
-					results.add(data);
-				} catch (XmlValueOutOfRangeException e) {
-					throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(), FaultCode.ErrorAtDependentService);
-				}
-			}
-			return results.toArray(new DocData[0]);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
-
-	public DocData[] xfindServiceDesc(String query) throws GfacException {
-		try {
-			ServiceDescData[] serviceDescData = xregistryClient.findServiceDesc(query);
-			if (serviceDescData == null) {
-				return null;
-			}
-			List<DocData> results = new ArrayList<DocData>();
-			for (int i = 0; i < serviceDescData.length; i++) {
-				try {
-					DocData data = new DocData(serviceDescData[i].getName(), serviceDescData[i].getOwner());
-					data.allowedAction = serviceDescData[i].getAllowedAction();
-					data.resourceID = serviceDescData[i].getName();
-					results.add(data);
-				} catch (XmlValueOutOfRangeException e) {
-					throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(), FaultCode.ErrorAtDependentService);
-				}
-			}
-			return results.toArray(new DocData[0]);
-		} catch (XRegistryClientException e) {
-			throw new GfacException(e, FaultCode.ErrorAtDependentService);
-		}
-	}
+    public XregistryServiceWrapper(String xregistryUrl, String trustedCertFile, GSSCredential sessionCredentail)
+            throws GfacException {
+        try {
+            if (sessionCredentail != null && trustedCertFile != null) {
+                if (new File(trustedCertFile).isFile()) {
+                    this.xregistryClient = new XRegistryClient(sessionCredentail, trustedCertFile, xregistryUrl);
+                } else {
+                    TrustedCertificates certificates = TrustedCertificates.load(trustedCertFile);
+                    TrustedCertificates.setDefaultTrustedCertificates(certificates);
+                    X509Certificate[] trustedCertificates = certificates.getCertificates();
+                    System.out.println("xregistryUrl=" + xregistryUrl);
+                    System.out.println("trustedCertificates=" + trustedCertificates);
+                    this.xregistryClient = new XRegistryClient(sessionCredentail, trustedCertificates, xregistryUrl);
+                }
+            } else {
+                throw new GfacException("Neither host certificate of gss credential is set",
+                        FaultCode.ErrorAtDependentService);
+            }
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public XregistryServiceWrapper(String xregistryUrl, String trustedCertFile, String hostcertsKeyFile)
+            throws GfacException {
+        try {
+            if (hostcertsKeyFile != null && trustedCertFile != null) {
+                if (new File(trustedCertFile).isFile()) {
+                    this.xregistryClient = new XRegistryClient(hostcertsKeyFile, trustedCertFile, xregistryUrl);
+                } else {
+                    TrustedCertificates certificates = TrustedCertificates.load(trustedCertFile);
+                    TrustedCertificates.setDefaultTrustedCertificates(certificates);
+                    X509Certificate[] trustedCertificates = certificates.getCertificates();
+                    System.out.println("xregistryUrl=" + xregistryUrl);
+                    System.out.println("hostcertsKeyFile=" + hostcertsKeyFile);
+                    System.out.println("trustedCertificates=" + trustedCertificates);
+                    this.xregistryClient = new XRegistryClient(hostcertsKeyFile, trustedCertificates, xregistryUrl);
+                }
+            } else {
+                throw new GfacException("Neither host certificate of gss credential is set",
+                        FaultCode.ErrorAtDependentService);
+            }
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public String[] app2Hosts(String appName) throws GfacException {
+        try {
+            return xregistryClient.app2Hosts(appName);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public String[] findAppDesc(String query) throws GfacException {
+        try {
+
+            FindAppDescResponseDocument.FindAppDescResponse.AppData[] xregAppDesc = xregistryClient.findAppDesc(query);
+            AppData[] appDesc = null;
+            if (xregAppDesc != null) {
+                List<AppData> appDescList = new ArrayList<AppData>();
+                for (int i = 0; i < xregAppDesc.length; i++) {
+                    try {
+                        FindAppDescResponseDocument.FindAppDescResponse.AppData xbeansData = xregAppDesc[i];
+                        AppData resultAppData = new AppData(xbeansData.getName(), xbeansData.getOwner(),
+                                xbeansData.getHostName());
+                        resultAppData.allowedAction = xbeansData.getAllowedAction();
+                        resultAppData.resourceID = xbeansData.getName();
+                        appDescList.add(resultAppData);
+                    } catch (XmlValueOutOfRangeException e) {
+                        throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(),
+                                FaultCode.ErrorAtDependentService);
+                    }
+                }
+                appDesc = appDescList.toArray(new AppData[0]);
+            } else {
+                return null;
+            }
+
+            String[] finalResults = new String[appDesc.length];
+            for (int i = 0; i < appDesc.length; i++) {
+                finalResults[i] = appDesc[i].name + "#" + appDesc[i].secondryName;
+            }
+            return finalResults;
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public String[] findService(String serviceName) throws GfacException {
+        try {
+            WsdlData[] serviceInstanceData = xregistryClient.findServiceInstance(serviceName);
+            String[] results = new String[serviceInstanceData.length];
+            for (int i = 0; i < serviceInstanceData.length; i++) {
+                try {
+                    results[i] = serviceInstanceData[i].getName().toString();
+                } catch (XmlValueOutOfRangeException e) {
+                    throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(),
+                            FaultCode.ErrorAtDependentService);
+                }
+            }
+            return results;
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public String[] findServiceDesc(String serviceName) throws GfacException {
+        try {
+            ServiceDescData[] serviceDescData = xregistryClient.findServiceDesc(serviceName);
+            String[] results = new String[serviceDescData.length];
+            for (int i = 0; i < serviceDescData.length; i++) {
+                try {
+                    results[i] = serviceDescData[i].getName().toString();
+                } catch (XmlValueOutOfRangeException e) {
+                    throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(),
+                            FaultCode.ErrorAtDependentService);
+                }
+            }
+            return results;
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public String getAbstractWsdl(String wsdlQName) throws GfacException {
+        try {
+            return xregistryClient.getAbstractWsdl(QName.valueOf(wsdlQName));
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public String getAppDesc(String appQName, String hostName) throws GfacException {
+        try {
+            return xregistryClient.getAppDesc(appQName, hostName);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public String getConcreateWsdl(String wsdlQName) throws GfacException {
+        try {
+            return xregistryClient.getConcreateWsdl(QName.valueOf(wsdlQName));
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public String getHostDesc(String hostName) throws GfacException {
+        try {
+            return xregistryClient.getHostDesc(hostName);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public String getServiceMap(String serviceQName) throws GfacException {
+        try {
+            return xregistryClient.getServiceDesc(QName.valueOf(serviceQName));
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public String[] listApps() throws GfacException {
+        return findAppDesc("");
+    }
+
+    public String[] listAwsdl() throws GfacException {
+        return findServiceDesc("");
+    }
+
+    public String[] listHosts() throws GfacException {
+        try {
+            HostDescData[] hostDescData = xregistryClient.findHosts("");
+            String[] results = new String[hostDescData.length];
+            for (int i = 0; i < hostDescData.length; i++) {
+                try {
+                    results[i] = hostDescData[i].getName().toString();
+                } catch (XmlValueOutOfRangeException e) {
+                    throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(),
+                            FaultCode.ErrorAtDependentService);
+                }
+            }
+            return results;
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public void registerAppDesc(String appDescAsStr) throws GfacException {
+        try {
+            xregistryClient.registerAppDesc(appDescAsStr);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public void registerConcreteWsdl(String wsdlAsStr, int lifetimeAsSeconds) throws GfacException {
+        try {
+            xregistryClient.registerConcreteWsdl(wsdlAsStr, lifetimeAsSeconds);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public void registerOutputFiles(QName resourceId, String resourceName, String resourceType, String resourceDesc,
+            String resourceDocument, String resourceParentTypedID, String owner) throws GfacException {
+        try {
+            xregistryClient.registerOGCEResource(resourceId, resourceName, resourceType, resourceDesc,
+                    resourceDocument, resourceParentTypedID, owner);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public void registerHostDesc(String hostDescAsStr) throws GfacException {
+        try {
+            xregistryClient.registerHostDesc(hostDescAsStr);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public void registerServiceMap(String serviceMapAsStr, String abstractWsdlAsString) throws GfacException {
+        try {
+            xregistryClient.registerServiceDesc(serviceMapAsStr, abstractWsdlAsString);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public void removeAppDesc(String appQName, String hostName) throws GfacException {
+        try {
+            xregistryClient.removeAppDesc(QName.valueOf(appQName), hostName);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public void removeAwsdl(String wsdlQName) throws GfacException {
+        throw new UnsupportedOperationException();
+    }
+
+    public void removeConcreteWsdl(String wsdlQName) throws GfacException {
+        try {
+            xregistryClient.removeConcreteWsdl(QName.valueOf(wsdlQName));
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public void removeHostDesc(String hostName) throws GfacException {
+        try {
+            xregistryClient.removeHostDesc(hostName);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public void removeServiceMap(String serviceQName) throws GfacException {
+        try {
+            xregistryClient.removeServiceDesc(QName.valueOf(serviceQName));
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public boolean isAuthorizedToAcsses(String resourceID, String actor, String action) throws GfacException {
+        try {
+            return xregistryClient.isAuthorizedToAcsses(null, resourceID, actor, action);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public void addCapability(String resource, String actor, boolean isUser, String action) throws GfacException {
+        try {
+            xregistryClient.addCapability(resource, actor, isUser, action);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public CapabilityToken[] getCapability(String resource, String actor, boolean isUser, String action)
+            throws GfacException {
+        try {
+            return xregistryClient.findCapability(resource, actor, isUser, action);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public void removeCapability(String resourceID, String actor) throws GfacException {
+        try {
+            xregistryClient.removeCapability(resourceID, actor);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public AppData[] xfindAppDesc(String query) throws GfacException {
+        try {
+            xregistry.generated.FindAppDescResponseDocument.FindAppDescResponse.AppData[] xregAppDesc = xregistryClient
+                    .findAppDesc(query);
+            AppData[] appDesc = null;
+            if (xregAppDesc != null) {
+                List<AppData> appDescList = new ArrayList<AppData>();
+                for (int i = 0; i < xregAppDesc.length; i++) {
+                    try {
+                        xregistry.generated.FindAppDescResponseDocument.FindAppDescResponse.AppData xbeansData = xregAppDesc[i];
+                        AppData resultAppData = new AppData(xbeansData.getName(), xbeansData.getOwner(),
+                                xbeansData.getHostName());
+                        resultAppData.allowedAction = xbeansData.getAllowedAction();
+                        resultAppData.resourceID = xbeansData.getName();
+                        appDescList.add(resultAppData);
+                    } catch (XmlValueOutOfRangeException e) {
+                        throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(),
+                                FaultCode.ErrorAtDependentService);
+                    }
+                }
+                appDesc = appDescList.toArray(new AppData[0]);
+            } else {
+                return null;
+            }
+            return appDesc;
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public DocData[] xfindHostDesc(String query) throws GfacException {
+        try {
+            HostDescData[] hostDescData = xregistryClient.findHosts(query);
+            if (hostDescData == null) {
+                return null;
+            }
+
+            List<DocData> results = new ArrayList<DocData>();
+            for (int i = 0; i < hostDescData.length; i++) {
+                try {
+                    HostDescData host = hostDescData[i];
+                    DocData data = new DocData(new QName(host.getResourceID()), host.getOwner());
+                    data.allowedAction = host.getAllowedAction();
+                    data.resourceID = new QName(host.getResourceID());
+                    results.add(data);
+                } catch (XmlValueOutOfRangeException e) {
+                    throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(),
+                            FaultCode.ErrorAtDependentService);
+                }
+            }
+            return results.toArray(new DocData[0]);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
+
+    public DocData[] xfindServiceDesc(String query) throws GfacException {
+        try {
+            ServiceDescData[] serviceDescData = xregistryClient.findServiceDesc(query);
+            if (serviceDescData == null) {
+                return null;
+            }
+            List<DocData> results = new ArrayList<DocData>();
+            for (int i = 0; i < serviceDescData.length; i++) {
+                try {
+                    DocData data = new DocData(serviceDescData[i].getName(), serviceDescData[i].getOwner());
+                    data.allowedAction = serviceDescData[i].getAllowedAction();
+                    data.resourceID = serviceDescData[i].getName();
+                    results.add(data);
+                } catch (XmlValueOutOfRangeException e) {
+                    throw new GfacException("Problem with retrieving object : " + e.getLocalizedMessage(),
+                            FaultCode.ErrorAtDependentService);
+                }
+            }
+            return results.toArray(new DocData[0]);
+        } catch (XRegistryClientException e) {
+            throw new GfacException(e, FaultCode.ErrorAtDependentService);
+        }
+    }
 
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/scheduler/Scheduler.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/scheduler/Scheduler.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/scheduler/Scheduler.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/scheduler/Scheduler.java Sat Jun 25 15:17:35 2011
@@ -1,3 +1,24 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.airavata.core.gfac.scheduler;
 
 import org.apache.airavata.core.gfac.context.InvocationContext;
@@ -5,5 +26,5 @@ import org.apache.airavata.core.gfac.exc
 import org.apache.airavata.core.gfac.provider.Provider;
 
 public interface Scheduler {
-	public Provider schedule(InvocationContext context) throws GfacException;
+    public Provider schedule(InvocationContext context) throws GfacException;
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java Sat Jun 25 15:17:35 2011
@@ -1,3 +1,24 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.airavata.core.gfac.scheduler.impl;
 
 import javax.xml.namespace.QName;
@@ -17,67 +38,69 @@ import org.ogce.schemas.gfac.documents.S
 
 public class SchedulerImpl implements Scheduler {
 
-	public Provider schedule(InvocationContext context) throws GfacException {
+    public Provider schedule(InvocationContext context) throws GfacException {
 
-		String hostName = null;
+        String hostName = null;
 
-		/*
-		 * Load host and app description from registry
-		 */
-		RegistryService registryService = context.getExecutionContext().getRegistryService();
-		String serviceMapStr = registryService.getServiceMap(context.getServiceName());
-
-		if (serviceMapStr != null) {
-			try {
-				
-				ServiceMapType serviceMap = ServiceMapDocument.Factory.parse(serviceMapStr).getServiceMap();
-				QName appName = GfacUtils.findApplcationName(serviceMap);				
-
-				// host name
-				hostName = findHostFromServiceMap(registryService, appName);			
-				
-			} catch (XmlException e) {
-				throw new GfacException(e, FaultCode.InitalizationError);
-			}
-		} else {
-			throw new GfacException("Service Map for " + context.getServiceName() + " does not found on resource Catalog " + registryService, FaultCode.InvalidRequest);
-		}
-
-		
-		/*
-		 * Determine provider
-		 */
-		if (GfacUtils.isLocalHost(hostName)) {
-			return new LocalProvider();
-		} else {
-			// set Security context for executionContext
-			if (context.getSecurityContext(GramProvider.MYPROXY_SECURITY_CONTEXT) != null) {
-				context.getExecutionContext().setSecurityContext(context.getSecurityContext(GramProvider.MYPROXY_SECURITY_CONTEXT));
-			} else {
-				throw new GfacException("Cannot get security context to run on Gram", FaultCode.InvalidRequest);
-			}
-
-			return new GramProvider();
-		}
-	}
-
-	private String findHostFromServiceMap(RegistryService regService, QName appName) throws GfacException {
-
-		System.out.println("Searching registry for some deployed application hosts\n");
-		String[] hosts = regService.app2Hosts(appName.toString());
-		if (hosts.length > 1) {
-			String hostNames = "";
-			for (int i = 0; i < hosts.length; i++) {
-				hostNames = hostNames + hosts[i];
-			}
-			System.out.println("Application deployed on more than one machine. The full Host list is " + hostNames + "\n");
-		}
-		if (hosts.length >= 1) {
-			System.out.println("Found Host = " + hosts[0]);
-			return hosts[0];
-		} else {
-			System.out.println("Applcation  " + appName.getLocalPart() + " not found in registry");
-			return null;
-		}
-	}
+        /*
+         * Load host and app description from registry
+         */
+        RegistryService registryService = context.getExecutionContext().getRegistryService();
+        String serviceMapStr = registryService.getServiceMap(context.getServiceName());
+
+        if (serviceMapStr != null) {
+            try {
+
+                ServiceMapType serviceMap = ServiceMapDocument.Factory.parse(serviceMapStr).getServiceMap();
+                QName appName = GfacUtils.findApplcationName(serviceMap);
+
+                // host name
+                hostName = findHostFromServiceMap(registryService, appName);
+
+            } catch (XmlException e) {
+                throw new GfacException(e, FaultCode.InitalizationError);
+            }
+        } else {
+            throw new GfacException("Service Map for " + context.getServiceName()
+                    + " does not found on resource Catalog " + registryService, FaultCode.InvalidRequest);
+        }
+
+        /*
+         * Determine provider
+         */
+        if (GfacUtils.isLocalHost(hostName)) {
+            return new LocalProvider();
+        } else {
+            // set Security context for executionContext
+            if (context.getSecurityContext(GramProvider.MYPROXY_SECURITY_CONTEXT) != null) {
+                context.getExecutionContext().setSecurityContext(
+                        context.getSecurityContext(GramProvider.MYPROXY_SECURITY_CONTEXT));
+            } else {
+                throw new GfacException("Cannot get security context to run on Gram", FaultCode.InvalidRequest);
+            }
+
+            return new GramProvider();
+        }
+    }
+
+    private String findHostFromServiceMap(RegistryService regService, QName appName) throws GfacException {
+
+        System.out.println("Searching registry for some deployed application hosts\n");
+        String[] hosts = regService.app2Hosts(appName.toString());
+        if (hosts.length > 1) {
+            String hostNames = "";
+            for (int i = 0; i < hosts.length; i++) {
+                hostNames = hostNames + hosts[i];
+            }
+            System.out.println("Application deployed on more than one machine. The full Host list is " + hostNames
+                    + "\n");
+        }
+        if (hosts.length >= 1) {
+            System.out.println("Found Host = " + hosts[0]);
+            return hosts[0];
+        } else {
+            System.out.println("Applcation  " + appName.getLocalPart() + " not found in registry");
+            return null;
+        }
+    }
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/services/GenericService.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/services/GenericService.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/services/GenericService.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/services/GenericService.java Sat Jun 25 15:17:35 2011
@@ -1,13 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.airavata.core.gfac.services;
 
 import org.apache.airavata.core.gfac.context.InvocationContext;
 import org.apache.airavata.core.gfac.exception.GfacException;
 
 public interface GenericService {
-	
-	public void init() throws GfacException;
-	
-	public void execute(InvocationContext context) throws GfacException;
-	
-	public void dispose() throws GfacException;	
-}
\ No newline at end of file
+
+    public void init() throws GfacException;
+
+    public void execute(InvocationContext context) throws GfacException;
+
+    public void dispose() throws GfacException;
+}

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/services/impl/AbstractSimpleService.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/services/impl/AbstractSimpleService.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/services/impl/AbstractSimpleService.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/services/impl/AbstractSimpleService.java Sat Jun 25 15:17:35 2011
@@ -1,3 +1,24 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.airavata.core.gfac.services.impl;
 
 import org.apache.airavata.core.gfac.context.InvocationContext;
@@ -12,84 +33,84 @@ import org.apache.airavata.core.gfac.ser
 
 public abstract class AbstractSimpleService implements GenericService {
 
-	public abstract void preProcess(InvocationContext context) throws GfacException;
-	
-	public abstract void postProcess(InvocationContext context) throws GfacException;
-	
-	public abstract Scheduler getScheduler(InvocationContext context) throws GfacException;
-
-	public abstract PreExecuteChain[] getPreExecutionSteps(InvocationContext context) throws GfacException;
-
-	public abstract PostExecuteChain[] getPostExecuteSteps(InvocationContext context) throws GfacException;
-
-	public abstract DataServiceChain[] getDataChains(InvocationContext context) throws GfacException;
-
-	public final void execute(InvocationContext context) throws GfacException {
-		
-		/*
-		 * Pre-Process
-		 */
-		preProcess(context);
-		
-		/*
-		 * Determine provider
-		 */
-		Provider provider = getScheduler(context).schedule(context);
-
-		/*
-		 * Load data necessary data
-		 */
-		buildChains(getDataChains(context)).start(context);
-
-		/*
-		 * Init
-		 */
-		provider.initialize(context);
-
-		/*
-		 * Pre-Execution
-		 */
-		buildChains(getPreExecutionSteps(context)).start(context);
-
-		/*
-		 * Execute
-		 */
-		provider.execute(context);
-
-		/*
-		 * Post-Execution
-		 */
-		buildChains(getPostExecuteSteps(context)).start(context);
-
-		/*
-		 * Destroy
-		 */
-		provider.dispose(context);
-		
-		/*
-		 * Pre-Process
-		 */
-		postProcess(context);
-	}
-
-	private ExitableChain buildChains(ExitableChain[] list) {
-
-		/*
-		 * Validation check and return doing-nothing chain object
-		 */
-		if (list == null || list.length == 0) {
-			return new ExitableChain() {
-				@Override
-				protected boolean execute(InvocationContext context) {
-					return true;
-				}
-			};
-		}
-
-		ExitableChain currentPoint = list[0];
-		for (int i = 1; i < list.length; i++) {
-			currentPoint = currentPoint.setNext(list[i]);
-		}
-		return currentPoint;
-	}
+    public abstract void preProcess(InvocationContext context) throws GfacException;
+
+    public abstract void postProcess(InvocationContext context) throws GfacException;
+
+    public abstract Scheduler getScheduler(InvocationContext context) throws GfacException;
+
+    public abstract PreExecuteChain[] getPreExecutionSteps(InvocationContext context) throws GfacException;
+
+    public abstract PostExecuteChain[] getPostExecuteSteps(InvocationContext context) throws GfacException;
+
+    public abstract DataServiceChain[] getDataChains(InvocationContext context) throws GfacException;
+
+    public final void execute(InvocationContext context) throws GfacException {
+
+        /*
+         * Pre-Process
+         */
+        preProcess(context);
+
+        /*
+         * Determine provider
+         */
+        Provider provider = getScheduler(context).schedule(context);
+
+        /*
+         * Load data necessary data
+         */
+        buildChains(getDataChains(context)).start(context);
+
+        /*
+         * Init
+         */
+        provider.initialize(context);
+
+        /*
+         * Pre-Execution
+         */
+        buildChains(getPreExecutionSteps(context)).start(context);
+
+        /*
+         * Execute
+         */
+        provider.execute(context);
+
+        /*
+         * Post-Execution
+         */
+        buildChains(getPostExecuteSteps(context)).start(context);
+
+        /*
+         * Destroy
+         */
+        provider.dispose(context);
+
+        /*
+         * Pre-Process
+         */
+        postProcess(context);
+    }
+
+    private ExitableChain buildChains(ExitableChain[] list) {
+
+        /*
+         * Validation check and return doing-nothing chain object
+         */
+        if (list == null || list.length == 0) {
+            return new ExitableChain() {
+                @Override
+                protected boolean execute(InvocationContext context) {
+                    return true;
+                }
+            };
+        }
+
+        ExitableChain currentPoint = list[0];
+        for (int i = 1; i < list.length; i++) {
+            currentPoint = currentPoint.setNext(list[i]);
+        }
+        return currentPoint;
+    }
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImpl.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImpl.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImpl.java Sat Jun 25 15:17:35 2011
@@ -1,3 +1,24 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.airavata.core.gfac.services.impl;
 
 import java.lang.reflect.Array;
@@ -16,222 +37,219 @@ import org.apache.airavata.core.gfac.reg
 import org.apache.airavata.core.gfac.scheduler.Scheduler;
 
 /**
- * This generic service implementation will load Registry service and Data
- * Catalog from property file. It selects provider and execute it base on
- * execution context.
- * 
- * @author Patanachai Tangchaisin
+ * This generic service implementation will load Registry service and Data Catalog from property file. It selects
+ * provider and execute it base on execution context.
  * 
  */
 public class PropertiesBasedServiceImpl extends AbstractSimpleService {
 
-	private static final String FILENAME = "service.properties";
-	public static final String REGISTY_URL_NAME = "registryURL";
-	public static final String SSL_TRUSTED_CERTS_FILE = "ssl.trustedCertsFile";
-	public static final String SSL_HOSTCERTS_KEY_FILE = "ssl.hostcertsKeyFile";
-	public static final String SCHEDULER_CLASS = "scheduler.class";
-	public static final String DATA_CHAIN_CLASS = "datachain.classes";
-	public static final String PRE_CHAIN_CLASS = "prechain.classes";
-	public static final String POST_CHAIN_CLASS = "postchain.classes";
-
-	private Properties properties;
-	private Scheduler scheduler;
-	private PreExecuteChain[] preChain;
-	private PostExecuteChain[] postChain;
-	private DataServiceChain[] dataChain;
-	
-	private RegistryService registryService;
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.airavata.core.gfac.services.GenericService#init(org.apache.airavata.core.gfac.context.
-	 * InvocationContext)
-	 */
-	public void init() throws GfacException {
-		/*
-		 * Load properties and create XRegistry service
-		 */
-		try {
-			URL url = ClassLoader.getSystemResource(FILENAME);
-
-			this.properties = new Properties();
-			this.properties.load(url.openStream());
-
-			String registryURL = loadFromProperty(REGISTY_URL_NAME, true);
-			String trustcerts = loadFromProperty(SSL_TRUSTED_CERTS_FILE, true);
-			String hostcerts = loadFromProperty(SSL_HOSTCERTS_KEY_FILE, true);
-
-			this.registryService = new XregistryServiceWrapper(registryURL, trustcerts, hostcerts);
-
-		} catch (Exception e) {
-			throw new GfacException("Error initialize the generic service", e);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.airavata.core.gfac.services.GenericService#dispose(org.apache.airavata.core.gfac.context.
-	 * InvocationContext)
-	 */
-	public void dispose() throws GfacException {
-		// TODO Auto-generated method stub
-
-	}
-
-	@Override
-	public void preProcess(InvocationContext context) throws GfacException {
-		//set Fix Registry location for every requests 
-		context.getExecutionContext().setRegistryService(this.registryService);		
-	}
-
-	@Override
-	public void postProcess(InvocationContext context) throws GfacException {
-		// TODO Auto-generated method stub		
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.airavata.core.gfac.services.GenericService#getScheduler(org.apache.airavata.core.gfac.context
-	 * .InvocationContext)
-	 */
-	public Scheduler getScheduler(InvocationContext context) throws GfacException {
-		String className = null;
-		if (this.scheduler == null) {
-			/*
-			 * get class names
-			 */
-			className = loadFromProperty(SCHEDULER_CLASS, true);
-
-			/*
-			 * init instance of that class
-			 */
-			try {
-				ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-				Class<? extends Scheduler> spiClass;
-
-				if (classLoader == null) {
-					spiClass = Class.forName(className).asSubclass(Scheduler.class);
-				} else {
-					spiClass = classLoader.loadClass(className).asSubclass(Scheduler.class);
-				}
-
-				this.scheduler = spiClass.newInstance();
-
-			} catch (ClassNotFoundException ex) {
-				throw new GfacException("Scheduler " + className + " not found", ex);
-			} catch (Exception ex) {
-				throw new GfacException("Scheduler " + className + " could not be instantiated: " + ex, ex);
-			}
-		}
-		return this.scheduler;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.airavata.core.gfac.services.GenericService#getPreExecutionSteps(org.ogce.gfac
-	 * .context.InvocationContext)
-	 */
-	public PreExecuteChain[] getPreExecutionSteps(InvocationContext context) throws GfacException {
-		if (this.preChain == null) {
-			this.preChain = loadClassFromProperties(PRE_CHAIN_CLASS, PreExecuteChain.class);
-		}
-		return preChain;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.airavata.core.gfac.services.GenericService#getPostExecuteSteps(org.ogce.gfac
-	 * .context.InvocationContext)
-	 */
-	public PostExecuteChain[] getPostExecuteSteps(InvocationContext context) throws GfacException {
-		if (this.postChain == null) {
-			this.postChain = loadClassFromProperties(POST_CHAIN_CLASS, PostExecuteChain.class);
-		}
-		return postChain;
-	}
-	
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.apache.airavata.core.gfac.services.impl.OGCEGenericService#getDataChains(org.apache.airavata.core.gfac.context.InvocationContext)
-	 */
-	public DataServiceChain[] getDataChains(InvocationContext context) throws GfacException {
-		if(this.dataChain == null){
-			this.dataChain = loadClassFromProperties(DATA_CHAIN_CLASS, DataServiceChain.class);
-		}
-		return dataChain;
-	}
-
-	/**
-	 * 
-	 * @param propertyName
-	 * @param required
-	 * @return
-	 * @throws GfacException
-	 */
-	private String loadFromProperty(String propertyName, boolean required) throws GfacException {
-		String propValue = this.properties.getProperty(propertyName);
-		if (propValue == null) {
-			if (required)
-				throw new GfacException("Property \"" + propertyName + "\" is not found", FaultCode.InvalidConfig);
-			return null;
-		}
-		return propValue;
-	}
-
-	/**
-	 * 
-	 */
-	@SuppressWarnings("unchecked")
-	private <T> T[] loadClassFromProperties(String propertyName, Class<? extends ExitableChain> type) throws GfacException {
-
-		// property is not set
-		String propValue = loadFromProperty(propertyName, false);
-		if (propValue == null) {
-			return null;
-		}
-
-		/*
-		 * get class names
-		 */
-		String classNames[] = this.properties.getProperty(propertyName).split(",");		
-
-		/*
-		 * init instance of that class
-		 */
-		T[] chain = (T[]) Array.newInstance(type, classNames.length);
-		for (int i = 0; i < classNames.length; i++) {
-
-			String className = classNames[i];
-			System.out.println(className);
-
-			try {
-				ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-				Class<? extends ExitableChain> spiClass;
-
-				if (classLoader == null) {
-					spiClass = Class.forName(className).asSubclass(ExitableChain.class);
-				} else {
-					spiClass = classLoader.loadClass(className).asSubclass(ExitableChain.class);
-				}
-
-				chain[i] = (T) spiClass.newInstance();
-			} catch (ClassNotFoundException ex) {
-				ex.printStackTrace();
-				// TODO proper throw out
-			} catch (Exception ex) {
-				ex.printStackTrace();
-				// TODO proper throw out
-			}
-		}
-		return chain;
-	}
+    private static final String FILENAME = "service.properties";
+    public static final String REGISTY_URL_NAME = "registryURL";
+    public static final String SSL_TRUSTED_CERTS_FILE = "ssl.trustedCertsFile";
+    public static final String SSL_HOSTCERTS_KEY_FILE = "ssl.hostcertsKeyFile";
+    public static final String SCHEDULER_CLASS = "scheduler.class";
+    public static final String DATA_CHAIN_CLASS = "datachain.classes";
+    public static final String PRE_CHAIN_CLASS = "prechain.classes";
+    public static final String POST_CHAIN_CLASS = "postchain.classes";
+
+    private Properties properties;
+    private Scheduler scheduler;
+    private PreExecuteChain[] preChain;
+    private PostExecuteChain[] postChain;
+    private DataServiceChain[] dataChain;
+
+    private RegistryService registryService;
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.core.gfac.services.GenericService#init(org.apache.airavata.core.gfac.context.
+     * InvocationContext)
+     */
+    public void init() throws GfacException {
+        /*
+         * Load properties and create XRegistry service
+         */
+        try {
+            URL url = ClassLoader.getSystemResource(FILENAME);
+
+            this.properties = new Properties();
+            this.properties.load(url.openStream());
+
+            String registryURL = loadFromProperty(REGISTY_URL_NAME, true);
+            String trustcerts = loadFromProperty(SSL_TRUSTED_CERTS_FILE, true);
+            String hostcerts = loadFromProperty(SSL_HOSTCERTS_KEY_FILE, true);
+
+            this.registryService = new XregistryServiceWrapper(registryURL, trustcerts, hostcerts);
+
+        } catch (Exception e) {
+            throw new GfacException("Error initialize the generic service", e);
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.core.gfac.services.GenericService#dispose(org.apache.airavata.core.gfac.context.
+     * InvocationContext)
+     */
+    public void dispose() throws GfacException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void preProcess(InvocationContext context) throws GfacException {
+        // set Fix Registry location for every requests
+        context.getExecutionContext().setRegistryService(this.registryService);
+    }
+
+    @Override
+    public void postProcess(InvocationContext context) throws GfacException {
+        // TODO Auto-generated method stub
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.core.gfac.services.GenericService#getScheduler(org.apache.airavata.core.gfac.context
+     * .InvocationContext)
+     */
+    public Scheduler getScheduler(InvocationContext context) throws GfacException {
+        String className = null;
+        if (this.scheduler == null) {
+            /*
+             * get class names
+             */
+            className = loadFromProperty(SCHEDULER_CLASS, true);
+
+            /*
+             * init instance of that class
+             */
+            try {
+                ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+                Class<? extends Scheduler> spiClass;
+
+                if (classLoader == null) {
+                    spiClass = Class.forName(className).asSubclass(Scheduler.class);
+                } else {
+                    spiClass = classLoader.loadClass(className).asSubclass(Scheduler.class);
+                }
+
+                this.scheduler = spiClass.newInstance();
+
+            } catch (ClassNotFoundException ex) {
+                throw new GfacException("Scheduler " + className + " not found", ex);
+            } catch (Exception ex) {
+                throw new GfacException("Scheduler " + className + " could not be instantiated: " + ex, ex);
+            }
+        }
+        return this.scheduler;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.core.gfac.services.GenericService#getPreExecutionSteps(org.ogce.gfac
+     * .context.InvocationContext)
+     */
+    public PreExecuteChain[] getPreExecutionSteps(InvocationContext context) throws GfacException {
+        if (this.preChain == null) {
+            this.preChain = loadClassFromProperties(PRE_CHAIN_CLASS, PreExecuteChain.class);
+        }
+        return preChain;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.core.gfac.services.GenericService#getPostExecuteSteps(org.ogce.gfac
+     * .context.InvocationContext)
+     */
+    public PostExecuteChain[] getPostExecuteSteps(InvocationContext context) throws GfacException {
+        if (this.postChain == null) {
+            this.postChain = loadClassFromProperties(POST_CHAIN_CLASS, PostExecuteChain.class);
+        }
+        return postChain;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.airavata.core.gfac.services.impl.OGCEGenericService#getDataChains(org.apache.airavata.core.gfac.context
+     * .InvocationContext)
+     */
+    public DataServiceChain[] getDataChains(InvocationContext context) throws GfacException {
+        if (this.dataChain == null) {
+            this.dataChain = loadClassFromProperties(DATA_CHAIN_CLASS, DataServiceChain.class);
+        }
+        return dataChain;
+    }
+
+    /**
+     * 
+     * @param propertyName
+     * @param required
+     * @return
+     * @throws GfacException
+     */
+    private String loadFromProperty(String propertyName, boolean required) throws GfacException {
+        String propValue = this.properties.getProperty(propertyName);
+        if (propValue == null) {
+            if (required)
+                throw new GfacException("Property \"" + propertyName + "\" is not found", FaultCode.InvalidConfig);
+            return null;
+        }
+        return propValue;
+    }
+
+    /**
+	 * 
+	 */
+    @SuppressWarnings("unchecked")
+    private <T> T[] loadClassFromProperties(String propertyName, Class<? extends ExitableChain> type)
+            throws GfacException {
+
+        // property is not set
+        String propValue = loadFromProperty(propertyName, false);
+        if (propValue == null) {
+            return null;
+        }
+
+        /*
+         * get class names
+         */
+        String classNames[] = this.properties.getProperty(propertyName).split(",");
+
+        /*
+         * init instance of that class
+         */
+        T[] chain = (T[]) Array.newInstance(type, classNames.length);
+        for (int i = 0; i < classNames.length; i++) {
+
+            String className = classNames[i];
+            System.out.println(className);
+
+            try {
+                ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+                Class<? extends ExitableChain> spiClass;
+
+                if (classLoader == null) {
+                    spiClass = Class.forName(className).asSubclass(ExitableChain.class);
+                } else {
+                    spiClass = classLoader.loadClass(className).asSubclass(ExitableChain.class);
+                }
+
+                chain[i] = (T) spiClass.newInstance();
+            } catch (ClassNotFoundException ex) {
+                ex.printStackTrace();
+                // TODO proper throw out
+            } catch (Exception ex) {
+                ex.printStackTrace();
+                // TODO proper throw out
+            }
+        }
+        return chain;
+    }
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/BooleanParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/BooleanParameter.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/BooleanParameter.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/BooleanParameter.java Sat Jun 25 15:17:35 2011
@@ -1,29 +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.
+ *
+ */
+
 package org.apache.airavata.core.gfac.type;
 
 public class BooleanParameter implements Parameter<Boolean> {
-	
-	private final static String TYPE = "Boolean";
-	
-	private Boolean value;
-
-	@Override
-	public void fromString(String val) {
-		this.value = Boolean.parseBoolean(val);
-	}
-
-	@Override
-	public String toString() {
-		return this.value.toString();
-	}
-
-	@Override
-	public Boolean toJavaObject() {
-		return this.value;
-	}
-
-	@Override
-	public String getTypeName() {
-		return TYPE;
-	}
+
+    private final static String TYPE = "Boolean";
+
+    private Boolean value;
+
+    @Override
+    public void fromString(String val) {
+        this.value = Boolean.parseBoolean(val);
+    }
+
+    @Override
+    public String toString() {
+        return this.value.toString();
+    }
+
+    @Override
+    public Boolean toJavaObject() {
+        return this.value;
+    }
+
+    @Override
+    public String getTypeName() {
+        return TYPE;
+    }
 
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/DoubleParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/DoubleParameter.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/DoubleParameter.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/DoubleParameter.java Sat Jun 25 15:17:35 2011
@@ -1,28 +1,49 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.airavata.core.gfac.type;
 
 public class DoubleParameter implements Parameter<Double> {
-	
-	private final static String TYPE = "Interger";
-	
-	private Double value;
-
-	@Override
-	public void fromString(String val) {
-		this.value = Double.parseDouble(val);
-	}
-
-	@Override
-	public String toString() {
-		return this.value.toString();
-	}
-
-	@Override
-	public Double toJavaObject() {
-		return this.value;
-	}
-
-	@Override
-	public String getTypeName() {
-		return TYPE;
-	}	
+
+    private final static String TYPE = "Interger";
+
+    private Double value;
+
+    @Override
+    public void fromString(String val) {
+        this.value = Double.parseDouble(val);
+    }
+
+    @Override
+    public String toString() {
+        return this.value.toString();
+    }
+
+    @Override
+    public Double toJavaObject() {
+        return this.value;
+    }
+
+    @Override
+    public String getTypeName() {
+        return TYPE;
+    }
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/FloatParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/FloatParameter.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/FloatParameter.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/FloatParameter.java Sat Jun 25 15:17:35 2011
@@ -1,28 +1,49 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.airavata.core.gfac.type;
 
 public class FloatParameter implements Parameter<Float> {
-	
-	private final static String TYPE = "Float";
-	
-	private Float value;
-
-	@Override
-	public void fromString(String val) {
-		this.value = Float.parseFloat(val);
-	}
-
-	@Override
-	public String toString() {
-		return this.value.toString();
-	}
-
-	@Override
-	public Float toJavaObject() {
-		return this.value;
-	}
-	
-	@Override
-	public String getTypeName() {
-		return TYPE;
-	}	
+
+    private final static String TYPE = "Float";
+
+    private Float value;
+
+    @Override
+    public void fromString(String val) {
+        this.value = Float.parseFloat(val);
+    }
+
+    @Override
+    public String toString() {
+        return this.value.toString();
+    }
+
+    @Override
+    public Float toJavaObject() {
+        return this.value;
+    }
+
+    @Override
+    public String getTypeName() {
+        return TYPE;
+    }
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/IntegerParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/IntegerParameter.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/IntegerParameter.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/IntegerParameter.java Sat Jun 25 15:17:35 2011
@@ -1,29 +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.
+ *
+ */
+
 package org.apache.airavata.core.gfac.type;
 
 public class IntegerParameter implements Parameter<Integer> {
-	
-	private final static String TYPE = "Interger";
-	
-	private Integer value;
-
-	@Override
-	public void fromString(String val) {
-		this.value = Integer.parseInt(val);
-	}
-
-	@Override
-	public String toString() {
-		return this.value.toString();
-	}
-
-	@Override
-	public Integer toJavaObject() {
-		return this.value;
-	}
-	
-	@Override
-	public String getTypeName() {
-		return TYPE;
-	}	
+
+    private final static String TYPE = "Interger";
+
+    private Integer value;
+
+    @Override
+    public void fromString(String val) {
+        this.value = Integer.parseInt(val);
+    }
+
+    @Override
+    public String toString() {
+        return this.value.toString();
+    }
+
+    @Override
+    public Integer toJavaObject() {
+        return this.value;
+    }
+
+    @Override
+    public String getTypeName() {
+        return TYPE;
+    }
 
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/Parameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/Parameter.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/Parameter.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/Parameter.java Sat Jun 25 15:17:35 2011
@@ -1,12 +1,33 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.airavata.core.gfac.type;
 
 public interface Parameter<T> {
-	
-	public String getTypeName();
-	
-	public void fromString(String val);
-	
-	public String toString();
-	
-	public T toJavaObject();
+
+    public String getTypeName();
+
+    public void fromString(String val);
+
+    public String toString();
+
+    public T toJavaObject();
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/StringParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/StringParameter.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/StringParameter.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/StringParameter.java Sat Jun 25 15:17:35 2011
@@ -1,30 +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.
+ *
+ */
+
 package org.apache.airavata.core.gfac.type;
 
-public class StringParameter implements Parameter<String> {	
-	
-	private final static String TYPE = "String";
-	
-	private String value;
-
-	@Override
-	public void fromString(String val) {
-		this.value = val;
-	}
-
-	@Override
-	public String toString() {
-		return this.value;
-	}
-
-	@Override
-	public String toJavaObject() {
-		return this.value;
-	}
-
-	@Override
-	public String getTypeName() {
-		return TYPE;
-	}	
-	
-}
+public class StringParameter implements Parameter<String> {
+
+    private final static String TYPE = "String";
 
+    private String value;
+
+    @Override
+    public void fromString(String val) {
+        this.value = val;
+    }
+
+    @Override
+    public String toString() {
+        return this.value;
+    }
+
+    @Override
+    public String toJavaObject() {
+        return this.value;
+    }
+
+    @Override
+    public String getTypeName() {
+        return TYPE;
+    }
+
+}

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/URIParameter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/URIParameter.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/URIParameter.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/type/URIParameter.java Sat Jun 25 15:17:35 2011
@@ -1,36 +1,57 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.airavata.core.gfac.type;
 
 import java.net.URI;
 import java.net.URISyntaxException;
 
 public class URIParameter implements Parameter<URI> {
-	
-	private final static String TYPE = "URI";
-	
-	private URI value;
-
-	@Override
-	public void fromString(String val) {
-		try{
-			this.value = new URI(val);
-		}catch (URISyntaxException ue){
-			//TODO handle exception
-			ue.printStackTrace();			
-		}
-	}
-
-	@Override
-	public String toString() {
-		return this.value.toString();
-	}
-
-	@Override
-	public URI toJavaObject() {
-		return this.value;
-	}
-
-	@Override
-	public String getTypeName() {
-		return TYPE;
-	}			
+
+    private final static String TYPE = "URI";
+
+    private URI value;
+
+    @Override
+    public void fromString(String val) {
+        try {
+            this.value = new URI(val);
+        } catch (URISyntaxException ue) {
+            // TODO handle exception
+            ue.printStackTrace();
+        }
+    }
+
+    @Override
+    public String toString() {
+        return this.value.toString();
+    }
+
+    @Override
+    public URI toJavaObject() {
+        return this.value;
+    }
+
+    @Override
+    public String getTypeName() {
+        return TYPE;
+    }
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/utils/ContactInfo.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/utils/ContactInfo.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/utils/ContactInfo.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/utils/ContactInfo.java Sat Jun 25 15:17:35 2011
@@ -1,44 +1,61 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.airavata.core.gfac.utils;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/**
- * 
- * @author Patanachai Tangchaisin
- */
 public class ContactInfo {
-	protected final static Logger log = LoggerFactory.getLogger(GfacUtils.class);
-	public String hostName;
-	public int port;
-
-	public ContactInfo(String hostName, int port) {
-		if (port <= 0 || port == 80) {
-			log.info(hostName + "port recived " + port + " setting it to " + GFacConstants.GSI_FTP_PORT);
-			port = GFacConstants.GSI_FTP_PORT;
-		}
-		this.hostName = hostName;
-		this.port = port;
-	}
-
-	@Override
-	public boolean equals(Object obj) {
-		if (obj instanceof ContactInfo) {
-			return hostName.equals(((ContactInfo) obj).hostName) && port == ((ContactInfo) obj).port;
-		} else {
-			return false;
-		}
-	}
-
-	@Override
-	public int hashCode() {
-		return hostName.hashCode();
-	}
-
-	@Override
-	public String toString() {
-		StringBuffer buf = new StringBuffer();
-		buf.append(hostName).append(":").append(port);
-		return buf.toString();
-	}
+    protected final static Logger log = LoggerFactory.getLogger(GfacUtils.class);
+    public String hostName;
+    public int port;
+
+    public ContactInfo(String hostName, int port) {
+        if (port <= 0 || port == 80) {
+            log.info(hostName + "port recived " + port + " setting it to " + GFacConstants.GSI_FTP_PORT);
+            port = GFacConstants.GSI_FTP_PORT;
+        }
+        this.hostName = hostName;
+        this.port = port;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj instanceof ContactInfo) {
+            return hostName.equals(((ContactInfo) obj).hostName) && port == ((ContactInfo) obj).port;
+        } else {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode() {
+        return hostName.hashCode();
+    }
+
+    @Override
+    public String toString() {
+        StringBuffer buf = new StringBuffer();
+        buf.append(hostName).append(":").append(port);
+        return buf.toString();
+    }
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/utils/ErrorCodes.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/utils/ErrorCodes.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/utils/ErrorCodes.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/utils/ErrorCodes.java Sat Jun 25 15:17:35 2011
@@ -1,3 +1,23 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
 
 package org.apache.airavata.core.gfac.utils;
 
@@ -8,6 +28,8 @@ public interface ErrorCodes {
     public static final String JOB_TYPE = "JobType";
     public static final String CONTACT = "JobContact";
     public static final String SERVICE_CRATION_FAILED = "ServiceCreationFailed";
-    public static enum JobType{Gram,WSGram,Local,Ssh};
-}
 
+    public static enum JobType {
+        Gram, WSGram, Local, Ssh
+    };
+}



Mime
View raw message