airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1382653 [1/3] - in /incubator/airavata/trunk/modules: airavata-client/src/main/java/org/apache/airavata/client/ commons/registry-api/src/main/java/org/apache/airavata/registry/api/ gfac-core/src/main/java/org/apache/airavata/core/gfac/cont...
Date Mon, 10 Sep 2012 06:32:10 GMT
Author: samindaw
Date: Mon Sep 10 06:32:08 2012
New Revision: 1382653

URL: http://svn.apache.org/viewvc?rev=1382653&view=rev
Log:
updating xbaya to support new registry api

Added:
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistryblahblah.java
      - copied, changed from r1382341, incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java
Modified:
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry2.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/DescriptorRegistry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/PublishedWorkflowRegistry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/UserWorkflowRegistry.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFacConfiguration.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/QueryGenerator.java
    incubator/airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURL.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/HostDescriptions.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURL.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURLs.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURL.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURLs.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceDescriptions.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiments.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplate.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplates.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceReader.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowStatusUpdater.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionsNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplateNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DeploymentDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorListDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ServiceDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/JCRRegistryWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryLoaderWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistrySearchResult.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XBayaUtil.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexForEachWorkflowTest.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathWorkflowTest.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/CrossProductWorkflowTest.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ForEachWorkflowTest.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleForEachWorkflowTest.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleMathWorkflowTest.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTest.java

Modified: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java (original)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java Mon Sep 10 06:32:08 2012
@@ -33,6 +33,7 @@ import java.nio.channels.FileChannel;
 import java.nio.charset.Charset;
 import java.rmi.RemoteException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Calendar;
 import java.util.HashMap;
 import java.util.List;
@@ -41,9 +42,13 @@ import java.util.Properties;
 import java.util.UUID;
 
 import javax.jcr.Node;
+import javax.jcr.NodeIterator;
 import javax.jcr.PathNotFoundException;
 import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
 import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
 import javax.jcr.ValueFormatException;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
@@ -68,6 +73,7 @@ import org.apache.airavata.common.workfl
 import org.apache.airavata.registry.api.AiravataRegistry;
 import org.apache.airavata.registry.api.impl.AiravataJCRRegistry;
 import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+import org.apache.airavata.schemas.wec.WorkflowSchedulingContextDocument.WorkflowSchedulingContext;
 import org.apache.airavata.workflow.model.component.ComponentException;
 import org.apache.airavata.workflow.model.component.ws.WSComponentPort;
 import org.apache.airavata.workflow.model.graph.GraphException;
@@ -177,6 +183,8 @@ public class AiravataClient implements A
 			config.put(AiravataClient.MSGBOX,URLList==null || URLList.size()==0? "http://localhost:8080/axis2/services/MsgBoxService":URLList.get(0).toString());
 			URLList = registryObject.getInterpreterServiceURLList();
 			config.put(AiravataClient.WORKFLOWSERVICEURL,URLList==null || URLList.size()==0? "http://localhost:8080/axis2/services/WorkflowInterpretor?wsdl":URLList.get(0).toString());
+			List<String> urlList = registryObject.getGFacDescriptorList();
+			config.put(AiravataClient.GFAC,urlList==null || urlList.size()==0? "http://localhost:8080/axis2/services/GFacService":urlList.get(0).toString());
 			config.put(AiravataClient.WITHLISTENER,"true");
 		}
 		return config;
@@ -715,16 +723,105 @@ public class AiravataClient implements A
 	       return builder;
 	}
 
