You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2011/09/09 22:58:23 UTC

svn commit: r1167359 - in /incubator/airavata/trunk: ./ modules/commons/ modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/api/ modules/commons/registry-api/ modules/commons/registry-api/src/ modules/commons/registry-api/src/ma...

Author: lahiru
Date: Fri Sep  9 20:58:21 2011
New Revision: 1167359

URL: http://svn.apache.org/viewvc?rev=1167359&view=rev
Log:
creating new registry api module and use that in other locations. Update the distribution creation accordinly.

Added:
    incubator/airavata/trunk/modules/commons/registry-api/
    incubator/airavata/trunk/modules/commons/registry-api/pom.xml
    incubator/airavata/trunk/modules/commons/registry-api/src/
    incubator/airavata/trunk/modules/commons/registry-api/src/main/
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.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/
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
Modified:
    incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/api/
    incubator/airavata/trunk/modules/commons/pom.xml
    incubator/airavata/trunk/modules/commons/utils/airavata-common-utils.iml
    incubator/airavata/trunk/modules/distribution/src/main/assembly/bin-assembly.xml
    incubator/airavata/trunk/modules/gfac-axis2/pom.xml
    incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
    incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
    incubator/airavata/trunk/modules/gfac-core/pom.xml
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/ExecutionContext.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/impl/DefaultExecutionContext.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/main/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImpl.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/pom.xml
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java
    incubator/airavata/trunk/pom.xml

Modified: incubator/airavata/trunk/modules/commons/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/pom.xml?rev=1167359&r1=1167358&r2=1167359&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/pom.xml (original)
+++ incubator/airavata/trunk/modules/commons/pom.xml Fri Sep  9 20:58:21 2011
@@ -84,6 +84,7 @@
                 <module>workflow-tracking</module>
             	<module>gfac-schema</module>
 		<module>utils</module>
+		<module>registry-api</module>
 	    </modules>
         </profile>
     </profiles>

Added: incubator/airavata/trunk/modules/commons/registry-api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/pom.xml?rev=1167359&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/pom.xml (added)
+++ incubator/airavata/trunk/modules/commons/registry-api/pom.xml Fri Sep  9 20:58:21 2011
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+	license agreements. See the NOTICE file distributed with this work for additional 
+	information regarding copyright ownership. The ASF licenses this file to 
+	you under the Apache License, Version 2.0 (theÏ "License"); you may not use 
+	this file except in compliance with the License. You may obtain a copy of 
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+	by applicable law or agreed to in writing, software distributed under the 
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+	OF ANY ~ KIND, either express or implied. See the License for the specific 
+	language governing permissions and limitations under the License. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <artifactId>airavata-commons</artifactId>
+        <groupId>airavata</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>airavata</groupId>
+    <artifactId>airavata-registry-api</artifactId>
+    <packaging>jar</packaging>
+    <name>Airavata Common Utilities</name>
+    <url>http://incubator.apache.org/airavata/</url>
+
+    <dependencies>
+        <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>airavata</groupId>
+            <artifactId>airavata-gfac-schema-utils</artifactId>
+            <version>${airavata.version}</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <version>2.3.2</version>
+                    <configuration>
+                        <source>1.5</source>
+                        <target>1.5</target>
+                    </configuration>
+                </plugin>
+
+
+            </plugins>
+        </pluginManagement>
+    </build>
+</project>

Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java?rev=1167359&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java (added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java Fri Sep  9 20:58:21 2011
@@ -0,0 +1,54 @@
+/*
+ *
+ * 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.registry.api;
+
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+
+
+public interface Axis2Registry extends Registry {
+    
+    /**
+     * Save WSDL for Axis2
+     * 
+     * @param service
+     * @param WSDL
+     */
+    public String saveWSDL(String serviceName, String WSDL);
+    
+    /**
+     * Save WSDL for Axis2
+     * 
+     * @param serviceName
+     * @param service
+     */
+    public String saveWSDL(String serviceName, ServiceDescription service);
+    
+    
+    /**
+     * Load WSDL for Axis2
+     * 
+     * @param serviceName
+     * @return WSDL
+     */
+    public String getWSDL(String serviceName);
+}

