airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From patanac...@apache.org
Subject svn commit: r1181887 - in /incubator/airavata/trunk/modules: commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ commons/registry-api/src/main/java/org/apache/airavata/registry/api/ commons/registry-api/src/main/java/org/apache/air...
Date Tue, 11 Oct 2011 16:57:07 GMT
Author: patanachai
Date: Tue Oct 11 16:57:06 2011
New Revision: 1181887

URL: http://svn.apache.org/viewvc?rev=1181887&view=rev
Log:
AIRAVATA-123 change field name in description to identifier

Modified:
    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/ServiceDescription.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/SSHProvider.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java
    incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionRegistrationWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/HostDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java

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=1181887&r1=1181886&r2=1181887&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 Tue Oct 11 16:57:06 2011
@@ -22,19 +22,19 @@
 package org.apache.airavata.commons.gfac.type;
 
 public class ApplicationDeploymentDescription implements Type {
-
-	private String name;
+    
+    protected String id;
 	private String tmpDir;
 	private String workingDir;
 	private String inputDir;
 	private String outputDir;
 	
-	public String getName() {
-        return name;
+	public String getId() {
+        return id;
     }
 
-    public void setName(String name) {
-        this.name = name;
+    public void setId(String id) {
+        this.id = id;
     }
 
     public String getTmpDir() {

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=1181887&r1=1181886&r2=1181887&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 Tue Oct 11 16:57:06 2011
@@ -23,12 +23,20 @@ package org.apache.airavata.commons.gfac
 
 public class HostDescription implements Type {
 
-    private String name;
+    protected String id;
+    private String address;
 
-    public String getName() {
-        return name;
+    public String getId() {
+        return id;
     }
-    public void setName(String name) {
-        this.name = name;
+    public void setId(String id) {
+        this.id = id;
     }
+    public String getAddress() {
+        return address;
+    }
+    public void setAddress(String address) {
+        this.address = address;
+    }
+    
 }
\ No newline at end of file

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=1181887&r1=1181886&r2=1181887&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 Tue Oct 11 16:57:06 2011
@@ -25,17 +25,17 @@ import java.util.List;
 
 public class ServiceDescription implements Type {
 
-	private String name;
+    protected String id;
 	private List<Parameter> inputParameters;
 	private List<Parameter> outputParameters;	
 	
-	public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
+    public String getId() {
+        return id;
     }
+    
+    public void setId(String id) {
+        this.id = id;
+    }   
 
     public List<Parameter> getInputParameters() {
         return inputParameters;

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java Tue Oct 11 16:57:06 2011
@@ -40,39 +40,39 @@ public interface Registry {
 	/**
 	 * Find locations where the service is deployed
 	 * 
-	 * @param serviceName
+	 * @param serviceId
 	 * @return List of HostDescription having the service
 	 */
-	public List<HostDescription> getServiceLocation(String serviceName);	
+	public List<HostDescription> getServiceLocation(String serviceId);	
 	
 	/**
 	 * Retrieve a service description i.e. name, description, parameters 
 	 * 
-	 * @param serviceName
+	 * @param serviceId
 	 * @return a service description or null if a description is not found
 	 * @throws PathNotFoundException 
 	 * @throws ServiceDescriptionRetrieveException 
 	 */
-	public ServiceDescription getServiceDescription(String serviceName) throws ServiceDescriptionRetrieveException, PathNotFoundException;
+	public ServiceDescription getServiceDescription(String serviceId) throws ServiceDescriptionRetrieveException, PathNotFoundException;
 	
 	/**
 	 * Retrieve a deployment description for a service from the specific host
 	 * 
-	 * @param serviceName
-	 * @param hostName
+	 * @param serviceId
+	 * @param hostId
 	 * @return a deployment description or null if a description is not found
 	 * @throws PathNotFoundException 
 	 * @throws DeploymentDescriptionRetrieveException 
 	 */
-	public ApplicationDeploymentDescription getDeploymentDescription(String serviceName, String hostName) throws DeploymentDescriptionRetrieveException, PathNotFoundException;
+	public ApplicationDeploymentDescription getDeploymentDescription(String serviceId, String hostId) throws DeploymentDescriptionRetrieveException, PathNotFoundException;
 	
 	/**
 	 * Retrieve a host description
 	 * 
-	 * @param name
+	 * @param hostId
 	 * @return a host description or null if a description is not found
 	 */
-	public HostDescription getHostDescription(String name) throws HostDescriptionRetrieveException, PathNotFoundException;
+	public HostDescription getHostDescription(String hostId) throws HostDescriptionRetrieveException, PathNotFoundException;
 	
 	/**
 	 * Save a host description with the specific name.
@@ -81,7 +81,7 @@ public interface Registry {
 	 * @param host
 	 * @return identifier
 	 */
-	public String saveHostDescription(String name, HostDescription host);
+	public String saveHostDescription(HostDescription host);
 	
 	/**
 	 * Save a service description with the specific name.
@@ -90,24 +90,24 @@ public interface Registry {
 	 * @param host
 	 * @return identifier
 	 */
-	public String saveServiceDescription(String name, ServiceDescription service);
+	public String saveServiceDescription(ServiceDescription service);
 	
 	/**
 	 * Save a deployment description according to the service and host
 	 * 
-	 * @param service
-	 * @param host
+	 * @param serviceId
+	 * @param hostId
 	 * @param app
 	 * @return identifier
 	 */
-	public String saveDeploymentDescription(String service, String host, ApplicationDeploymentDescription app);
+	public String saveDeploymentDescription(String serviceId, String hostId, ApplicationDeploymentDescription app);
 	
 	/**
 	 * Deploy a service on a host
 	 * 
 	 * @param serviceName
 	 * @param hostName
-	 * @return true if service can be deploy on the hsot, otherwise false
+	 * @return true if service can be deploy on the host, otherwise false
 	 */
 	public boolean deployServiceOnHost(String serviceName, String hostName);
 		

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java Tue Oct 11 16:57:06 2011
@@ -59,12 +59,12 @@ import org.slf4j.LoggerFactory;
 public class JCRRegistry implements Axis2Registry, DataRegistry {
 
     private static final String OUTPUT_NODE_NAME = "OUTPUTS";
-	private static final String SERVICE_NODE_NAME = "SERVICE_HOST";
+    private static final String SERVICE_NODE_NAME = "SERVICE_HOST";
     private static final String GFAC_INSTANCE_DATA = "GFAC_INSTANCE_DATA";
-	private static final String DEPLOY_NODE_NAME = "APP_HOST";
-	private static final String HOST_NODE_NAME = "GFAC_HOST";
-	private static final String XML_PROPERTY_NAME = "XML";
-	private static final String WSDL_PROPERTY_NAME = "WSDL";
+    private static final String DEPLOY_NODE_NAME = "APP_HOST";
+    private static final String HOST_NODE_NAME = "GFAC_HOST";
+    private static final String XML_PROPERTY_NAME = "XML";
+    private static final String WSDL_PROPERTY_NAME = "WSDL";
     private static final String GFAC_URL_PROPERTY_NAME = "GFAC_URL_LIST";
     private static final String LINK_NAME = "LINK";
     public static final String WORKFLOWS = "WORKFLOWS";
@@ -73,304 +73,286 @@ public class JCRRegistry implements Axis
     public static final int GFAC_URL_UPDATE_INTERVAL = 1000 * 60 * 60 * 3;
 
     private Repository repository;
-	private Credentials credentials;
-	private UserManager userManager;
-	
-	private static Logger log = LoggerFactory.getLogger(JCRRegistry.class);
-
-	public JCRRegistry(String className, String user, String pass,
-                       Map<String, String> map) throws RepositoryException {
-		try {
-			/*
-			 * Load the configuration from properties file at this level and
-			 * create the object
-			 */
-			Class registryRepositoryFactory = Class.forName(className);
-			Constructor c = registryRepositoryFactory.getConstructor();
-			RepositoryFactory repositoryFactory = (RepositoryFactory) c
-					.newInstance();
-
-			repository = repositoryFactory.getRepository(map);
-			credentials = new SimpleCredentials(user,
-					new String(pass).toCharArray());
-			System.out.println(repository.getDescriptor(Repository.REP_NAME_DESC));
-			setUserManager(UserManagerFactory.getUserManager(repository.getDescriptor(Repository.REP_NAME_DESC)));
-			System.out.println(getUserManager());
-			getUserManager().setRepository(this);
-		} catch (ClassNotFoundException e) {
-			log.error("Error class path settting", e);
-		} catch (RepositoryException e) {
-			log.error("Error connecting Remote Registry instance", e);
+    private Credentials credentials;
+    private UserManager userManager;
+
+    private static Logger log = LoggerFactory.getLogger(JCRRegistry.class);
+
+    public JCRRegistry(String className, String user, String pass, Map<String, String> map) throws RepositoryException {
+        try {
+            /*
+             * Load the configuration from properties file at this level and
+             * create the object
+             */
+            Class registryRepositoryFactory = Class.forName(className);
+            Constructor c = registryRepositoryFactory.getConstructor();
+            RepositoryFactory repositoryFactory = (RepositoryFactory) c.newInstance();
+
+            repository = repositoryFactory.getRepository(map);
+            credentials = new SimpleCredentials(user, new String(pass).toCharArray());
+            System.out.println(repository.getDescriptor(Repository.REP_NAME_DESC));
+            setUserManager(UserManagerFactory.getUserManager(repository.getDescriptor(Repository.REP_NAME_DESC)));
+            System.out.println(getUserManager());
+            getUserManager().setRepository(this);
+        } catch (ClassNotFoundException e) {
+            log.error("Error class path settting", e);
+        } catch (RepositoryException e) {
+            log.error("Error connecting Remote Registry instance", e);
             throw e;
-		} catch (Exception e) {
-			log.error("Error init", e);
-		}
-	}
+        } catch (Exception e) {
+            log.error("Error init", e);
+        }
+    }
 
-    public JCRRegistry(Repository repo, Credentials credentials){
+    public JCRRegistry(Repository repo, Credentials credentials) {
         this.repository = repo;
         this.credentials = credentials;
     }
 
-	public Session getSession() throws RepositoryException {
-		return repository.login(credentials);
-	}
-
-	private Node getServiceNode(Session session) throws RepositoryException {
-		return getOrAddNode(session.getRootNode(), SERVICE_NODE_NAME);
-	}
-
-	private Node getDeploymentNode(Session session) throws RepositoryException {
-		return getOrAddNode(session.getRootNode(), DEPLOY_NODE_NAME);
-	}
-
-	private Node getHostNode(Session session) throws RepositoryException {
-		return getOrAddNode(session.getRootNode(), HOST_NODE_NAME);
-	}
-
-	private Node getOrAddNode(Node node, String name)
-			throws RepositoryException {
-		Node node1 = null;
-		try {
-			node1 = node.getNode(name);
-		} catch (PathNotFoundException pnfe) {
-			node1 = node.addNode(name);
-		} catch (RepositoryException e) {
-			String msg = "failed to resolve the path of the given node ";
-			log.debug(msg);
-			throw new RepositoryException(msg, e);
-		}
-		return node1;
-	}
-
-	public List<HostDescription> getServiceLocation(String serviceName) {
-		Session session = null;
-		ArrayList<HostDescription> result = new ArrayList<HostDescription>();
-		try {
-			session = getSession();
-			Node node = getServiceNode(session);
-			Node serviceNode = node.getNode(serviceName);
-			if (serviceNode.hasProperty(LINK_NAME)) {
-				Property prop = serviceNode.getProperty(LINK_NAME);
-				Value[] vals = prop.getValues();
-				for (Value val : vals) {					
-					Node host = session.getNodeByIdentifier(val.getString());
-					Property hostProp = host.getProperty(XML_PROPERTY_NAME);
-					result.add((HostDescription) SchemaUtil
-							.parseFromXML(hostProp.getString()));
-				}
-			}
-		} catch (Exception e) {
-			System.out.println(e);
-			e.printStackTrace();
-			// TODO propagate
-		} finally {
-			if (session != null && session.isLive()) {
-				session.logout();
-			}
-		}
-		return result;
-	}
-
-	public ServiceDescription getServiceDescription(String serviceName) throws ServiceDescriptionRetrieveException, PathNotFoundException{
-		Session session = null;
-		ServiceDescription result = null;
-		try {
-			session = getSession();
-			Node serviceNode = getServiceNode(session);
-			Node node = serviceNode.getNode(serviceName);
-			Property prop = node.getProperty(XML_PROPERTY_NAME);
-			result = (ServiceDescription) SchemaUtil.parseFromXML(prop
-					.getString());
-		} catch (Exception e) {
-			System.out.println(e);
-			e.printStackTrace();
-			// TODO propagate
-		} finally {
-			if (session != null && session.isLive()) {
-				session.logout();
-			}
-		}
-		return result;
-	}
-
-	public ApplicationDeploymentDescription getDeploymentDescription(
-			String serviceName, String host) throws DeploymentDescriptionRetrieveException, PathNotFoundException {
-		Session session = null;
-		ApplicationDeploymentDescription result = null;
-		try {
-			session = getSession();
-			Node deploymentNode = getDeploymentNode(session);
-			Node serviceNode = deploymentNode.getNode(serviceName);
-			Node hostNode = serviceNode.getNode(host);
-			NodeIterator nodes = hostNode.getNodes();
-			for (; nodes.hasNext();) {
-				Node app = nodes.nextNode();
-				Property prop = app.getProperty(XML_PROPERTY_NAME);
-				result = (ApplicationDeploymentDescription) SchemaUtil
-						.parseFromXML(prop.getString());
-			}
-		} catch (Exception e) {
-			System.out.println(e);
-			e.printStackTrace();
-			// TODO propagate
-		} finally {
-			if (session != null && session.isLive()) {
-				session.logout();
-			}
-		}
-		return result;
-	}
-
-	public HostDescription getHostDescription(String name) throws HostDescriptionRetrieveException, PathNotFoundException {
-		Session session = null;
-		HostDescription result = null;
-		try {
-			session = getSession();
-			Node hostNode = getHostNode(session);
-			Node node = hostNode.getNode(name);
-			if (node!=null) {
-				result = getHostDescriptor(node);
-			}
-		}catch(PathNotFoundException e){
-			throw e;
-		}catch (Exception e) {
-			throw new HostDescriptionRetrieveException(e);
-		} finally {
-			if (session != null && session.isLive()) {
-				session.logout();
-			}
-		}
-		return result;
-	}
-
-	private HostDescription getHostDescriptor(Node node)
-			throws PathNotFoundException, RepositoryException,
-			ValueFormatException {
-		HostDescription result;
-		Property prop = node.getProperty(XML_PROPERTY_NAME);
-		result = (HostDescription) SchemaUtil
-				.parseFromXML(prop.getString());
-		return result;
-	}
-
-	public String saveHostDescription(String name, HostDescription host) {
-		Session session = null;
-		String result = null;
-		try {
-			session = getSession();
-			Node hostNode = getHostNode(session);
-			Node node = getOrAddNode(hostNode, name);
-			node.setProperty(XML_PROPERTY_NAME, SchemaUtil.toXML(host));
-			session.save();
-
-			result = node.getIdentifier();
-		} catch (Exception e) {
-			System.out.println(e);
-			e.printStackTrace();
-			// TODO propagate
-		} finally {
-			if (session != null && session.isLive()) {
-				session.logout();
-			}
-		}
-		return result;
-	}
-
-	public String saveServiceDescription(String name, ServiceDescription service) {
-		Session session = null;
-		String result = null;
-		try {
-			session = getSession();
-			Node serviceNode = getServiceNode(session);
-			Node node = getOrAddNode(serviceNode, name);
-			node.setProperty(XML_PROPERTY_NAME, SchemaUtil.toXML(service));
-			session.save();
-
-			result = node.getIdentifier();
-		} catch (Exception e) {
-			System.out.println(e);
-			e.printStackTrace();
-			// TODO propagate
-		} finally {
-			if (session != null && session.isLive()) {
-				session.logout();
-			}
-		}
-		return result;
-	}
-
-	public String saveDeploymentDescription(String service, String host,
-			ApplicationDeploymentDescription app) {
-		Session session = null;
-		String result = null;
-		try {
-			session = getSession();
-			Node deployNode = getDeploymentNode(session);
-			Node serviceNode = getOrAddNode(deployNode, service);
-			Node hostNode = getOrAddNode(serviceNode, host);
-			Node appName = getOrAddNode(hostNode, app.getName());
-			appName.setProperty(XML_PROPERTY_NAME, SchemaUtil.toXML(app));
-			session.save();
-
-			result = appName.getIdentifier();
-		} catch (Exception e) {
-			System.out.println(e);
-			e.printStackTrace();
-			// TODO propagate
-		} finally {
-			if (session != null && session.isLive()) {
-				session.logout();
-			}
-		}
-		return result;
-	}
-
-	public boolean deployServiceOnHost(String serviceName, String hostName) {
-		Session session = null;
-		try {
-			session = getSession();
-			Node serviceRoot = getServiceNode(session);
-			Node hostRoot = getHostNode(session);
-
-			Node serviceNode = serviceRoot.getNode(serviceName);
-			Node hostNode = hostRoot.getNode(hostName);
-						
-			if (!serviceNode.hasProperty(LINK_NAME)) {				
-				serviceNode.setProperty(LINK_NAME,
-						new String[] { hostNode.getIdentifier() });
-			} else {
-				Property prop = serviceNode.getProperty(LINK_NAME);
-				Value[] vals = prop.getValues();
-				ArrayList<String> s = new ArrayList<String>();
-				for (Value val : vals) {
-					s.add(val.getString());
-				}
-
-				if (s.contains(hostNode.getIdentifier())) {
-					return false;
-				}
-				
-				s.add(hostNode.getIdentifier());
-				serviceNode.setProperty(LINK_NAME, s.toArray(new String[0]));
-			}
-			
-			session.save();
-			return true;
-		} catch (Exception e) {
-			System.out.println(e);
-			e.printStackTrace();
-			// TODO propagate
-		} finally {
-			if (session != null && session.isLive()) {
-				session.logout();
-			}
-		}
-		return false;
-	}
+    public Session getSession() throws RepositoryException {
+        return repository.login(credentials);
+    }
+
+    private Node getServiceNode(Session session) throws RepositoryException {
+        return getOrAddNode(session.getRootNode(), SERVICE_NODE_NAME);
+    }
+
+    private Node getDeploymentNode(Session session) throws RepositoryException {
+        return getOrAddNode(session.getRootNode(), DEPLOY_NODE_NAME);
+    }
+
+    private Node getHostNode(Session session) throws RepositoryException {
+        return getOrAddNode(session.getRootNode(), HOST_NODE_NAME);
+    }
+
+    private Node getOrAddNode(Node node, String name) throws RepositoryException {
+        Node node1 = null;
+        try {
+            node1 = node.getNode(name);
+        } catch (PathNotFoundException pnfe) {
+            node1 = node.addNode(name);
+        } catch (RepositoryException e) {
+            String msg = "failed to resolve the path of the given node ";
+            log.debug(msg);
+            throw new RepositoryException(msg, e);
+        }
+        return node1;
+    }
+
+    private void closeSession(Session session) {
+        if (session != null && session.isLive()) {
+            session.logout();
+        }
+    }
+
+    public List<HostDescription> getServiceLocation(String serviceId) {
+        Session session = null;
+        ArrayList<HostDescription> result = new ArrayList<HostDescription>();
+        try {
+            session = getSession();
+            Node node = getServiceNode(session);
+            Node serviceNode = node.getNode(serviceId);
+            if (serviceNode.hasProperty(LINK_NAME)) {
+                Property prop = serviceNode.getProperty(LINK_NAME);
+                Value[] vals = prop.getValues();
+                for (Value val : vals) {
+                    Node host = session.getNodeByIdentifier(val.getString());
+                    Property hostProp = host.getProperty(XML_PROPERTY_NAME);
+                    result.add((HostDescription) SchemaUtil.parseFromXML(hostProp.getString()));
+                }
+            }
+        } catch (Exception e) {
+            System.out.println(e);
+            e.printStackTrace();
+            // TODO propagate
+        } finally {
+            closeSession(session);
+        }
+        return result;
+    }
+
+    public ServiceDescription getServiceDescription(String serviceId) throws ServiceDescriptionRetrieveException,
+            PathNotFoundException {
+        Session session = null;
+        ServiceDescription result = null;
+        try {
+            session = getSession();
+            Node serviceNode = getServiceNode(session);
+            Node node = serviceNode.getNode(serviceId);
+            Property prop = node.getProperty(XML_PROPERTY_NAME);
+            result = (ServiceDescription) SchemaUtil.parseFromXML(prop.getString());
+        } catch (Exception e) {
+            System.out.println(e);
+            e.printStackTrace();
+            // TODO propagate
+        } finally {
+            closeSession(session);
+        }
+        return result;
+    }
+
+    public ApplicationDeploymentDescription getDeploymentDescription(String serviceId, String hostId)
+            throws DeploymentDescriptionRetrieveException, PathNotFoundException {
+        Session session = null;
+        ApplicationDeploymentDescription result = null;
+        try {
+            session = getSession();
+            Node deploymentNode = getDeploymentNode(session);
+            Node serviceNode = deploymentNode.getNode(serviceId);
+            Node hostNode = serviceNode.getNode(hostId);
+            NodeIterator nodes = hostNode.getNodes();
+            for (; nodes.hasNext();) {
+                Node app = nodes.nextNode();
+                Property prop = app.getProperty(XML_PROPERTY_NAME);
+                result = (ApplicationDeploymentDescription) SchemaUtil.parseFromXML(prop.getString());
+            }
+        } catch (Exception e) {
+            System.out.println(e);
+            e.printStackTrace();
+            // TODO propagate
+        } finally {
+            closeSession(session);
+        }
+        return result;
+    }
+
+    public HostDescription getHostDescription(String hostId) throws HostDescriptionRetrieveException,
+            PathNotFoundException {
+        Session session = null;
+        HostDescription result = null;
+        try {
+            session = getSession();
+            Node hostNode = getHostNode(session);
+            Node node = hostNode.getNode(hostId);
+            if (node != null) {
+                result = getHostDescriptor(node);
+            }
+        } catch (PathNotFoundException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new HostDescriptionRetrieveException(e);
+        } finally {
+            closeSession(session);
+        }
+        return result;
+    }
+
+    private HostDescription getHostDescriptor(Node node) throws PathNotFoundException, RepositoryException,
+            ValueFormatException {
+        HostDescription result;
+        Property prop = node.getProperty(XML_PROPERTY_NAME);
+        result = (HostDescription) SchemaUtil.parseFromXML(prop.getString());
+        return result;
+    }
 
-	public List<ServiceDescription> searchServiceDescription(String name) throws ServiceDescriptionRetrieveException, PathNotFoundException{
-	    Session session = null;
+    public String saveHostDescription(HostDescription host) {
+        Session session = null;
+        String result = null;
+        try {
+            session = getSession();
+            Node hostNode = getHostNode(session);
+            Node node = getOrAddNode(hostNode, host.getId());
+            node.setProperty(XML_PROPERTY_NAME, SchemaUtil.toXML(host));
+            session.save();
+
+            result = node.getIdentifier();
+        } catch (Exception e) {
+            System.out.println(e);
+            e.printStackTrace();
+            // TODO propagate
+        } finally {
+            closeSession(session);
+        }
+        return result;
+    }
+
+    public String saveServiceDescription(ServiceDescription service) {
+        Session session = null;
+        String result = null;
+        try {
+            session = getSession();
+            Node serviceNode = getServiceNode(session);
+            Node node = getOrAddNode(serviceNode, service.getId());
+            node.setProperty(XML_PROPERTY_NAME, SchemaUtil.toXML(service));
+            session.save();
+
+            result = node.getIdentifier();
+        } catch (Exception e) {
+            System.out.println(e);
+            e.printStackTrace();
+            // TODO propagate
+        } finally {
+            closeSession(session);
+        }
+        return result;
+    }
+
+    public String saveDeploymentDescription(String serviceId, String hostId, ApplicationDeploymentDescription app) {
+        Session session = null;
+        String result = null;
+        try {
+            session = getSession();
+            Node deployNode = getDeploymentNode(session);
+            Node serviceNode = getOrAddNode(deployNode, serviceId);
+            Node hostNode = getOrAddNode(serviceNode, hostId);
+            Node appName = getOrAddNode(hostNode, app.getId());
+            appName.setProperty(XML_PROPERTY_NAME, SchemaUtil.toXML(app));
+            session.save();
+
+            result = appName.getIdentifier();
+        } catch (Exception e) {
+            System.out.println(e);
+            e.printStackTrace();
+            // TODO propagate
+        } finally {
+            closeSession(session);
+        }
+        return result;
+    }
+
+    public boolean deployServiceOnHost(String serviceId, String hostId) {
+        Session session = null;
+        try {
+            session = getSession();
+            Node serviceRoot = getServiceNode(session);
+            Node hostRoot = getHostNode(session);
+
+            Node serviceNode = serviceRoot.getNode(serviceId);
+            Node hostNode = hostRoot.getNode(hostId);
+
+            if (!serviceNode.hasProperty(LINK_NAME)) {
+                serviceNode.setProperty(LINK_NAME, new String[] { hostNode.getIdentifier() });
+            } else {
+                Property prop = serviceNode.getProperty(LINK_NAME);
+                Value[] vals = prop.getValues();
+                ArrayList<String> s = new ArrayList<String>();
+                for (Value val : vals) {
+                    s.add(val.getString());
+                }
+
+                if (s.contains(hostNode.getIdentifier())) {
+                    return false;
+                }
+
+                s.add(hostNode.getIdentifier());
+                serviceNode.setProperty(LINK_NAME, s.toArray(new String[0]));
+            }
+
+            session.save();
+            return true;
+        } catch (Exception e) {
+            System.out.println(e);
+            e.printStackTrace();
+            // TODO propagate
+        } finally {
+            closeSession(session);
+        }
+        return false;
+    }
+
+    public List<ServiceDescription> searchServiceDescription(String name) throws ServiceDescriptionRetrieveException,
+            PathNotFoundException {
+        Session session = null;
         ArrayList<ServiceDescription> result = new ArrayList<ServiceDescription>();
         try {
             session = getSession();
@@ -386,15 +368,14 @@ public class JCRRegistry implements Axis
             e.printStackTrace();
             // TODO propagate
         } finally {
-            if (session != null && session.isLive()) {
-                session.logout();
-            }
-        }	   
-		return result;
-	}
-	
-	public List<HostDescription> searchHostDescription(String nameRegEx) throws HostDescriptionRetrieveException, PathNotFoundException {
-	    Session session = null;
+            closeSession(session);
+        }
+        return result;
+    }
+
+    public List<HostDescription> searchHostDescription(String nameRegEx) throws HostDescriptionRetrieveException,
+            PathNotFoundException {
+        Session session = null;
         List<HostDescription> result = new ArrayList<HostDescription>();
         try {
             session = getSession();
@@ -402,120 +383,112 @@ public class JCRRegistry implements Axis
             NodeIterator nodes = node.getNodes();
             for (; nodes.hasNext();) {
                 Node host = nodes.nextNode();
-                if (host!=null && host.getName().matches(nameRegEx)){
+                if (host != null && host.getName().matches(nameRegEx)) {
                     HostDescription hostDescriptor = getHostDescriptor(host);
-                	result.add(hostDescriptor);
+                    result.add(hostDescriptor);
                 }
             }
-		}catch(PathNotFoundException e){
-			System.out.println(e);
-			e.printStackTrace();
-			throw e;
+        } catch (PathNotFoundException e) {
+            System.out.println(e);
+            e.printStackTrace();
+            throw e;
         } catch (Exception e) {
             System.out.println(e);
             e.printStackTrace();
             throw new HostDescriptionRetrieveException(e);
         } finally {
-            if (session != null && session.isLive()) {
-                session.logout();
-            }
-        }	   
-		return result;
-	}
-
-	public Map<ApplicationDeploymentDescription,String> searchDeploymentDescription() throws PathNotFoundException, DeploymentDescriptionRetrieveException {
-		Session session = null;
-		Map<ApplicationDeploymentDescription,String> result = new HashMap<ApplicationDeploymentDescription,String>();
+            closeSession(session);
+        }
+        return result;
+    }
+
+    public Map<ApplicationDeploymentDescription, String> searchDeploymentDescription() throws PathNotFoundException,
+            DeploymentDescriptionRetrieveException {
+        Session session = null;
+        Map<ApplicationDeploymentDescription, String> result = new HashMap<ApplicationDeploymentDescription, String>();
         try {
             session = getSession();
             Node deploymentNode = getDeploymentNode(session);
-			NodeIterator serviceNodes = deploymentNode.getNodes();
+            NodeIterator serviceNodes = deploymentNode.getNodes();
 
             for (; serviceNodes.hasNext();) {
-				Node serviceNode = serviceNodes.nextNode();
-				NodeIterator hostNodes = serviceNode.getNodes();
+                Node serviceNode = serviceNodes.nextNode();
+                NodeIterator hostNodes = serviceNode.getNodes();
 
-            	for (; hostNodes.hasNext();) {
-            		Node hostNode = hostNodes.nextNode();
-    				NodeIterator nodes = hostNode.getNodes();
-                	for (; nodes.hasNext();) {
-						Node app = nodes.nextNode();
-						Property prop = app.getProperty(XML_PROPERTY_NAME);
-						result.put((ApplicationDeploymentDescription) SchemaUtil
-								.parseFromXML(prop.getString()),serviceNode.getName()+"$"+hostNode.getName());
-                	}
-            	}
-			}
-		}catch(PathNotFoundException e){
-			throw e;
+                for (; hostNodes.hasNext();) {
+                    Node hostNode = hostNodes.nextNode();
+                    NodeIterator nodes = hostNode.getNodes();
+                    for (; nodes.hasNext();) {
+                        Node app = nodes.nextNode();
+                        Property prop = app.getProperty(XML_PROPERTY_NAME);
+                        result.put((ApplicationDeploymentDescription) SchemaUtil.parseFromXML(prop.getString()),
+                                serviceNode.getName() + "$" + hostNode.getName());
+                    }
+                }
+            }
+        } catch (PathNotFoundException e) {
+            throw e;
         } catch (Exception e) {
             throw new DeploymentDescriptionRetrieveException(e);
         } finally {
-            if (session != null && session.isLive()) {
-                session.logout();
-            }
-        }	   
-		return result;
-	}
-	
-	public List<ApplicationDeploymentDescription> searchDeploymentDescription(
-			String serviceName, String hostName, String applicationName) throws PathNotFoundException, DeploymentDescriptionRetrieveException {
-	    Session session = null;
+            closeSession(session);
+        }
+        return result;
+    }
+
+    public List<ApplicationDeploymentDescription> searchDeploymentDescription(String serviceName, String hostName,
+            String applicationName) throws PathNotFoundException, DeploymentDescriptionRetrieveException {
+        Session session = null;
         List<ApplicationDeploymentDescription> result = new ArrayList<ApplicationDeploymentDescription>();
         try {
             session = getSession();
             Node deploymentNode = getDeploymentNode(session);
-			Node serviceNode = deploymentNode.getNode(serviceName);
-			Node hostNode = serviceNode.getNode(hostName);
-			NodeIterator nodes = hostNode.getNodes();
-			for (; nodes.hasNext();) {
-				Node app = nodes.nextNode();
-				Property prop = app.getProperty(XML_PROPERTY_NAME);
-				ApplicationDeploymentDescription appDesc = (ApplicationDeploymentDescription) SchemaUtil
-						.parseFromXML(prop.getString());
-				if (appDesc.getName().matches(applicationName)){
-					result.add(appDesc);
-				}
-			}
-		}catch(PathNotFoundException e){
-			throw e;
+            Node serviceNode = deploymentNode.getNode(serviceName);
+            Node hostNode = serviceNode.getNode(hostName);
+            NodeIterator nodes = hostNode.getNodes();
+            for (; nodes.hasNext();) {
+                Node app = nodes.nextNode();
+                Property prop = app.getProperty(XML_PROPERTY_NAME);
+                ApplicationDeploymentDescription appDesc = (ApplicationDeploymentDescription) SchemaUtil
+                        .parseFromXML(prop.getString());
+                if (appDesc.getId().matches(applicationName)) {
+                    result.add(appDesc);
+                }
+            }
+        } catch (PathNotFoundException e) {
+            throw e;
         } catch (Exception e) {
             throw new DeploymentDescriptionRetrieveException(e);
         } finally {
-            if (session != null && session.isLive()) {
-                session.logout();
-            }
-        }	   
-		return result;
-	}
-	
-	public List<ApplicationDeploymentDescription> searchDeploymentDescription(
-			String serviceName, String hostName) throws PathNotFoundException, DeploymentDescriptionRetrieveException {
-	    Session session = null;
+            closeSession(session);
+        }
+        return result;
+    }
+
+    public List<ApplicationDeploymentDescription> searchDeploymentDescription(String serviceName, String hostName)
+            throws PathNotFoundException, DeploymentDescriptionRetrieveException {
+        Session session = null;
         List<ApplicationDeploymentDescription> result = new ArrayList<ApplicationDeploymentDescription>();
         try {
             session = getSession();
             Node deploymentNode = getDeploymentNode(session);
-			Node serviceNode = deploymentNode.getNode(serviceName);
-			Node hostNode = serviceNode.getNode(hostName);
-			NodeIterator nodes = hostNode.getNodes();
-			for (; nodes.hasNext();) {
-				Node app = nodes.nextNode();
-				Property prop = app.getProperty(XML_PROPERTY_NAME);
-				result.add((ApplicationDeploymentDescription) SchemaUtil
-						.parseFromXML(prop.getString()));
-			}
-		}catch(PathNotFoundException e){
-			throw e;
+            Node serviceNode = deploymentNode.getNode(serviceName);
+            Node hostNode = serviceNode.getNode(hostName);
+            NodeIterator nodes = hostNode.getNodes();
+            for (; nodes.hasNext();) {
+                Node app = nodes.nextNode();
+                Property prop = app.getProperty(XML_PROPERTY_NAME);
+                result.add((ApplicationDeploymentDescription) SchemaUtil.parseFromXML(prop.getString()));
+            }
+        } catch (PathNotFoundException e) {
+            throw e;
         } catch (Exception e) {
             throw new DeploymentDescriptionRetrieveException(e);
         } finally {
-            if (session != null && session.isLive()) {
-                session.logout();
-            }
-        }	   
-		return result;
-	}
+            closeSession(session);
+        }
+        return result;
+    }
 
     public String saveWSDL(String name, String WSDL) {
         Session session = null;
@@ -533,11 +506,9 @@ public class JCRRegistry implements Axis
             e.printStackTrace();
             // TODO propagate
         } finally {
-            if (session != null && session.isLive()) {
-                session.logout();
-            }
+            closeSession(session);
         }
-        return result;        
+        return result;
     }
 
     public String saveWSDL(String serviceName, ServiceDescription service) {
@@ -559,9 +530,7 @@ public class JCRRegistry implements Axis
             e.printStackTrace();
             // TODO propagate
         } finally {
-            if (session != null && session.isLive()) {
-                session.logout();
-            }
+            closeSession(session);
         }
         return result;
     }
@@ -589,11 +558,9 @@ public class JCRRegistry implements Axis
             return false;
             // TODO propagate
         } finally {
-            if (session != null && session.isLive()) {
-                session.logout();
-            }
-            return true;
+            closeSession(session);            
         }
+        return true;
     }
 
     public boolean deleteGFacDescriptor(String gfacURL) {
@@ -612,11 +579,9 @@ public class JCRRegistry implements Axis
             return false;
             // TODO propagate
         } finally {
-            if (session != null && session.isLive()) {
-                session.logout();
-            }
-            return true;
+            closeSession(session);            
         }
+        return true;
     }
 
     public List<String> getGFacDescriptorList() {
@@ -630,10 +595,10 @@ public class JCRRegistry implements Axis
             PropertyIterator propertyIterator = gfacNode.getProperties();
             while (propertyIterator.hasNext()) {
                 Property property = propertyIterator.nextProperty();
-                if(!"nt:unstructured".equals(property.getString())){
+                if (!"nt:unstructured".equals(property.getString())) {
                     String x = property.getString();
                     Timestamp setTime = new Timestamp(new Long(property.getString().split(";")[1]));
-                    if(GFAC_URL_UPDATE_INTERVAL > (timestamp.getTime() - setTime.getTime())){
+                    if (GFAC_URL_UPDATE_INTERVAL > (timestamp.getTime() - setTime.getTime())) {
                         urlList.add(property.getString().split(";")[0]);
                     }
                 }
@@ -644,14 +609,14 @@ public class JCRRegistry implements Axis
         return urlList;
     }
 
-	public UserManager getUserManager() {
-		return userManager;
-	}
-
-	public void setUserManager(UserManager userManager) {
-		this.userManager = userManager;
-	}
-	
+    public UserManager getUserManager() {
+        return userManager;
+    }
+
+    public void setUserManager(UserManager userManager) {
+        this.userManager = userManager;
+    }
+
     public String saveOutput(String workflowId, List<AbstractParameter> parameters) {
         Session session = null;
         String result = null;
@@ -660,9 +625,9 @@ public class JCRRegistry implements Axis
             Node outputNode = getOrAddNode(session.getRootNode(), OUTPUT_NODE_NAME);
             Node node = getOrAddNode(outputNode, workflowId);
             for (int i = 0; i < parameters.size(); i++) {
-                node.setProperty(String.valueOf(i), SchemaUtil.toXML(parameters.get(i)));                
+                node.setProperty(String.valueOf(i), SchemaUtil.toXML(parameters.get(i)));
             }
-            
+
             session.save();
 
             result = node.getIdentifier();
@@ -671,52 +636,44 @@ public class JCRRegistry implements Axis
             e.printStackTrace();
             // TODO propagate
         } finally {
-            if (session != null && session.isLive()) {
-                session.logout();
-            }
+            closeSession(session);
         }
         return result;
     }
-    
-    public List<AbstractParameter> loadOutput(String workflowId){
+
+    public List<AbstractParameter> loadOutput(String workflowId) {
         Session session = null;
         ArrayList<AbstractParameter> result = new ArrayList<AbstractParameter>();
         try {
             session = getSession();
             Node outputNode = getOrAddNode(session.getRootNode(), OUTPUT_NODE_NAME);
             Node node = outputNode.getNode(workflowId);
-            
+
             PropertyIterator it = node.getProperties();
-            while(it.hasNext()){
-                Property prop = (Property)it.next();
+            while (it.hasNext()) {
+                Property prop = (Property) it.next();
                 result.add((AbstractParameter) SchemaUtil.parseFromXML(prop.getString()));
-            }            
+            }
         } catch (Exception e) {
             System.out.println(e);
             e.printStackTrace();
             // TODO propagate
         } finally {
-            if (session != null && session.isLive()) {
-                session.logout();
-            }
+            closeSession(session);
         }
         return result;
     }
 
-
-
-
-
     public Map<QName, Node> getAvailableWorkflows(String userName) {
         Session session = null;
-        Map<QName,Node> workflowList = new HashMap<QName, Node>();
+        Map<QName, Node> workflowList = new HashMap<QName, Node>();
         try {
             session = getSession();
             Node workflowListNode = getOrAddNode(getOrAddNode(session.getRootNode(), WORKFLOWS), PUBLIC);
             NodeIterator iterator = workflowListNode.getNodes();
             while (iterator.hasNext()) {
                 Node nextNode = iterator.nextNode();
-                workflowList.put(new QName(nextNode.getName()),nextNode);
+                workflowList.put(new QName(nextNode.getName()), nextNode);
             }
             workflowListNode = getOrAddNode(getOrAddNode(session.getRootNode(), WORKFLOWS), userName);
             iterator = workflowListNode.getNodes();
@@ -728,7 +685,7 @@ public class JCRRegistry implements Axis
         } catch (Exception e) {
             e.printStackTrace();
         }
-            return workflowList;
+        return workflowList;
     }
 
     public Node getWorkflow(QName templateID, String userName) {
@@ -744,7 +701,8 @@ public class JCRRegistry implements Axis
         return result;
     }
 
-    public boolean saveWorkflow(QName ResourceID, String workflowName, String resourceDesc, String workflowAsaString, String owner, boolean isMakePublic) {
+    public boolean saveWorkflow(QName ResourceID, String workflowName, String resourceDesc, String workflowAsaString,
+            String owner, boolean isMakePublic) {
         Session session = null;
         try {
             session = getSession();
@@ -766,15 +724,13 @@ public class JCRRegistry implements Axis
         } catch (Exception e) {
             e.printStackTrace();
         } finally {
-            if (session != null && session.isLive()) {
-                session.logout();
-            }
+            closeSession(session);
             return true;
         }
     }
 
     public boolean deleteWorkflow(QName resourceID, String userName) {
-         Session session = null;
+        Session session = null;
         try {
             session = getSession();
             Node workflowListNode = getOrAddNode(getOrAddNode(session.getRootNode(), WORKFLOWS), userName);
@@ -783,11 +739,9 @@ public class JCRRegistry implements Axis
             session.save();
         } catch (Exception e) {
             e.printStackTrace();
-        }finally {
-            if(session.isLive() || session != null){
-                session.logout();
-            }
+        } finally {
+            closeSession(session);
         }
-        return false;  //To change body of implemented methods use File | Settings | File Templates.
+        return false; 
     }
 }

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/data/RegistryDataService.java Tue Oct 11 16:57:06 2011
@@ -62,7 +62,7 @@ public class RegistryDataService extends
                 date = date.replaceAll(" ", "_");
                 date = date.replaceAll(":", "_");
 
-                String tmpDir = appDesc.getTmpDir() + File.separator + appDesc.getName() + "_" + date + "_"
+                String tmpDir = appDesc.getTmpDir() + File.separator + appDesc.getId() + "_" + date + "_"
                         + UUID.randomUUID();
 
                 appDesc.setWorkingDir(tmpDir);
@@ -84,10 +84,10 @@ public class RegistryDataService extends
             if (appDesc.getClass().isAssignableFrom(ShellApplicationDeployment.class)) {
                 ShellApplicationDeployment shell = (ShellApplicationDeployment) appDesc;
                 if (shell.getStdOut() == null) {
-                    shell.setStdOut(appDesc.getWorkingDir() + File.separator + appDesc.getName() + ".stdout");
+                    shell.setStdOut(appDesc.getWorkingDir() + File.separator + appDesc.getId() + ".stdout");
                 }
                 if (shell.getStdErr() == null) {
-                    shell.setStdOut(appDesc.getWorkingDir() + File.separator + appDesc.getName() + ".stderr");
+                    shell.setStdOut(appDesc.getWorkingDir() + File.separator + appDesc.getId() + ".stderr");
                 }
             }
 

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java Tue Oct 11 16:57:06 2011
@@ -87,7 +87,7 @@ public class GridFtpOutputStaging extend
 
                             if (hostDescription instanceof GlobusHost) {
                                 gridFTPTransfer(context, uri, srcFilePath);
-                            } else if (GfacUtils.isLocalHost(hostDescription.getName())) {
+                            } else if (GfacUtils.isLocalHost(hostDescription.getAddress())) {
                                 updateFile(context, uri, srcFilePath);
                             }
                         }

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java Tue Oct 11 16:57:06 2011
@@ -88,7 +88,7 @@ public class GridFtpInputStaging extends
 
                             if (hostDescription instanceof GlobusHost) {
                                 gridFTPTransfer(context, uri, destFilePath);
-                            } else if (GfacUtils.isLocalHost(hostDescription.getName())) {
+                            } else if (GfacUtils.isLocalHost(hostDescription.getAddress())) {
                                 downloadFile(context, uri, destFilePath);
                             }
 

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java Tue Oct 11 16:57:06 2011
@@ -73,7 +73,7 @@ public class GramProvider extends Abstra
 
             String hostgridFTP = host.getGridFTPEndPoint();
             if (host.getGridFTPEndPoint() == null) {
-                hostgridFTP = host.getName();
+                hostgridFTP = host.getAddress();
             }
 
             URI tmpdirURI = GfacUtils.createGsiftpURI(hostgridFTP, app.getTmpDir());
@@ -105,7 +105,7 @@ public class GramProvider extends Abstra
         log.info("Searching for Gate Keeper");
         gateKeeper = host.getGlobusGateKeeperEndPoint();
         if (gateKeeper == null) {
-            gateKeeper = host.getName();
+            gateKeeper = host.getAddress();
         }
         log.info("Using Globus GateKeeper " + gateKeeper);
 
@@ -141,7 +141,7 @@ public class GramProvider extends Abstra
             log.info("Request to contact:" + gateKeeper);
 
             buf.append("Finished launching job, Host = ")
-                    .append(host.getName()).append(" RSL = ")
+                    .append(host.getAddress()).append(" RSL = ")
                     .append(job.getRSL())
                     .append(" working directory = ")
                     .append(app.getWorkingDir()).append(" tempDirectory = ")
@@ -184,7 +184,7 @@ public class GramProvider extends Abstra
             int jobStatus = listener.getStatus();
             if (jobStatus == GramJob.STATUS_FAILED) {
                 int errCode = listener.getError();
-                String errorMsg = "Job " + job.getID() + " on host " + host.getName() + " Error Code = " + errCode;
+                String errorMsg = "Job " + job.getID() + " on host " + host.getAddress() + " Error Code = " + errCode;
                 JobSubmissionFault error = new JobSubmissionFault(this, new Exception(errorMsg), "GFAC HOST",
                         gateKeeper, job.getRSL());
                 if (errCode == 8) {
@@ -196,7 +196,7 @@ public class GramProvider extends Abstra
             }
 
         } catch (GramException e) {
-            JobSubmissionFault error = new JobSubmissionFault(this, e, host.getName(), gateKeeper, job.getRSL());
+            JobSubmissionFault error = new JobSubmissionFault(this, e, host.getAddress(), gateKeeper, job.getRSL());
             if (listener.getError() == 8) {
                 error.setReason(JobSubmissionFault.JOB_CANCEL);
             } else {
@@ -233,7 +233,7 @@ public class GramProvider extends Abstra
 
             String hostgridFTP = host.getGridFTPEndPoint();
             if (host.getGridFTPEndPoint() == null) {
-                hostgridFTP = host.getName();
+                hostgridFTP = host.getAddress();
             }
 
             URI stdoutURI = GfacUtils.createGsiftpURI(hostgridFTP, app.getStdOut());

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/SSHProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/SSHProvider.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/SSHProvider.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/SSHProvider.java Tue Oct 11 16:57:06 2011
@@ -85,7 +85,7 @@ public class SSHProvider extends Abstrac
             ssh.loadKnownHosts();
             ssh.authPublickey(sshContext.getUsername(), pkey);
 
-            ssh.connect(context.getExecutionDescription().getHost().getName());            
+            ssh.connect(context.getExecutionDescription().getHost().getAddress());            
             return ssh.startSession();
 
         } catch (NullPointerException ne) {

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java Tue Oct 11 16:57:06 2011
@@ -88,7 +88,7 @@ public class SchedulerImpl implements Sc
         ApplicationDeploymentDescription app=null;
 		try {
 			app = registryService.getDeploymentDescription(context.getServiceName(),
-			        host.getName());
+			        host.getId());
 		} catch (PathNotFoundException e1) {
 			// TODO Auto-generated catch block
 			e1.printStackTrace();
@@ -115,7 +115,7 @@ public class SchedulerImpl implements Sc
         /*
          * Determine provider
          */
-        String hostName = host.getName();
+        String hostName = host.getAddress();
         try {
             if (GfacUtils.isLocalHost(hostName)) {
                 return new LocalProvider();
@@ -137,7 +137,7 @@ public class SchedulerImpl implements Sc
             for (Iterator<HostDescription> iterator = hosts.iterator(); iterator.hasNext();) {
                 result = iterator.next();
 
-                log.info("Found service on: " + result.getName());
+                log.info("Found service on: " + result.getAddress());
             }
             return result;
         } else {

Modified: incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java Tue Oct 11 16:57:06 2011
@@ -57,13 +57,14 @@ public class PropertiesBasedServiceImplT
 		 * Host
 		 */
 		HostDescription host = new HostDescription();
-		host.setName("localhost");
+		host.setId("localhost");
+		host.setAddress("localhost");
 
 		/*
 		 * App
 		 */
 		ShellApplicationDeployment app = new ShellApplicationDeployment();
-		app.setName("EchoLocal");
+		app.setId("EchoLocal");
 		app.setExecutable("/bin/echo");
 		app.setTmpDir("/tmp");
 		app.setWorkingDir("/tmp");
@@ -77,7 +78,7 @@ public class PropertiesBasedServiceImplT
 		 * Service
 		 */
 		ServiceDescription serv = new ServiceDescription();
-		serv.setName("SimpleEcho");
+		serv.setId("SimpleEcho");
 
 		Parameter input = new Parameter();
 		input.setName("echo_input");
@@ -97,11 +98,11 @@ public class PropertiesBasedServiceImplT
 		/*
 		 * Save to registry
 		 */
-		jcrRegistry.saveHostDescription(host.getName(), host);
-		jcrRegistry.saveDeploymentDescription(serv.getName(), host.getName(),
+		jcrRegistry.saveHostDescription(host);
+		jcrRegistry.saveDeploymentDescription(serv.getId(), host.getId(),
 				app);
-		jcrRegistry.saveServiceDescription(serv.getName(), serv);
-		jcrRegistry.deployServiceOnHost(serv.getName(), host.getName());
+		jcrRegistry.saveServiceDescription(serv);
+		jcrRegistry.deployServiceOnHost(serv.getId(), host.getId());
 	}
 
 	@Test

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java Tue Oct 11 16:57:06 2011
@@ -84,7 +84,7 @@ public class ApplicationDescriptionDialo
 					while(true){
 						boolean notFound=true;
 						for (ApplicationDeploymentDescription deploymentDescription : applicationDescriptions) {
-							if (deploymentDescription.getName().equals(defaultName)){
+							if (deploymentDescription.getId().equals(defaultName)){
 								notFound=false;
 								break;
 							}
@@ -354,7 +354,7 @@ public class ApplicationDescriptionDialo
 		try {
 			List<ServiceDescription> serviceDescriptions = getJCRComponentRegistry().searchServiceDescription("");
 			for (ServiceDescription serviceDescription : serviceDescriptions) {
-				cmbServiceName.addItem(serviceDescription.getName());
+				cmbServiceName.addItem(serviceDescription.getId());
 			}
 		} catch (Exception e) {
 			setError(e.getLocalizedMessage());
@@ -368,7 +368,7 @@ public class ApplicationDescriptionDialo
 		try {
 			List<HostDescription> hostDescriptions = getJCRComponentRegistry().searchHostDescription(".*");
 			for (HostDescription hostDescription : hostDescriptions) {
-				cmbHostName.addItem(hostDescription.getName());
+				cmbHostName.addItem(hostDescription.getId());
 			}
 		} catch (Exception e) {
 			setError(e.getLocalizedMessage());
@@ -392,11 +392,11 @@ public class ApplicationDescriptionDialo
 	}
 
 	public String getApplicationName() {
-		return getShellApplicationDescription().getName();
+		return getShellApplicationDescription().getId();
 	}
 
 	public void setApplicationName(String applicationName) {
-		getShellApplicationDescription().setName(applicationName);
+		getShellApplicationDescription().setId(applicationName);
 		updateDialogStatus();
 	}
 

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionRegistrationWindow.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionRegistrationWindow.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionRegistrationWindow.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionRegistrationWindow.java Tue Oct 11 16:57:06 2011
@@ -324,7 +324,7 @@ public class ApplicationDescriptionRegis
 			}
             
             ShellApplicationDeployment shellApplicationDeployment = new ShellApplicationDeployment();
-            shellApplicationDeployment.setName(StringUtil.trimSpaceInString(this.applicationNameTextField.getText()));
+            shellApplicationDeployment.setId(StringUtil.trimSpaceInString(this.applicationNameTextField.getText()));
             shellApplicationDeployment.setExecutable(StringUtil.trimSpaceInString(this.executableTextField.getText()));
             shellApplicationDeployment.setWorkingDir(StringUtil.trimSpaceInString(this.workDirectoryTextField.getText()));
             shellApplicationDeployment.setTmpDir(StringUtil.trimSpaceInString(this.tempDirTextField.getText()));

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/HostDescriptionDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/HostDescriptionDialog.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/HostDescriptionDialog.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/HostDescriptionDialog.java Tue Oct 11 16:57:06 2011
@@ -220,11 +220,11 @@ public class HostDescriptionDialog exten
 	}
 
 	public String getHostLocation() {
-		return getHostDescription().getName();
+		return getHostDescription().getAddress();
 	}
 
 	public void setHostLocation(String hostLocation) {
-		getHostDescription().setName(hostLocation);
+		getHostDescription().setAddress(hostLocation);
 		updateDialogStatus();
 	}
 

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java Tue Oct 11 16:57:06 2011
@@ -322,11 +322,11 @@ public class ServiceDescriptionDialog ex
 	}
 
 	public String getServiceName() {
-		return getServiceDescription().getName();
+		return getServiceDescription().getId();
 	}
 
 	public void setServiceName(String serviceName) {
-		getServiceDescription().setName(serviceName);
+		getServiceDescription().setId(serviceName);
 		updateDialogStatus();
 	}
 	

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java?rev=1181887&r1=1181886&r2=1181887&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java Tue Oct 11 16:57:06 2011
@@ -80,7 +80,7 @@ public class JCRComponentRegistry extend
         try {
 			List<ServiceDescription> services = this.registry.searchServiceDescription("");
 			for (ServiceDescription serviceDescription : services) {
-			    String serviceName = serviceDescription.getName();
+			    String serviceName = serviceDescription.getId();
 			    JCRComponentReference jcr = new JCRComponentReference(serviceName, registry.getWSDL(serviceName));
 			    tree.add(new ComponentTreeNode(jcr));    
 			}
@@ -117,7 +117,7 @@ public class JCRComponentRegistry extend
     }
     
 	public String saveHostDescription(String name, HostDescription host) {
-    	return registry.saveHostDescription(name, host);
+    	return registry.saveHostDescription(host);
 	}
 	
 	public List<HostDescription> searchHostDescription(String nameRegEx) throws HostDescriptionRetrieveException, PathNotFoundException {
@@ -137,7 +137,7 @@ public class JCRComponentRegistry extend
 	}
 	
 	public String saveServiceDescription(String name, ServiceDescription service) {
-		return registry.saveServiceDescription(name, service);
+		return registry.saveServiceDescription(service);
 	}
 	
 	public ServiceDescription getServiceDescription(String serviceName) throws PathNotFoundException, ServiceDescriptionRetrieveException {



Mime
View raw message