-	public static void main(String[] args) throws Exception {
-		HashMap<String, String> config = new HashMap<String,String>();
-		AiravataClient airavataClient = new AiravataClient(config);
-		String workflowName = "Workflow1";
-		List<WorkflowInput> workflowInputs = airavataClient.getWorkflowInputs(workflowName);
-		workflowInputs.get(0).setValue("hi");
-		String topicId = airavataClient.runWorkflow(workflowName, workflowInputs);
-		System.out.println(topicId);
+ 	public static void main(String[] args) throws Exception {
+// 		AiravataAPI api = AiravataClientUtils.getAPI(new URI("http://gf7.ucs.indiana.edu:8030/jackrabbit/rmi"), "admin", "admin");
+// 		System.out.println(api.getAiravataManager().getWorkflowInterpreterServiceURL());
+// 		System.exit(0);
+// 		WorkflowSchedulingContext workflowSchedulingContext= WorkflowSchedulingContext.Factory.newInstance();
+//		WorkflowContextHeaderBuilder workflowContextHeader = api.getExecutionManager().createWorkflowContextHeader();
+//		workflowContextHeader.setWorkflowSchedulingContext(workflowSchedulingContext);
+//		workflowSchedulingContext.addNewApplicationSchedulingContext();
+// 		System.out.println(workflowContextHeader.getWorkflowSchedulingContext());
+// 		System.exit(0);
+ 		
+		HashMap<String, String> map;
+		URI uri;
+		
+		uri=new URI("http://gw56.quarry.iu.teragrid.org:8090/jackrabbit-webapp-2.4.0/rmi");
+//		uri=new URI("http://localhost:8081/rmi");
+		map = new HashMap<String, String>();
+		map.put("org.apache.jackrabbit.repository.uri", uri.toString());
+		AiravataJCRRegistry reg1 = new AiravataJCRRegistry(uri, "org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory", "admin","admin", map);
+		
+		uri=new URI("http://gw26.quarry.iu.teragrid.org:8090/jackrabbit-webapp-2.4.0/rmi");
+//		uri=new URI("http://localhost:8082/rmi");
+		map = new HashMap<String, String>();
+		map.put("org.apache.jackrabbit.repository.uri", uri.toString());
+		AiravataJCRRegistry reg2 = new AiravataJCRRegistry(uri, "org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory", "admin","admin", map);
+//		Session login = reg2.getRepository().login(new SimpleCredentials("admin","admin".toCharArray()));
+//		login.getRootNode().getNode("experiments").remove();
+//		login.getRootNode().getNode("AIRAVATA_CONFIGURATION_DATA").remove();
+//		login.save();
+//		login.logout();
+//		migrateRespositoryData(reg1, reg2);
+		System.exit(0);
+	}
+ 	
+	private static void addNode(Node parentNode, Node childNode) throws RepositoryException{
+		Node node;
+		String childNodeName = childNode.getName();
+		if (!parentNode.hasNode(childNodeName)){
+			node=parentNode.addNode(childNodeName);
+		}else{
+			node=parentNode.getNode(childNodeName);
+		}
+		System.out.println(node.getPath());
+		PropertyIterator childProperties = childNode.getProperties();
+		while(childProperties.hasNext()){
+			Property childProperty = childProperties.nextProperty();
+			if (!(childProperty.getName().startsWith("jcr:") || childProperty.getName().startsWith("rep:"))) {
+				if (childProperty.isMultiple()){
+					node.setProperty(childProperty.getName(),
+							childProperty.getValues());
+				}else{
+					node.setProperty(childProperty.getName(),
+							childProperty.getValue());
+				}
+				
+			}
+		}
+		NodeIterator children = childNode.getNodes();
+		while(children.hasNext()){
+			Node c=children.nextNode();
+			addNode(node,c);
+		}
 	}
-
+	
+	private static void migrateRespositoryData(
+			AiravataJCRRegistry sourceRegistry,
+			AiravataJCRRegistry targetRegistry) throws Exception {
+		Session session1 = null;
+		Session session2 = null;
+		try {
+			session1 = sourceRegistry.getRepository().login(new SimpleCredentials(sourceRegistry.getUsername(), new String(sourceRegistry.getPassword()).toCharArray()));
+			session2 = targetRegistry.getRepository().login(new SimpleCredentials(targetRegistry.getUsername(), new String(targetRegistry.getPassword()).toCharArray()));
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			throw e;
+		}
+		
+		
+		NodeIterator nodes = session1.getRootNode().getNodes();
+		Node rootNode = session2.getRootNode();
+		List<String> ignoreRoots=Arrays.asList(new String[]{"/AIRAVATA_CONFIGURATION_DATA"});
+		while(nodes.hasNext()){
+			Node nextNode = nodes.nextNode();
+			String path = nextNode.getPath();
+			if (!(path.equals("/jcr:system")||path.equals("/rep:policy") || ignoreRoots.contains(path))) {
+				addNode(rootNode,nextNode);
+				System.out.println();
+			}
+		}
+		System.out.print("Saving session.");
+		session1.logout();
+		System.out.print(".");
+		session2.save();
+		System.out.print(".");
+		session2.logout();
+		System.out.println(".done");
+	}
+ 		 	
 	public AiravataManager getAiravataManager() {
 		if (airavataManagerImpl==null) {
 			airavataManagerImpl = new AiravataManagerImpl(this);

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry2.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry2.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry2.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry2.java Mon Sep 10 06:32:08 2012
@@ -21,8 +21,10 @@
 
 package org.apache.airavata.registry.api;
 
+import java.util.Observable;
 
-public abstract class AiravataRegistry2 implements DescriptorRegistry, ProjectsRegistry, PublishedWorkflowRegistry, UserWorkflowRegistry, ConfigurationRegistry, ProvenanceRegistry{
+
+public abstract class AiravataRegistry2 extends Observable implements DescriptorRegistry, ProjectsRegistry, PublishedWorkflowRegistry, UserWorkflowRegistry, ConfigurationRegistry, ProvenanceRegistry{
 	private Gateway gateway;
 	private AiravataUser user;
 	

Copied: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistryblahblah.java (from r1382341, incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java)
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistryblahblah.java?p2=incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistryblahblah.java&p1=incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java&r1=1382341&r2=1382653&rev=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistryblahblah.java Mon Sep 10 06:32:08 2012
@@ -41,7 +41,7 @@ import org.apache.airavata.registry.api.
 import org.apache.airavata.registry.api.workflow.*;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
 
-public interface AiravataRegistry extends Registry{
+public interface AiravataRegistryblahblah extends Registry{
     /**
      * Find locations where the service is deployed
      * 

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/DescriptorRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/DescriptorRegistry.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/DescriptorRegistry.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/DescriptorRegistry.java Mon Sep 10 06:32:08 2012
@@ -39,6 +39,7 @@ public interface DescriptorRegistry exte
 	 */
 	
 	//---------Host Descriptor data------------
+	public boolean isHostDescriptorExists(String descriptorName)throws RegistryException;
 	public void addHostDescriptor(HostDescription descriptor) throws DescriptorAlreadyExistsException, RegistryException;
 	public void updateHostDescriptor(HostDescription descriptor)throws DescriptorDoesNotExistsException, RegistryException;
 	public HostDescription getHostDescriptor(String hostName)throws DescriptorDoesNotExistsException,MalformedDescriptorException, RegistryException;
@@ -47,6 +48,7 @@ public interface DescriptorRegistry exte
 	public ResourceMetadata getHostDescriptorMetadata(String hostName)throws DescriptorDoesNotExistsException, RegistryException;
 
 	//---------Service Descriptor data------------
+	public boolean isServiceDescriptorExists(String descriptorName)throws RegistryException;
 	public void addServiceDescriptor(ServiceDescription descriptor)throws DescriptorAlreadyExistsException, RegistryException;
 	public void updateServiceDescriptor(ServiceDescription descriptor)throws DescriptorDoesNotExistsException, RegistryException;
 	public ServiceDescription getServiceDescriptor(String serviceName)throws DescriptorDoesNotExistsException,MalformedDescriptorException, RegistryException;
@@ -55,12 +57,15 @@ public interface DescriptorRegistry exte
 	public ResourceMetadata getServiceDescriptorMetadata(String serviceName)throws DescriptorDoesNotExistsException, RegistryException;
 	
 	//---------Application Descriptor data------------
+	public boolean isApplicationDescriptorExists(String serviceName, String hostName, String descriptorName)throws RegistryException;
 	public void addApplicationDescriptor(ServiceDescription serviceDescription, HostDescription hostDescriptor, ApplicationDeploymentDescription descriptor)throws DescriptorAlreadyExistsException, RegistryException;
 	public void addApplicationDescriptor(String serviceName, String hostName, ApplicationDeploymentDescription descriptor)throws DescriptorAlreadyExistsException, RegistryException;
 	public void udpateApplicationDescriptor(ServiceDescription serviceDescription, HostDescription hostDescriptor, ApplicationDeploymentDescription descriptor)throws DescriptorDoesNotExistsException, RegistryException;
 	public void updateApplicationDescriptor(String serviceName, String hostName, ApplicationDeploymentDescription descriptor)throws DescriptorDoesNotExistsException, RegistryException;
+	public ApplicationDeploymentDescription getApplicationDescriptor(String serviceName, String hostname, String applicationName)throws DescriptorDoesNotExistsException, MalformedDescriptorException, RegistryException;
 	public ApplicationDeploymentDescription getApplicationDescriptors(String serviceName, String hostname)throws MalformedDescriptorException, RegistryException;
 	public Map<String,ApplicationDeploymentDescription> getApplicationDescriptors(String serviceName)throws MalformedDescriptorException, RegistryException;
+	public Map<String[],ApplicationDeploymentDescription> getApplicationDescriptors()throws MalformedDescriptorException, RegistryException;
 	public void removeApplicationDescriptor(String serviceName, String hostName, String applicationName)throws DescriptorDoesNotExistsException, RegistryException;
 	public ResourceMetadata getApplicationDescriptorMetadata(String serviceName, String hostName, String applicationName)throws DescriptorDoesNotExistsException, RegistryException;
 

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java Mon Sep 10 06:32:08 2012
@@ -99,6 +99,23 @@ public interface ProvenanceRegistry exte
      */
     public abstract boolean saveWorkflowExecutionMetadata(String experimentId, String metadata) throws RegistryException;
     
+    /**
+     * Return the template name of the workflow that this intance was created from
+     * @param experimentId
+     * @param workflowInstanceId
+     * @return
+     * @throws RegistryException
+     */
+    public abstract String getWorkflowExecutionTemplateName(String experimentId, String workflowInstanceId) throws RegistryException;
+    
+    /**
+     * Save the template name of the workflow that this intance was created from
+     * @param experimentId
+     * @param workflowInstanceId
+     * @throws RegistryException
+     */
+    public abstract void setWorkflowExecutionTemplateName(String experimentId, String workflowInstanceId) throws RegistryException;
+    
 	
     /*-------------------------------------- Experiment Workflow instance node data ----------------------------------------*/
     /**

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/PublishedWorkflowRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/PublishedWorkflowRegistry.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/PublishedWorkflowRegistry.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/PublishedWorkflowRegistry.java Mon Sep 10 06:32:08 2012
@@ -32,6 +32,7 @@ import org.apache.airavata.registry.api.
 
 public interface PublishedWorkflowRegistry extends AiravataSubRegistry {
 	
+	public boolean isPublishedWorkflowExists(String workflowName) throws RegistryException;
 	public void publishWorkflow(String workflowName, String publishWorkflowName) throws PublishedWorkflowAlreadyExistsException, UserWorkflowDoesNotExistsException, RegistryException;
 	public void publishWorkflow(String workflowName) throws PublishedWorkflowAlreadyExistsException, UserWorkflowDoesNotExistsException, RegistryException;
 	

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/UserWorkflowRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/UserWorkflowRegistry.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/UserWorkflowRegistry.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/UserWorkflowRegistry.java Mon Sep 10 06:32:08 2012
@@ -21,6 +21,8 @@
 
 package org.apache.airavata.registry.api;
 
+import java.util.Map;
+
 import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.registry.api.exception.worker.UserWorkflowAlreadyExistsException;
 import org.apache.airavata.registry.api.exception.worker.UserWorkflowDoesNotExistsException;
@@ -28,10 +30,13 @@ import org.apache.airavata.registry.api.
 
 public interface UserWorkflowRegistry extends AiravataSubRegistry {
 	
+	public boolean isWorkflowExists(String workflowName) throws RegistryException;
 	public void addWorkflow(String workflowName, String workflowGraphXml) throws UserWorkflowAlreadyExistsException, RegistryException;
 	public void updateWorkflow(String workflowName, String workflowGraphXml) throws UserWorkflowDoesNotExistsException, RegistryException;
 	
 	public String getWorkflowGraphXML(String workflowName) throws UserWorkflowDoesNotExistsException, RegistryException;
+	public Map<String,String> getWorkflows() throws RegistryException;
+	
 	public ResourceMetadata getWorkflowMetadata(String workflowName) throws RegistryException;	
 	
 	public void removeWorkflow(String workflowName) throws UserWorkflowDoesNotExistsException, RegistryException;

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFacConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFacConfiguration.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFacConfiguration.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFacConfiguration.java Mon Sep 10 06:32:08 2012
@@ -20,8 +20,8 @@
 */
 package org.apache.airavata.core.gfac.context;
 
-import org.apache.airavata.registry.api.AiravataRegistry;
-import org.apache.airavata.registry.api.Axis2Registry;
+import org.apache.airavata.registry.api.AiravataRegistry2;
+
 
 public class GFacConfiguration {
 
@@ -34,11 +34,11 @@ public class GFacConfiguration {
     private int myProxyLifeCycle;
 
 
-    private AiravataRegistry registry;
+    private AiravataRegistry2 registry;
 
     private String trustedCertLocation;
 
-    public GFacConfiguration(String myProxyServer, String myProxyUser, String myProxyPassphrase, int myProxyLifeCycle, AiravataRegistry axis2Registry, String trustedCertLocation) {
+    public GFacConfiguration(String myProxyServer, String myProxyUser, String myProxyPassphrase, int myProxyLifeCycle, AiravataRegistry2 axis2Registry, String trustedCertLocation) {
         this.myProxyServer = myProxyServer;
         this.myProxyUser = myProxyUser;
         this.myProxyPassphrase = myProxyPassphrase;
@@ -63,7 +63,7 @@ public class GFacConfiguration {
         return myProxyLifeCycle;
     }
 
-    public AiravataRegistry getRegistry() {
+    public AiravataRegistry2 getRegistry() {
         return registry;
     }
 

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java (original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java Mon Sep 10 06:32:08 2012
@@ -239,10 +239,13 @@ public class AiravataJPARegistry extends
 
     /**---------------------------------Descriptor Registry----------------------------------**/
     
-    public void addHostDescriptor(HostDescription descriptor) throws DescriptorAlreadyExistsException {
+    public boolean isHostDescriptorExists(String descriptorName)throws RegistryException{
+    	return jpa.getGateway().isHostDescriptorExists(descriptorName);
+    }
+    public void addHostDescriptor(HostDescription descriptor) throws RegistryException {
         GatewayResource gateway = jpa.getGateway();
         String hostName = descriptor.getType().getHostName();
-		if (gateway.isHostDescriptorExists(hostName)){
+		if (isHostDescriptorExists(hostName)){
         	throw new DescriptorAlreadyExistsException(hostName);
         }
         HostDescriptorResource hostDescriptorResource = gateway.createHostDescriptorResource(hostName);
@@ -250,10 +253,10 @@ public class AiravataJPARegistry extends
         hostDescriptorResource.save();
     }
 
-    public void updateHostDescriptor(HostDescription descriptor) throws DescriptorDoesNotExistsException {
+    public void updateHostDescriptor(HostDescription descriptor) throws RegistryException {
     	GatewayResource gateway = jpa.getGateway();
         String hostName = descriptor.getType().getHostName();
-		if (!gateway.isHostDescriptorExists(hostName)){
+		if (!isHostDescriptorExists(hostName)){
         	throw new DescriptorDoesNotExistsException(hostName);
         }
         HostDescriptorResource hostDescriptorResource = gateway.getHostDescriptorResource(hostName);
@@ -261,9 +264,9 @@ public class AiravataJPARegistry extends
         hostDescriptorResource.save();
     }
 
-    public HostDescription getHostDescriptor(String hostName) throws DescriptorDoesNotExistsException, MalformedDescriptorException {
+    public HostDescription getHostDescriptor(String hostName) throws RegistryException {
         GatewayResource gateway = jpa.getGateway();
-		if (!gateway.isHostDescriptorExists(hostName)){
+		if (!isHostDescriptorExists(hostName)){
         	throw new DescriptorDoesNotExistsException(hostName);
         }
         HostDescriptorResource hostDescriptorResource = gateway.getHostDescriptorResource(hostName);
@@ -280,9 +283,9 @@ public class AiravataJPARegistry extends
         }
 	}
 
-    public void removeHostDescriptor(String hostName) throws DescriptorDoesNotExistsException {
+    public void removeHostDescriptor(String hostName) throws RegistryException {
     	GatewayResource gateway = jpa.getGateway();
-		if (!gateway.isHostDescriptorExists(hostName)){
+		if (!isHostDescriptorExists(hostName)){
         	throw new DescriptorDoesNotExistsException(hostName);
         }
 		gateway.removeHostDescriptor(hostName);
@@ -306,10 +309,14 @@ public class AiravataJPARegistry extends
         throw new UnimplementedRegistryOperationException();
     }
 
-    public void addServiceDescriptor(ServiceDescription descriptor) throws DescriptorAlreadyExistsException {
+    public boolean isServiceDescriptorExists(String descriptorName)throws RegistryException{
+    	return jpa.getGateway().isServiceDescriptorExists(descriptorName);
+    }
+    
+    public void addServiceDescriptor(ServiceDescription descriptor) throws RegistryException {
     	GatewayResource gateway = jpa.getGateway();
         String serviceName = descriptor.getType().getName();
-		if (gateway.isServiceDescriptorExists(serviceName)){
+		if (isServiceDescriptorExists(serviceName)){
         	throw new DescriptorAlreadyExistsException(serviceName);
         }
         ServiceDescriptorResource serviceDescriptorResource = gateway.createServiceDescriptorResource(serviceName);
@@ -317,10 +324,10 @@ public class AiravataJPARegistry extends
         serviceDescriptorResource.save();
     }
 
-    public void updateServiceDescriptor(ServiceDescription descriptor) throws DescriptorDoesNotExistsException {
+    public void updateServiceDescriptor(ServiceDescription descriptor) throws RegistryException {
     	GatewayResource gateway = jpa.getGateway();
         String serviceName = descriptor.getType().getName();
-		if (!gateway.isServiceDescriptorExists(serviceName)){
+		if (!isServiceDescriptorExists(serviceName)){
         	throw new DescriptorDoesNotExistsException(serviceName);
         }
         ServiceDescriptorResource serviceDescriptorResource = gateway.getServiceDescriptorResource(serviceName);
@@ -347,9 +354,9 @@ public class AiravataJPARegistry extends
         }
 	}
 
-    public void removeServiceDescriptor(String serviceName) throws DescriptorDoesNotExistsException {
+    public void removeServiceDescriptor(String serviceName) throws RegistryException {
     	GatewayResource gateway = jpa.getGateway();
-		if (!gateway.isServiceDescriptorExists(serviceName)){
+		if (!isServiceDescriptorExists(serviceName)){
         	throw new DescriptorDoesNotExistsException(serviceName);
         }
 		gateway.removeServiceDescriptor(serviceName);
@@ -376,15 +383,19 @@ public class AiravataJPARegistry extends
     	return serviceName+"/"+hostName+"/"+applicationName;
     }
     
-    public void addApplicationDescriptor(ServiceDescription serviceDescription, HostDescription hostDescriptor, ApplicationDeploymentDescription descriptor) throws DescriptorAlreadyExistsException {
+    public boolean isApplicationDescriptorExists(String serviceName, String hostName, String descriptorName)throws RegistryException{
+ 		return jpa.getGateway().isApplicationDescriptorExists(createAppName(serviceName, hostName, descriptorName));
+    }
+    
+    public void addApplicationDescriptor(ServiceDescription serviceDescription, HostDescription hostDescriptor, ApplicationDeploymentDescription descriptor) throws RegistryException {
         addApplicationDescriptor(serviceDescription.getType().getName(),hostDescriptor.getType().getHostName(),descriptor);
     }
 
-    public void addApplicationDescriptor(String serviceName, String hostName, ApplicationDeploymentDescription descriptor) throws DescriptorAlreadyExistsException {
+    public void addApplicationDescriptor(String serviceName, String hostName, ApplicationDeploymentDescription descriptor) throws RegistryException {
     	GatewayResource gateway = jpa.getGateway();
         String applicationName = descriptor.getType().getApplicationName().getStringValue();
         applicationName = createAppName(serviceName, hostName, applicationName);
-		if (gateway.isApplicationDescriptorExists(applicationName)){
+		if (isApplicationDescriptorExists(serviceName,hostName,descriptor.getType().getApplicationName().getStringValue())){
         	throw new DescriptorAlreadyExistsException(applicationName);
         }
         ApplicationDescriptorResource applicationDescriptorResource = gateway.createApplicationDescriptorResource(applicationName);
@@ -394,15 +405,15 @@ public class AiravataJPARegistry extends
         applicationDescriptorResource.save();
     }
 
-    public void udpateApplicationDescriptor(ServiceDescription serviceDescription, HostDescription hostDescriptor, ApplicationDeploymentDescription descriptor) throws DescriptorDoesNotExistsException {
+    public void udpateApplicationDescriptor(ServiceDescription serviceDescription, HostDescription hostDescriptor, ApplicationDeploymentDescription descriptor) throws RegistryException {
     	updateApplicationDescriptor(serviceDescription.getType().getName(),hostDescriptor.getType().getHostName(),descriptor);
     }
 
-    public void updateApplicationDescriptor(String serviceName, String hostName, ApplicationDeploymentDescription descriptor) throws DescriptorDoesNotExistsException {
+    public void updateApplicationDescriptor(String serviceName, String hostName, ApplicationDeploymentDescription descriptor) throws RegistryException {
     	GatewayResource gateway = jpa.getGateway();
     	String applicationName = descriptor.getType().getApplicationName().getStringValue();
         applicationName = createAppName(serviceName, hostName, applicationName);
-		if (!gateway.isApplicationDescriptorExists(applicationName)){
+		if (!isApplicationDescriptorExists(serviceName,hostName,descriptor.getType().getApplicationName().getStringValue())){
         	throw new DescriptorDoesNotExistsException(applicationName);
         }
         ApplicationDescriptorResource serviceDescriptorResource = gateway.getApplicationDescriptorResource(applicationName);
@@ -418,6 +429,15 @@ public class AiravataJPARegistry extends
             throw new MalformedDescriptorException(applicationDescriptorResource.getName(),e);
         }
 	}
+    
+    public ApplicationDeploymentDescription getApplicationDescriptor(String serviceName, String hostname, String applicationName)throws DescriptorDoesNotExistsException, MalformedDescriptorException, RegistryException{
+    	GatewayResource gateway = jpa.getGateway();
+		if (!isApplicationDescriptorExists(serviceName,hostname,applicationName)){
+        	throw new DescriptorDoesNotExistsException(createAppName(serviceName, hostname, applicationName));
+        }
+        return createApplicationDescriptor(gateway.getApplicationDescriptorResource(createAppName(serviceName, hostname, applicationName)));
+    }
+    
     public ApplicationDeploymentDescription getApplicationDescriptors(String serviceName, String hostname) throws MalformedDescriptorException {
     	GatewayResource gateway = jpa.getGateway();
 		List<ApplicationDescriptorResource> applicationDescriptorResources = gateway.getApplicationDescriptorResources(serviceName, hostname);
@@ -436,11 +456,21 @@ public class AiravataJPARegistry extends
 		}
 		return map;
     }
+    
+    public Map<String[],ApplicationDeploymentDescription> getApplicationDescriptors()throws MalformedDescriptorException, RegistryException{
+    	GatewayResource gateway = jpa.getGateway();
+		Map<String[], ApplicationDeploymentDescription> map=new HashMap<String[],ApplicationDeploymentDescription>();
+		List<ApplicationDescriptorResource> applicationDescriptorResources = gateway.getApplicationDescriptorResources();
+		for (ApplicationDescriptorResource resource : applicationDescriptorResources) {
+			map.put(new String[]{resource.getServiceDescName(),resource.getHostDescName()},createApplicationDescriptor(resource));
+		}
+		return map;
+    }
 
-    public void removeApplicationDescriptor(String serviceName, String hostName, String applicationName) throws DescriptorDoesNotExistsException {
+    public void removeApplicationDescriptor(String serviceName, String hostName, String applicationName) throws RegistryException {
     	GatewayResource gateway = jpa.getGateway();
     	String appName = createAppName(serviceName, hostName, applicationName);
-		if (!gateway.isApplicationDescriptorExists(appName)) {
+    	if (!isApplicationDescriptorExists(serviceName,hostName,applicationName)){
 			throw new DescriptorDoesNotExistsException(appName);
 		}
 		gateway.removeApplicationDescriptor(appName);
@@ -575,11 +605,15 @@ public class AiravataJPARegistry extends
         return newExperiments;
     }
 
-    /**---------------------------------Published Workflow Registry----------------------------------
-     * @throws PublishedWorkflowAlreadyExistsException 
-     * @throws UserWorkflowDoesNotExistsException **/
+    /**---------------------------------Published Workflow Registry----------------------------------**/
+
+	@Override
+	public boolean isPublishedWorkflowExists(String workflowName)
+			throws RegistryException {
+		return jpa.getGateway().isPublishedWorkflowExists(workflowName);
+	}
     
-    public void publishWorkflow(String workflowName, String publishWorkflowName) throws PublishedWorkflowAlreadyExistsException, UserWorkflowDoesNotExistsException {
+    public void publishWorkflow(String workflowName, String publishWorkflowName) throws RegistryException {
     	GatewayResource gateway = jpa.getGateway();
     	String workflowGraphXML = getWorkflowGraphXML(workflowName);
     	if (gateway.isPublishedWorkflowExists(publishWorkflowName)){
@@ -592,13 +626,13 @@ public class AiravataJPARegistry extends
     	publishedWorkflow.save();
     }
 
-    public void publishWorkflow(String workflowName) throws PublishedWorkflowAlreadyExistsException, UserWorkflowDoesNotExistsException {
+    public void publishWorkflow(String workflowName) throws RegistryException {
     	publishWorkflow(workflowName, workflowName);
     }
 
-    public String getPublishedWorkflowGraphXML(String workflowName) throws PublishedWorkflowDoesNotExistsException {
+    public String getPublishedWorkflowGraphXML(String workflowName) throws RegistryException {
         GatewayResource gateway = jpa.getGateway();
-        if (!gateway.isPublishedWorkflowExists(workflowName)){
+        if (!isPublishedWorkflowExists(workflowName)){
         	throw new PublishedWorkflowDoesNotExistsException(workflowName);
         }
         return gateway.getPublishedWorkflow(workflowName).getContent();
@@ -624,9 +658,9 @@ public class AiravataJPARegistry extends
     	return result;
     }
 
-    public void removePublishedWorkflow(String workflowName) throws PublishedWorkflowDoesNotExistsException {
+    public void removePublishedWorkflow(String workflowName) throws RegistryException {
         GatewayResource gateway = jpa.getGateway();
-        if (!gateway.isPublishedWorkflowExists(workflowName)){
+        if (!isPublishedWorkflowExists(workflowName)){
         	throw new PublishedWorkflowDoesNotExistsException(workflowName);
         }
         gateway.removePublishedWorkflow(workflowName);
@@ -637,11 +671,17 @@ public class AiravataJPARegistry extends
         throw new UnimplementedRegistryOperationException();
     }
 
-    /**---------------------------------Project Registry----------------------------------**/
+    /**---------------------------------User Workflow Registry----------------------------------**/
 
-    public void addWorkflow(String workflowName, String workflowGraphXml) throws UserWorkflowAlreadyExistsException {
+	@Override
+	public boolean isWorkflowExists(String workflowName)
+			throws RegistryException {
+		return jpa.getWorker().isWorkflowTemplateExists(workflowName);
+	}
+	
+    public void addWorkflow(String workflowName, String workflowGraphXml) throws RegistryException {
     	WorkerResource worker = jpa.getWorker();
-		if (worker.isWorkflowTemplateExists(workflowName)){
+		if (isWorkflowExists(workflowName)){
         	throw new UserWorkflowAlreadyExistsException(workflowName);
         }
 		UserWorkflowResource workflowResource = worker.createWorkflowTemplate(workflowName);
@@ -649,9 +689,9 @@ public class AiravataJPARegistry extends
 		workflowResource.save();
     }
 
-    public void updateWorkflow(String workflowName, String workflowGraphXml) throws UserWorkflowDoesNotExistsException {
+    public void updateWorkflow(String workflowName, String workflowGraphXml) throws RegistryException {
     	WorkerResource worker = jpa.getWorker();
-		if (!worker.isWorkflowTemplateExists(workflowName)){
+		if (!isWorkflowExists(workflowName)){
         	throw new UserWorkflowDoesNotExistsException(workflowName);
         }
 		UserWorkflowResource workflowResource = worker.createWorkflowTemplate(workflowName);
@@ -659,27 +699,37 @@ public class AiravataJPARegistry extends
 		workflowResource.save();
     }
 
-    public String getWorkflowGraphXML(String workflowName) throws UserWorkflowDoesNotExistsException {
+    public String getWorkflowGraphXML(String workflowName) throws RegistryException {
     	WorkerResource worker = jpa.getWorker();
-		if (!worker.isWorkflowTemplateExists(workflowName)){
+		if (!isWorkflowExists(workflowName)){
         	throw new UserWorkflowDoesNotExistsException(workflowName);
         }
 		return worker.getWorkflowTemplate(workflowName).getContent();
     }
+    
+	@Override
+	public Map<String, String> getWorkflows() throws RegistryException {
+    	WorkerResource worker = jpa.getWorker();
+    	Map<String, String> workflows=new HashMap<String, String>();
+    	List<UserWorkflowResource> workflowTemplates = worker.getWorkflowTemplates();
+    	for (UserWorkflowResource resource : workflowTemplates) {
+    		workflows.put(resource.getName(), resource.getContent());
+		}
+    	return workflows;
+	}
 
-    public ResourceMetadata getWorkflowMetadata(String workflowName) throws UnimplementedRegistryOperationException {
-    	//TODO
-        throw new UnimplementedRegistryOperationException();
-    }
-
-    public void removeWorkflow(String workflowName) throws UserWorkflowDoesNotExistsException {
+    public void removeWorkflow(String workflowName) throws RegistryException {
     	WorkerResource worker = jpa.getWorker();
-		if (!worker.isWorkflowTemplateExists(workflowName)){
+		if (!isWorkflowExists(workflowName)){
         	throw new UserWorkflowDoesNotExistsException(workflowName);
         }
 		worker.removeWorkflowTemplate(workflowName);
     }
-
+    
+    public ResourceMetadata getWorkflowMetadata(String workflowName) throws UnimplementedRegistryOperationException {
+    	//TODO
+        throw new UnimplementedRegistryOperationException();
+    }
     public void setAiravataRegistry(AiravataRegistry2 registry) {
         //redundant
     }
@@ -1013,4 +1063,19 @@ public class AiravataJPARegistry extends
 		// TODO Auto-generated method stub
 		return null;
 	}
+
+	@Override
+	public String getWorkflowExecutionTemplateName(String experimentId,
+			String workflowInstanceId) throws RegistryException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void setWorkflowExecutionTemplateName(String experimentId,
+			String workflowInstanceId) throws RegistryException {
+		// TODO Auto-generated method stub
+		
+	}
+
 }

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java (original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java Mon Sep 10 06:32:08 2012
@@ -457,7 +457,6 @@ public class GatewayResource extends Abs
     }
     
     public List<ApplicationDescriptorResource> getApplicationDescriptorResources(String serviceName,String hostName){
-    	List<ApplicationDescriptorResource> resourceList = new ArrayList<ApplicationDescriptorResource>();
         begin();
         String qString = "SELECT p FROM Application_Descriptor p WHERE p.gateway_name =:gate_name and p.service_descriptor_ID =:service_name";
         if (hostName!=null){
@@ -470,6 +469,7 @@ public class GatewayResource extends Abs
         	q.setParameter("host_name",hostName);
         }
         List<?> results = q.getResultList();
+    	List<ApplicationDescriptorResource> resourceList = new ArrayList<ApplicationDescriptorResource>();
         if (results.size() != 0) {
             for (Object result : results) {
                 Application_Descriptor applicationDescriptor = (Application_Descriptor) result;

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/QueryGenerator.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/QueryGenerator.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/QueryGenerator.java (original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/QueryGenerator.java Mon Sep 10 06:32:08 2012
@@ -33,9 +33,16 @@ public class QueryGenerator {
 	private static final String SELECT_OBJ="p";
 	private static final String DELETE_OBJ="p";
 	private static final String TABLE_OBJ="p";
+//	
+//	public QueryGenerator(String tableName) {
+//		setTableName(tableName);
+//	}
 	
-	public QueryGenerator(String tableName) {
+	public QueryGenerator(String tableName, Object[]...params) {
 		setTableName(tableName);
+		for (Object[] param : params) {
+			addMatch(param[0].toString(), param[1]);
+		}
 	}
 	
 	public String getTableName() {

Modified: incubator/airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java (original)
+++ incubator/airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java Mon Sep 10 06:32:08 2012
@@ -21,30 +21,21 @@
 
 package org.apache.airavata.workflow.model.component.registry;
 
-import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
-import java.net.URI;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Properties;
 
-import javax.jcr.RepositoryException;
-
 import org.apache.airavata.common.exception.AiravataConfigurationException;
 import org.apache.airavata.common.registry.api.exception.RegistryException;
-import org.apache.airavata.common.registry.api.user.User;
-import org.apache.airavata.common.registry.api.user.UserManager;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry;
-import org.apache.airavata.registry.api.AiravataRegistry;
 import org.apache.airavata.registry.api.AiravataRegistry2;
 import org.apache.airavata.registry.api.AiravataRegistryFactory;
 import org.apache.airavata.registry.api.AiravataUser;
 import org.apache.airavata.registry.api.Gateway;
-import org.apache.airavata.registry.api.impl.AiravataJCRRegistry;
 import org.apache.airavata.registry.api.util.WebServiceUtil;
 import org.apache.airavata.workflow.model.component.ComponentReference;
 import org.slf4j.Logger;

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java Mon Sep 10 06:32:08 2012
@@ -275,8 +275,7 @@ public class XBaya {
                     logger.error(message);
                     this.config.addError(new WorkflowException(message));
                 }
-                this.config.setJcrComponentRegistry(new
-                        JCRComponentRegistry(this.config.getRegistryURL(),this.config.getRegistryUserName(),this.config.getRegistryPassphrase()));
+                this.config.setJcrComponentRegistry(new JCRComponentRegistry(this.config.getRegistryUserName(),this.config.getRegistryPassphrase()));
                 index++;
             }
         } catch (ArrayIndexOutOfBoundsException e) {

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java Mon Sep 10 06:32:08 2012
@@ -22,10 +22,8 @@
 package org.apache.airavata.xbaya;
 
 import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.List;
 
-import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.registry.api.AiravataRegistry2;
 import org.apache.airavata.workflow.model.component.ComponentRegistryException;
 import org.apache.airavata.workflow.model.component.registry.AmazonComponentRegistry;
@@ -261,43 +259,31 @@ public class XBayaEngine {
 		try {
 			if (this.getConfiguration().getJcrComponentRegistry()!=null && this.getConfiguration().getJcrComponentRegistry().getRegistry()!=null){
 	        	AiravataRegistry2 registry=this.getConfiguration().getJcrComponentRegistry().getRegistry();
-	        	List<URI> eventingServiceURLList = registry.getEventingServiceURLList();
-				if (eventingServiceURLList.size()>0) {
-					this.getConfiguration()
-					.setBrokerURL(
-							eventingServiceURLList.get(0));
+	        	URI eventingServiceURL = registry.getEventingServiceURI();
+				if (eventingServiceURL!=null) {
+					this.getConfiguration().setBrokerURL(eventingServiceURL);
 					this.getMonitor()
 							.getConfiguration()
-							.setBrokerURL(
-									eventingServiceURLList.get(0));
+							.setBrokerURL(eventingServiceURL);
 				}
-				List<URI> messageBoxServiceURLList = registry.getMessageBoxServiceURLList();
-				if (messageBoxServiceURLList.size()>0) {
+				URI messageBoxServiceURL = registry.getMessageBoxURI();
+				if (messageBoxServiceURL!=null) {
 					this.getConfiguration()
-					.setMessageBoxURL(
-							messageBoxServiceURLList.get(0));
+					.setMessageBoxURL(messageBoxServiceURL);
 					this.getMonitor()
 							.getConfiguration()
-							.setMessageBoxURL(
-									messageBoxServiceURLList.get(0));
+							.setMessageBoxURL(messageBoxServiceURL);
 				}
-				List<URI> interpreterServiceURLList = registry.getInterpreterServiceURLList();
+				List<URI> interpreterServiceURLList = registry.getWorkflowInterpreterURIs();
 				if (interpreterServiceURLList.size()>0) {
 					this.getConfiguration()
 							.setWorkflowInterpreterURL(interpreterServiceURLList.get(0));
 				}
-				List<String> gfacURLList = registry.getGFacDescriptorList();
+				List<URI> gfacURLList = registry.getGFacURIs();
 				if (gfacURLList.size()>0) {
-					try {
-						this.getConfiguration().setGFacURL(new URI(gfacURLList.get(0)));
-					} catch (URISyntaxException e) {
-						e.printStackTrace();
-					}
+					this.getConfiguration().setGFacURL(gfacURLList.get(0));
 				}
 			}
-        } catch (RegistryException e) {
-            this.getGUI().getErrorWindow().error(ErrorMessages.URL_WRONG, e);
-            return;
         } catch (Exception e) {
 			e.printStackTrace();
 		}

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java Mon Sep 10 06:32:08 2012
@@ -26,7 +26,7 @@ import java.util.Map;
 import java.util.Observable;
 import java.util.Observer;
 
-import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.registry.api.AiravataRegistry2;
 import org.apache.airavata.workflow.model.component.ComponentRegistryException;
 import org.apache.airavata.workflow.model.component.registry.ComponentRegistry;
 import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
@@ -147,13 +147,13 @@ public class ComponentRegistryLoader imp
 				observableRegistry.deleteObserver(this);
 			}
 			if (componentRegistry instanceof JCRComponentRegistry){
-				AiravataRegistry registry = ((JCRComponentRegistry)componentRegistry).getRegistry();
+				AiravataRegistry2 registry = ((JCRComponentRegistry)componentRegistry).getRegistry();
 				if (registry!=null && registry instanceof Observable){
 					(observableRegistry=(Observable)registry).addObserver(this);
 				}
 			}
 			load(componentRegistry);
-		}else if (observable instanceof AiravataRegistry){
+		}else if (observable instanceof AiravataRegistry2){
 			load(getEngine().getConfiguration().getJcrComponentRegistry());
 		}
 	}

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java Mon Sep 10 06:32:08 2012
@@ -48,7 +48,6 @@ import org.apache.airavata.common.utils.
 import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.common.utils.XMLUtil;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
-import org.apache.airavata.schemas.wec.ContextHeaderDocument;
 import org.apache.airavata.workflow.model.component.Component;
 import org.apache.airavata.workflow.model.component.SubWorkflowComponent;
 import org.apache.airavata.workflow.model.component.amazon.InstanceComponent;

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java Mon Sep 10 06:32:08 2012
@@ -64,13 +64,13 @@ public interface WorkflowInterpreterInte
 //        String gfacURL;
 //        WorkflowNotifiable notifier;
 //        String topic;
-//        AiravataRegistry registry;
+//        AiravataRegistry2 registry;
 //        String serviceName;
 //        XBayaConfiguration config;
 //        boolean embeddedMode;
 //        
 //        public GFacInvokerData(boolean embeddedMode, QName portTypeQName, WsdlDefinitions wsdl, String nodeID, String messageBoxURL,
-//                String gfacURL, WorkflowNotifiable notifier,String topic,AiravataRegistry registry,String serviceName,XBayaConfiguration config) {
+//                String gfacURL, WorkflowNotifiable notifier,String topic,AiravataRegistry2 registry,String serviceName,XBayaConfiguration config) {
 //        	this.embeddedMode=embeddedMode;
 //        	this.portTypeQName = portTypeQName;
 //        	this.wsdl = wsdl;

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java Mon Sep 10 06:32:08 2012
@@ -41,17 +41,15 @@ import javax.xml.stream.XMLStreamExcepti
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.airavata.common.registry.api.exception.RegistryException;
-import org.apache.airavata.common.registry.api.impl.JCRRegistry;
 import org.apache.airavata.common.utils.ServiceUtils;
 import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
 import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.registry.api.AiravataRegistry2;
 import org.apache.airavata.schemas.gfac.GlobusHostType;
 import org.apache.airavata.schemas.gfac.HostDescriptionType;
 import org.apache.airavata.schemas.wec.ContextHeaderDocument;
 import org.apache.airavata.workflow.model.component.ComponentException;
 import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
 import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
 import org.apache.airavata.workflow.model.graph.GraphException;
 import org.apache.airavata.workflow.model.graph.system.InputNode;
@@ -115,7 +113,7 @@ public class WorkflowInterpretorSkeleton
 
 	protected WIServiceThread thread;
     
-    private AiravataRegistry getRegistry(){
+    private AiravataRegistry2 getRegistry(){
         Properties properties = new Properties();
         try {
             URL url = getXBayaPropertiesURL();
@@ -123,12 +121,10 @@ public class WorkflowInterpretorSkeleton
             jcrUserName = (String)properties.get(JCR_USER);
             jcrPassword = (String) properties.get(JCR_PASS);
             jcrURL = (String) properties.get(JCR_URL);
-            jcrComponentRegistry = new JCRComponentRegistry(new URI(jcrURL),jcrUserName,jcrPassword);
+            jcrComponentRegistry = new JCRComponentRegistry(jcrUserName,jcrPassword);
             return jcrComponentRegistry.getRegistry();
         } catch (RegistryException e) {
             e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-        } catch (URISyntaxException e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
         } catch (IOException e) {
 			e.printStackTrace();
 		}
@@ -167,20 +163,18 @@ public class WorkflowInterpretorSkeleton
 		                provenance = true;
 		                runner = new PredicatedTaskRunner(provenanceWriterThreadPoolSize);
 		                try {
-		                    jcrComponentRegistry = new JCRComponentRegistry(new URI(jcrURL),jcrUserName,jcrPassword);
+		                    jcrComponentRegistry = new JCRComponentRegistry(jcrUserName,jcrPassword);
                             List<HostDescription> hostList = getDefinedHostDescriptions();
                             for(HostDescription host:hostList){
                                 // This will avoid the changes user is doing to one of the predefined Hosts during a restart of the system
-                                AiravataRegistry registry = jcrComponentRegistry.getRegistry();
-								if(registry.getHostDescription(host.getType().getHostName()) == null){
+                                AiravataRegistry2 registry = jcrComponentRegistry.getRegistry();
+								if(!registry.isHostDescriptorExists(host.getType().getHostName())){
                                     log.info("Saving the predefined Host: " + host.getType().getHostName());
-                                    registry.saveHostDescription(host);
+                                    registry.addHostDescriptor(host);
                                 }
                             }
 		                } catch (RegistryException e) {
 		                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-		                } catch (URISyntaxException e) {
-		                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
 		                }
                     }else{
 		                provenance = false;
@@ -295,7 +289,7 @@ public class WorkflowInterpretorSkeleton
         }
         WorkflowInterpretorEventListener listener = null;
         WorkflowInterpreter interpreter = null;
-        AiravataRegistry registry = getRegistry();
+        AiravataRegistry2 registry = getRegistry();
 		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,topic,conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null, null, null);
         workflowInterpreterConfiguration.setGfacEmbeddedMode(gfacEmbeddedMode);
         workflowInterpreterConfiguration.setActOnProvenance(provenance);
@@ -381,24 +375,18 @@ public class WorkflowInterpretorSkeleton
 		return defaultVal;
 	}
      public void shutDown(ConfigurationContext configctx, AxisService service) {
-    	 AiravataRegistry registry =  jcrComponentRegistry.getRegistry();
+    	 AiravataRegistry2 registry =  jcrComponentRegistry.getRegistry();
          URI gfacURL = (URI) configctx.getProperty(SERVICE_URL);
-         try {
- 			registry.deleteInterpreterServiceURL(gfacURL);
- 			thread.interrupt();
- 			try {
- 			    thread.join();
- 			} catch (InterruptedException e) {
- 			    log.info("GFacURL update thread is interrupted");
- 			}
- 		} catch (RegistryException e) {
- 			log.severe("Error while shutting down!!!", e);
- 		}
-         
-        ((JCRRegistry)jcrComponentRegistry.getRegistry()).closeConnection();
-         if(runner != null){
-             runner.shutDown();
-         }
+         registry.removeWorkflowInterpreterURI(gfacURL);
+		thread.interrupt();
+		try {
+		    thread.join();
+		} catch (InterruptedException e) {
+		    log.info("GFacURL update thread is interrupted");
+		}
+		if(runner != null){
+		    runner.shutDown();
+		}
     }
 
     private List<HostDescription> getDefinedHostDescriptions() {
@@ -445,12 +433,12 @@ public class WorkflowInterpretorSkeleton
             try {
                 while (true) {
                     try {
-						AiravataRegistry registry = (AiravataRegistry )context.getProperty(JCR_REG);
+						AiravataRegistry2 registry = (AiravataRegistry2 )context.getProperty(JCR_REG);
 						URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
-						registry.saveInterpreterServiceURL(localAddress);
+						registry.addWorkflowInterpreterURI(localAddress);
 						log.info("Updated Workflow Interpreter service URL in to Repository");
 						Thread.sleep(URL_UPDATE_INTERVAL);
-					} catch (RegistryException e) {
+					} catch (Exception e) {
 						//in case of an registry exception best to retry sooner
 						log.severe("Error saving GFac descriptor",e);
 						Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java Mon Sep 10 06:32:08 2012
@@ -20,18 +20,36 @@
 */
 package org.apache.airavata.xbaya.invoker;
 
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
 import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.common.utils.XMLUtil;
 import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.commons.gfac.wsdl.WSDLConstants;
 import org.apache.airavata.core.gfac.GfacAPI;
 import org.apache.airavata.core.gfac.context.GFacConfiguration;
 import org.apache.airavata.core.gfac.context.JobContext;
 import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
 import org.apache.airavata.core.gfac.context.message.impl.ParameterContextImpl;
 import org.apache.airavata.core.gfac.utils.GfacUtils;
-import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.registry.api.AiravataRegistry2;
 import org.apache.airavata.schemas.gfac.Parameter;
 import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
 import org.apache.airavata.workflow.model.exceptions.WorkflowException;
@@ -47,19 +65,12 @@ import org.apache.axiom.om.impl.builder.
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xmlpull.v1.builder.XmlElement;
+
 import xsul.wsdl.WsdlDefinitions;
 import xsul.wsif.WSIFMessage;
 import xsul.wsif.impl.WSIFMessageElement;
 import xsul.xwsif_runtime.WSIFClient;
 
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.io.StringReader;
-import java.util.*;
-import java.util.concurrent.*;
-
 public class EmbeddedGFacInvoker implements Invoker{
 
       private static final Logger logger = LoggerFactory.getLogger(EmbeddedGFacInvoker.class);
@@ -85,7 +96,7 @@ public class EmbeddedGFacInvoker impleme
 
     private ServiceNotifiable notifier;
 
-    private AiravataRegistry registry;
+    private AiravataRegistry2 registry;
 
     private String topic;
 
@@ -181,7 +192,7 @@ public class EmbeddedGFacInvoker impleme
      * @param notifier
      */
     public EmbeddedGFacInvoker(QName portTypeQName, WsdlDefinitions wsdl, String nodeID, String messageBoxURL,
-            String gfacURL, WorkflowNotifiable notifier,String topic,AiravataRegistry registry,String serviceName,XBayaConfiguration config) {
+            String gfacURL, WorkflowNotifiable notifier,String topic,AiravataRegistry2 registry,String serviceName,XBayaConfiguration config) {
         final String wsdlStr = xsul.XmlConstants.BUILDER.serializeToString(wsdl);
         this.nodeID = nodeID;
         this.portTypeQName = portTypeQName;
@@ -232,7 +243,7 @@ public class EmbeddedGFacInvoker impleme
             }
             this.inputNames.add(name);
             this.inputValues.add(value);
-            ServiceDescription serviceDescription = registry.getServiceDescription(this.serviceName);
+            ServiceDescription serviceDescription = registry.getServiceDescriptor(this.serviceName);
             if(serviceDescription==null){
             	throw new RegistryException(new Exception("Service Description not found in registry."));
             }

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java Mon Sep 10 06:32:08 2012
@@ -21,20 +21,20 @@
 
 package org.apache.airavata.xbaya.model.registrybrowser;
 
-import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.registry.api.AiravataRegistry2;
 
 public class AiravataConfigurations {
-    private AiravataRegistry registry;
+    private AiravataRegistry2 registry;
 
-    public AiravataConfigurations(AiravataRegistry registry) {
+    public AiravataConfigurations(AiravataRegistry2 registry) {
         setRegistry(registry);
     }
 
-    public AiravataRegistry getRegistry() {
+    public AiravataRegistry2 getRegistry() {
         return registry;
     }
 
-    public void setRegistry(AiravataRegistry registry) {
+    public void setRegistry(AiravataRegistry2 registry) {
         this.registry = registry;
     }
     

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java Mon Sep 10 06:32:08 2012
@@ -25,15 +25,15 @@ import org.apache.airavata.common.regist
 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.registry.api.AiravataRegistry;
+import org.apache.airavata.registry.api.AiravataRegistry2;
 
 public class ApplicationDeploymentDescriptionWrap {
     private ApplicationDeploymentDescription applicationDeploymentDescription;
     private String service;
     private String host;
-    private AiravataRegistry registry;
+    private AiravataRegistry2 registry;
 
-    public ApplicationDeploymentDescriptionWrap(AiravataRegistry registry,
+    public ApplicationDeploymentDescriptionWrap(AiravataRegistry2 registry,
             ApplicationDeploymentDescription applicationDeploymentDescription, String service, String host) {
         setApplicationDeploymentDescription(applicationDeploymentDescription);
         setService(service);
@@ -54,7 +54,7 @@ public class ApplicationDeploymentDescri
     }
 
     public ServiceDescription getServiceDescription() throws RegistryException{
-        ServiceDescription desc = getRegistry().getServiceDescription(getService());
+        ServiceDescription desc = getRegistry().getServiceDescriptor(getService());
         if(desc!=null){
         	return desc;
         }
@@ -70,18 +70,18 @@ public class ApplicationDeploymentDescri
     }
 
     public HostDescription getHostDescription() throws RegistryException{
-        return getRegistry().getHostDescription(getHost());
+        return getRegistry().getHostDescriptor(getHost());
     }
 
     public void setHost(String host) {
         this.host = host;
     }
 
-    public AiravataRegistry getRegistry() {
+    public AiravataRegistry2 getRegistry() {
         return registry;
     }
 
-    public void setRegistry(AiravataRegistry registry) {
+    public void setRegistry(AiravataRegistry2 registry) {
         this.registry = registry;
     }
 }

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java Mon Sep 10 06:32:08 2012
@@ -27,49 +27,49 @@ import java.util.Map;
 
 import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.registry.api.AiravataRegistry2;
 
 public class ApplicationDeploymentDescriptions {
-    private AiravataRegistry registry;
+    private AiravataRegistry2 registry;
     private String serviceName;
     
-    public ApplicationDeploymentDescriptions(AiravataRegistry registry, String serviceName) {
+    public ApplicationDeploymentDescriptions(AiravataRegistry2 registry, String serviceName) {
         setRegistry(registry);
         setServiceName(serviceName);
     }
     
-    public ApplicationDeploymentDescriptions(AiravataRegistry registry) {
+    public ApplicationDeploymentDescriptions(AiravataRegistry2 registry) {
         this(registry,null);
     }
 
-    public AiravataRegistry getRegistry() {
+    public AiravataRegistry2 getRegistry() {
         return registry;
     }
 
-    public void setRegistry(AiravataRegistry registry) {
+    public void setRegistry(AiravataRegistry2 registry) {
         this.registry = registry;
     }
 
     public List<ApplicationDeploymentDescriptionWrap> getDescriptions() throws RegistryException {
         List<ApplicationDeploymentDescriptionWrap> list = new ArrayList<ApplicationDeploymentDescriptionWrap>();
         if (getServiceName()==null) {
-			Map<ApplicationDeploymentDescription, String> deploymentDescriptions = getRegistry()
-					.searchDeploymentDescription();
-			for (ApplicationDeploymentDescription descriptionWrap : deploymentDescriptions
-					.keySet()) {
-				String[] descDetails = deploymentDescriptions.get(
-						descriptionWrap).split("\\$");
-				list.add(new ApplicationDeploymentDescriptionWrap(
-						getRegistry(), descriptionWrap, descDetails[0],
-						descDetails[1]));
+        	List<ServiceDescription> serviceDescriptors = getRegistry().getServiceDescriptors();
+        	for (ServiceDescription serviceDescription : serviceDescriptors) {
+        		String serviceName = serviceDescription.getType().getName();
+				Map<String,ApplicationDeploymentDescription> deploymentDescriptions = getRegistry().getApplicationDescriptors(serviceName);
+				for (String hostName : deploymentDescriptions.keySet()) {
+					ApplicationDeploymentDescription descriptionWrap=deploymentDescriptions.get(hostName);
+					list.add(new ApplicationDeploymentDescriptionWrap(getRegistry(), descriptionWrap, serviceName,hostName));
+				}
 			}
+			
 		}else{
-	        Map<HostDescription, List<ApplicationDeploymentDescription>> deploymentDescriptions = getRegistry().searchDeploymentDescription(getServiceName());
-	        for (HostDescription descriptionWrap : deploymentDescriptions.keySet()) {
-	            list.add(new ApplicationDeploymentDescriptionWrap(getRegistry(), deploymentDescriptions.get(descriptionWrap).get(0), getServiceName(),
-	            		descriptionWrap.getType().getHostName()));
-	        }
+			Map<String,ApplicationDeploymentDescription> deploymentDescriptions = getRegistry().getApplicationDescriptors(serviceName);
+			for (String hostName : deploymentDescriptions.keySet()) {
+				ApplicationDeploymentDescription descriptionWrap=deploymentDescriptions.get(hostName);
+				list.add(new ApplicationDeploymentDescriptionWrap(getRegistry(), descriptionWrap, getServiceName(),hostName));
+			}
 		}
 		return list;
     }

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java Mon Sep 10 06:32:08 2012
@@ -23,22 +23,22 @@ package org.apache.airavata.xbaya.model.
 
 import java.net.URI;
 
-import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.registry.api.AiravataRegistry2;
 
 public class EventingServiceURL {
-    private AiravataRegistry registry;
+    private AiravataRegistry2 registry;
     private URI eventingServiceURL;
 
-    public EventingServiceURL(AiravataRegistry registry, URI eventingServiceURL) {
+    public EventingServiceURL(AiravataRegistry2 registry, URI eventingServiceURL) {
         setRegistry(registry);
         setEventingServiceURL(eventingServiceURL);
     }
 
-    public AiravataRegistry getRegistry() {
+    public AiravataRegistry2 getRegistry() {
         return registry;
     }
 
-    public void setRegistry(AiravataRegistry registry) {
+    public void setRegistry(AiravataRegistry2 registry) {
         this.registry = registry;
     }
 

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java?rev=1382653&r1=1382652&r2=1382653&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java Mon Sep 10 06:32:08 2012
@@ -25,34 +25,27 @@ import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.airavata.common.registry.api.exception.RegistryException;
-import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.registry.api.AiravataRegistry2;
 
 public class EventingServiceURLs {
-    private AiravataRegistry registry;
+    private AiravataRegistry2 registry;
 
-    public EventingServiceURLs(AiravataRegistry registry) {
+    public EventingServiceURLs(AiravataRegistry2 registry) {
         setRegistry(registry);
     }
 
-    public AiravataRegistry getRegistry() {
+    public AiravataRegistry2 getRegistry() {
         return registry;
     }
 
-    public void setRegistry(AiravataRegistry registry) {
+    public void setRegistry(AiravataRegistry2 registry) {
         this.registry = registry;
     }
 
     public List<EventingServiceURL> getURLS() {
         List<EventingServiceURL> urls = new ArrayList<EventingServiceURL>();
-        try {
-			List<URI> gfacDescriptorList = getRegistry().getEventingServiceURLList();
-			for (URI uri : gfacDescriptorList) {
-		        urls.add(new EventingServiceURL(getRegistry(), uri));
-			}
-		} catch (RegistryException e) {
-			e.printStackTrace();
-		}
+        URI gfacDescriptor = getRegistry().getEventingServiceURI();
+		urls.add(new EventingServiceURL(getRegistry(), gfacDescriptor));
         return urls;
     }
 }



Mime
View raw message