Added: 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=1167359&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java (added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java Fri Sep  9 20:58:21 2011
@@ -0,0 +1,125 @@
+/*
+ *
+ * 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.registry.api;
+
+import java.util.List;
+
+import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+
+public interface Registry {
+	/**
+	 * Find locations where the service is deployed
+	 * 
+	 * @param serviceName
+	 * @return List of HostDescription having the service
+	 */
+	public List<HostDescription> getServiceLocation(String serviceName);	
+	
+	/**
+	 * Retrieve a service description i.e. name, description, parameters 
+	 * 
+	 * @param serviceName
+	 * @return a service description or null if a description is not found
+	 */
+	public ServiceDescription getServiceDescription(String serviceName);
+	
+	/**
+	 * Retrieve a deployment description for a service from the specific host
+	 * 
+	 * @param serviceName
+	 * @param hostName
+	 * @return a deployment description or null if a description is not found
+	 */
+	public ApplicationDeploymentDescription getDeploymentDescription(String serviceName, String hostName);
+	
+	/**
+	 * Retrieve a host description
+	 * 
+	 * @param name
+	 * @return a host description or null if a description is not found
+	 */
+	public HostDescription getHostDescription(String name);
+	
+	/**
+	 * Save a host description with the specific name.
+	 * 
+	 * @param name
+	 * @param host
+	 * @return identifier
+	 */
+	public String saveHostDescription(String name, HostDescription host);
+	
+	/**
+	 * Save a service description with the specific name.
+	 * 
+	 * @param service
+	 * @param host
+	 * @return identifier
+	 */
+	public String saveServiceDescription(String name, ServiceDescription service);
+	
+	/**
+	 * Save a deployment description according to the service and host
+	 * 
+	 * @param service
+	 * @param host
+	 * @param app
+	 * @return identifier
+	 */
+	public String saveDeploymentDescription(String service, String host, ApplicationDeploymentDescription app);
+	
+	/**
+	 * Deploy a service on a host
+	 * 
+	 * @param serviceName
+	 * @param hostName
+	 * @return true if service can be deploy on the hsot, otherwise false
+	 */
+	public boolean deployServiceOnHost(String serviceName, String hostName);
+		
+	/**
+	 * Search host description with name
+	 * 
+	 * @param name
+	 * @return the host descriptions with matched name
+	 */
+	public List<HostDescription> searchHostDescription(String name);
+	
+	/**
+	 * Search service description with name
+	 * 
+	 * @param name
+	 * @return the service descriptions with matched name
+	 */
+	public List<ServiceDescription> searchServiceDescription(String name);
+	
+	/**
+	 * Search deployment description from a service and/or a hostname
+	 *
+	 * @param serviceName 
+	 * @param hostName
+	 * @return the deployment descriptions with matched names
+	 */
+	public List<ApplicationDeploymentDescription> searchDeploymentDescription(String serviceName, String hostName);	
+}

Added: 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=1167359&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java (added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java Fri Sep  9 20:58:21 2011
@@ -0,0 +1,423 @@
+/*
+ *
+ * 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.registry.api.impl;
+
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.Credentials;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.RepositoryFactory;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+import javax.jcr.Value;
+
+import org.apache.airavata.registry.api.Axis2Registry;
+import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.commons.gfac.type.util.SchemaUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class JCRRegistry implements Axis2Registry {
+
+	private static final String SERVICE_NODE_NAME = "SERVICE_HOST";
+	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 LINK_NAME = "LINK";
+
+	private Repository repository;
+	private Credentials credentials;
+
+	private static Log log = LogFactory.getLog(JCRRegistry.class);
+
+	public JCRRegistry(String className, String user, String pass,
+			Map<String, String> map) {
+		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());
+
+		} catch (ClassNotFoundException e) {
+			log.error("Error class path settting", e);
+		} catch (RepositoryException e) {
+			log.error("Error connecting Remote Registry instance", e);
+		} catch (Exception e) {
+			log.error("Error init", e);
+		}
+	}
+
+    public JCRRegistry(Repository repo,Credentials credentials){
+        this.repository = repo;
+        this.credentials = credentials;
+    }
+
+	private 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) {
+		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) {
+		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) {
+		Session session = null;
+		HostDescription result = null;
+		try {
+			session = getSession();
+			Node hostNode = getHostNode(session);
+			Node node = hostNode.getNode(name);
+			Property prop = node.getProperty(XML_PROPERTY_NAME);
+			result = (HostDescription) 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 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 List<HostDescription> searchHostDescription(String name) {
+		// TODO implementation
+		return null;
+	}
+
+	public List<ServiceDescription> searchServiceDescription(String name) {
+	    Session session = null;
+        ArrayList<ServiceDescription> result = new ArrayList<ServiceDescription>();
+        try {
+            session = getSession();
+            Node node = getServiceNode(session);
+            NodeIterator nodes = node.getNodes();
+            for (; nodes.hasNext();) {
+                Node service = nodes.nextNode();
+                Property prop = service.getProperty(XML_PROPERTY_NAME);
+                result.add((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 List<ApplicationDeploymentDescription> searchDeploymentDescription(
+			String serviceName, String hostName) {
+		// TODO implementation
+		return null;
+	}
+
+    public String saveWSDL(String name, String WSDL) {
+        Session session = null;
+        String result = null;
+        try {
+            session = getSession();
+            Node serviceNode = getServiceNode(session);
+            Node node = getOrAddNode(serviceNode, name);
+            node.setProperty(WSDL_PROPERTY_NAME, WSDL);
+            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 saveWSDL(String serviceName, ServiceDescription service) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public String getWSDL(String serviceName) {
+        Session session = null;
+        String result = null;
+        try {
+            session = getSession();
+            Node serviceNode = getServiceNode(session);
+            Node node = serviceNode.getNode(serviceName);
+            Property prop = node.getProperty(WSDL_PROPERTY_NAME);
+            result = prop.getString();
+        } catch (Exception e) {
+            System.out.println(e);
+            e.printStackTrace();
+            // TODO propagate
+        } finally {
+            if (session != null && session.isLive()) {
+                session.logout();
+            }
+        }
+        return result;
+    }
+}

Modified: incubator/airavata/trunk/modules/distribution/src/main/assembly/bin-assembly.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/distribution/src/main/assembly/bin-assembly.xml?rev=1167359&r1=1167358&r2=1167359&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/distribution/src/main/assembly/bin-assembly.xml (original)
+++ incubator/airavata/trunk/modules/distribution/src/main/assembly/bin-assembly.xml Fri Sep  9 20:58:21 2011
@@ -270,6 +270,20 @@
 				<include>*.jar</include>
 			</includes>
 		</fileSet>
+		<fileSet>
+			<directory>../commons/registry-api/target</directory>
+			<outputDirectory>lib</outputDirectory>
+			<includes>
+				<include>*.jar</include>
+			</includes>
+		</fileSet>
+		<fileSet>
+			<directory>../commons/utils/target</directory>
+			<outputDirectory>lib</outputDirectory>
+			<includes>
+				<include>*.jar</include>
+			</includes>
+		</fileSet>
 
 		<fileSet>
 			<directory>../gfac-axis2/src/main/resources/</directory>

Modified: incubator/airavata/trunk/modules/gfac-axis2/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/pom.xml?rev=1167359&r1=1167358&r2=1167359&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/pom.xml (original)
+++ incubator/airavata/trunk/modules/gfac-axis2/pom.xml Fri Sep  9 20:58:21 2011
@@ -70,6 +70,11 @@
             <groupId>xerces</groupId>
             <artifactId>xercesImpl</artifactId>
         </dependency>
+	<dependency>
+		<groupId>airavata</groupId>
+		<artifactId>airavata-registry-api</artifactId>
+		<version>${airavata.version}</version>
+	</dependency>
     </dependencies>
     <build>
         <plugins>

Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java?rev=1167359&r1=1167358&r2=1167359&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java (original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java Fri Sep  9 20:58:21 2011
@@ -34,7 +34,7 @@ import javax.jcr.Repository;
 import javax.jcr.RepositoryFactory;
 import javax.jcr.SimpleCredentials;
 
-import org.apache.airavata.commons.gfac.api.impl.JCRRegistry;
+import org.apache.airavata.registry.api.impl.JCRRegistry;
 import org.apache.airavata.core.gfac.services.GenericService;
 import org.apache.airavata.services.gfac.axis2.handlers.AmazonSecurityHandler;
 import org.apache.airavata.services.gfac.axis2.handlers.MyProxySecurityHandler;

Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java?rev=1167359&r1=1167358&r2=1167359&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java (original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java Fri Sep  9 20:58:21 2011
@@ -32,7 +32,7 @@ import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
-import org.apache.airavata.commons.gfac.api.Axis2Registry;
+import org.apache.airavata.registry.api.Axis2Registry;
 import org.apache.airavata.commons.gfac.type.Parameter;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
 import org.apache.airavata.commons.gfac.type.parameter.AbstractParameter;

Modified: incubator/airavata/trunk/modules/gfac-core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/pom.xml?rev=1167359&r1=1167358&r2=1167359&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/pom.xml (original)
+++ incubator/airavata/trunk/modules/gfac-core/pom.xml Fri Sep  9 20:58:21 2011
@@ -73,6 +73,11 @@
             <artifactId>airavata-gfac-schema-utils</artifactId>
             <version>${airavata.version}</version>
         </dependency>
+	<dependency>
+            <groupId>airavata</groupId>
+            <artifactId>airavata-registry-api</artifactId>
+            <version>${airavata.version}</version>
+        </dependency>
 
         <!-- Workflow Tracking -->
         <dependency>

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/ExecutionContext.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/ExecutionContext.java?rev=1167359&r1=1167358&r2=1167359&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/ExecutionContext.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/ExecutionContext.java Fri Sep  9 20:58:21 2011
@@ -21,10 +21,9 @@
 
 package org.apache.airavata.core.gfac.context.invocation;
 
-import org.apache.airavata.commons.gfac.api.Registry;
 import org.apache.airavata.core.gfac.notification.Notifiable;
 import org.apache.airavata.core.gfac.notification.Notifier;
-
+import org.apache.airavata.registry.api.Registry;
 /**
  * The Execution Context is used for passing information around the whole
  * service. It keeps information about general execution step. For example,

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/impl/DefaultExecutionContext.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/impl/DefaultExecutionContext.java?rev=1167359&r1=1167358&r2=1167359&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/impl/DefaultExecutionContext.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/impl/DefaultExecutionContext.java Fri Sep  9 20:58:21 2011
@@ -21,7 +21,7 @@
 
 package org.apache.airavata.core.gfac.context.invocation.impl;
 
-import org.apache.airavata.commons.gfac.api.Registry;
+import org.apache.airavata.registry.api.Registry;
 import org.apache.airavata.core.gfac.context.invocation.ExecutionContext;
 import org.apache.airavata.core.gfac.notification.Notifiable;
 import org.apache.airavata.core.gfac.notification.Notifier;

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=1167359&r1=1167358&r2=1167359&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 Fri Sep  9 20:58:21 2011
@@ -25,7 +25,7 @@ import java.net.UnknownHostException;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.airavata.commons.gfac.api.Registry;
+import org.apache.airavata.registry.api.Registry;
 import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
 import org.apache.airavata.commons.gfac.type.HostDescription;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImpl.java?rev=1167359&r1=1167358&r2=1167359&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImpl.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImpl.java Fri Sep  9 20:58:21 2011
@@ -27,8 +27,8 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
 
-import org.apache.airavata.commons.gfac.api.Registry;
-import org.apache.airavata.commons.gfac.api.impl.JCRRegistry;
+import org.apache.airavata.registry.api.Registry;
+import org.apache.airavata.registry.api.impl.JCRRegistry;
 import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
 import org.apache.airavata.core.gfac.context.invocation.impl.DefaultExecutionContext;
 import org.apache.airavata.core.gfac.context.security.impl.GSISecurityContext;

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=1167359&r1=1167358&r2=1167359&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 Fri Sep  9 20:58:21 2011
@@ -27,7 +27,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.airavata.commons.gfac.api.impl.JCRRegistry;
+import org.apache.airavata.registry.api.impl.JCRRegistry;
 import org.apache.airavata.commons.gfac.type.DataType;
 import org.apache.airavata.commons.gfac.type.HostDescription;
 import org.apache.airavata.commons.gfac.type.Parameter;

Modified: incubator/airavata/trunk/modules/xbaya-gui/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/pom.xml?rev=1167359&r1=1167358&r2=1167359&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/pom.xml (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/pom.xml Fri Sep  9 20:58:21 2011
@@ -392,6 +392,12 @@
         </dependency>
 	<dependency>
             <groupId>airavata</groupId>
+            <artifactId>airavata-registry-api</artifactId>
+            <version>${airavata.version}</version>
+        </dependency>
+
+	<dependency>
+            <groupId>airavata</groupId>
             <artifactId>airavata-common-utils</artifactId>
             <version>${airavata.version}</version>
         </dependency>

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=1167359&r1=1167358&r2=1167359&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 Fri Sep  9 20:58:21 2011
@@ -25,7 +25,7 @@ import java.net.URI;
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.airavata.commons.gfac.api.impl.JCRRegistry;
+import org.apache.airavata.registry.api.impl.JCRRegistry;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
 import org.apache.airavata.xbaya.component.gui.ComponentTreeNode;
 

Modified: incubator/airavata/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/pom.xml?rev=1167359&r1=1167358&r2=1167359&view=diff
==============================================================================
--- incubator/airavata/trunk/pom.xml (original)
+++ incubator/airavata/trunk/pom.xml Fri Sep  9 20:58:21 2011
@@ -83,7 +83,6 @@
                 <groupId>org.slf4j</groupId>
                 <artifactId>slf4j-simple</artifactId>
                 <version>${org.slf4j.version}</version>
-                <scope>test</scope>
             </dependency>
 
             <dependency>