airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [6/9] retiring previous registry API - AIRAVATA-1234
Date Fri, 22 Aug 2014 19:01:35 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/integration-tests/src/test/java/org/apache/airavata/integration/WorkflowSamplesCaseIT.java
----------------------------------------------------------------------
diff --git a/modules/integration-tests/src/test/java/org/apache/airavata/integration/WorkflowSamplesCaseIT.java b/modules/integration-tests/src/test/java/org/apache/airavata/integration/WorkflowSamplesCaseIT.java
index 963f46d..98f3fb3 100644
--- a/modules/integration-tests/src/test/java/org/apache/airavata/integration/WorkflowSamplesCaseIT.java
+++ b/modules/integration-tests/src/test/java/org/apache/airavata/integration/WorkflowSamplesCaseIT.java
@@ -22,18 +22,7 @@
 package org.apache.airavata.integration;
 
 import junit.framework.Assert;
-import org.apache.airavata.client.AiravataAPIFactory;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.ExperimentAdvanceOptions;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.client.api.exception.WorkflowAlreadyExistsException;
 import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.registry.api.PasswordCallback;
-import org.apache.airavata.registry.api.impl.WorkflowExecutionDataImpl;
-import org.apache.airavata.registry.api.workflow.ExperimentData;
-import org.apache.airavata.registry.api.workflow.InputData;
-import org.apache.airavata.registry.api.workflow.NodeExecutionData;
-import org.apache.airavata.registry.api.workflow.WorkflowNodeType.WorkflowNode;
 import org.apache.airavata.workflow.model.component.ComponentException;
 import org.apache.airavata.workflow.model.graph.GraphException;
 import org.apache.airavata.workflow.model.wf.Workflow;
@@ -41,11 +30,8 @@ import org.apache.airavata.workflow.model.wf.WorkflowInput;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
 
 import java.io.IOException;
-import java.net.URI;
-import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -59,10 +45,10 @@ public class WorkflowSamplesCaseIT extends WorkflowIntegrationTestBase {
 //        setUpEnvironment();
     }
 
-    @BeforeTest
-    public void setUp() throws Exception {
-        this.airavataAPI = getAiravataAPI();
-    }
+//    @BeforeTest
+//    public void setUp() throws Exception {
+//        this.airavataAPI = getAiravataAPI();
+//    }
 
 //    @Test(groups = {"workflowSamplesGroup"}/*, dependsOnGroups = { "forEachGroup" }*/)
 //    public void testWorkflowSamples() throws Exception {
@@ -75,70 +61,70 @@ public class WorkflowSamplesCaseIT extends WorkflowIntegrationTestBase {
 //		executeExperiment("target/samples/workflows/ComplexForEach.xwf", Arrays.asList("1,2","3,4","5,6","7,8","9,10","11,12","13,14","15,16"), Arrays.asList("2027025","10321920"));
 //    }
 
-    private void executeExperiment(String workflowFilePath,
-                                   List<String> inputs, Object outputs) throws GraphException,
-            ComponentException, IOException, WorkflowAlreadyExistsException,
-            AiravataAPIInvocationException, Exception {
-        log("Saving workflow ...");
-
-        Workflow workflow = new Workflow(getWorkflowComposeContent(workflowFilePath));
-        if (!airavataAPI.getWorkflowManager().isWorkflowExists(workflow.getName())) {
-            airavataAPI.getWorkflowManager().addWorkflow(workflow);
-        }
-        Assert.assertTrue(airavataAPI.getWorkflowManager().isWorkflowExists(workflow.getName()));
-
-        log("Workflow setting up completed ...");
-
-        runWorkFlow(workflow, inputs, outputs);
-    }
-
-    protected void runWorkFlow(Workflow workflow, List<String> inputValues, Object outputValue) throws Exception {
-        List<WorkflowInput> workflowInputs = setupInputs(workflow, inputValues);
-        String workflowName = workflow.getName();
-        ExperimentAdvanceOptions options = airavataAPI.getExecutionManager().createExperimentAdvanceOptions(
-                workflowName, getUserName(), null);
-
-        String experimentId = airavataAPI.getExecutionManager().runExperiment(workflowName, workflowInputs, options);
-
-        Assert.assertNotNull(experimentId);
-
-        log.info("Run workflow completed ....");
-
-        airavataAPI.getExecutionManager().waitForExperimentTermination(experimentId);
-        verifyOutput(experimentId, outputValue);
-    }
-
-    protected void verifyOutput(String experimentId, Object outputVerifyingString) throws Exception {
-        log.info("Experiment ID Returned : " + experimentId);
-
-        ExperimentData experimentData = airavataAPI.getProvenanceManager().getExperimentData(experimentId);
-
-        log.info("Verifying output ...");
-
-        List<WorkflowExecutionDataImpl> workflowInstanceData = experimentData.getWorkflowExecutionDataList();
-
-        Assert.assertFalse("Workflow instance data cannot be empty !", workflowInstanceData.isEmpty());
-
-        for (WorkflowExecutionDataImpl data : workflowInstanceData) {
-            List<NodeExecutionData> nodeDataList = data.getNodeDataList(WorkflowNode.OUTPUTNODE);
-            Assert.assertFalse("Node execution data list cannot be empty !", nodeDataList.isEmpty());
-            for (NodeExecutionData nodeData : nodeDataList) {
-                for (InputData inputData : nodeData.getInputData()) {
-                    if (outputVerifyingString instanceof List) {
-                        @SuppressWarnings("unchecked")
-                        List<String> outputs = (List<String>) outputVerifyingString;
-                        String[] outputValues = StringUtil.getElementsFromString(inputData.getValue());
-                        Assert.assertEquals(outputs.size(), outputValues.length);
-                        for (int i = 0; i < outputValues.length; i++) {
-                            Assert.assertEquals(outputs.get(i), outputValues[i]);
-                        }
-                    } else {
-                        Assert.assertEquals(outputVerifyingString.toString(), inputData.getValue());
-                    }
-
-                }
-            }
-        }
-    }
+//    private void executeExperiment(String workflowFilePath,
+//                                   List<String> inputs, Object outputs) throws GraphException,
+//            ComponentException, IOException, WorkflowAlreadyExistsException,
+//            AiravataAPIInvocationException, Exception {
+//        log("Saving workflow ...");
+//
+//        Workflow workflow = new Workflow(getWorkflowComposeContent(workflowFilePath));
+//        if (!airavataAPI.getWorkflowManager().isWorkflowExists(workflow.getName())) {
+//            airavataAPI.getWorkflowManager().addWorkflow(workflow);
+//        }
+//        Assert.assertTrue(airavataAPI.getWorkflowManager().isWorkflowExists(workflow.getName()));
+//
+//        log("Workflow setting up completed ...");
+//
+//        runWorkFlow(workflow, inputs, outputs);
+//    }
+//
+//    protected void runWorkFlow(Workflow workflow, List<String> inputValues, Object outputValue) throws Exception {
+//        List<WorkflowInput> workflowInputs = setupInputs(workflow, inputValues);
+//        String workflowName = workflow.getName();
+//        ExperimentAdvanceOptions options = airavataAPI.getExecutionManager().createExperimentAdvanceOptions(
+//                workflowName, getUserName(), null);
+//
+//        String experimentId = airavataAPI.getExecutionManager().runExperiment(workflowName, workflowInputs, options);
+//
+//        Assert.assertNotNull(experimentId);
+//
+//        log.info("Run workflow completed ....");
+//
+//        airavataAPI.getExecutionManager().waitForExperimentTermination(experimentId);
+//        verifyOutput(experimentId, outputValue);
+//    }
+//
+//    protected void verifyOutput(String experimentId, Object outputVerifyingString) throws Exception {
+//        log.info("Experiment ID Returned : " + experimentId);
+//
+//        ExperimentData experimentData = airavataAPI.getProvenanceManager().getExperimentData(experimentId);
+//
+//        log.info("Verifying output ...");
+//
+//        List<WorkflowExecutionDataImpl> workflowInstanceData = experimentData.getWorkflowExecutionDataList();
+//
+//        Assert.assertFalse("Workflow instance data cannot be empty !", workflowInstanceData.isEmpty());
+//
+//        for (WorkflowExecutionDataImpl data : workflowInstanceData) {
+//            List<NodeExecutionData> nodeDataList = data.getNodeDataList(WorkflowNode.OUTPUTNODE);
+//            Assert.assertFalse("Node execution data list cannot be empty !", nodeDataList.isEmpty());
+//            for (NodeExecutionData nodeData : nodeDataList) {
+//                for (InputData inputData : nodeData.getInputData()) {
+//                    if (outputVerifyingString instanceof List) {
+//                        @SuppressWarnings("unchecked")
+//                        List<String> outputs = (List<String>) outputVerifyingString;
+//                        String[] outputValues = StringUtil.getElementsFromString(inputData.getValue());
+//                        Assert.assertEquals(outputs.size(), outputValues.length);
+//                        for (int i = 0; i < outputValues.length; i++) {
+//                            Assert.assertEquals(outputs.get(i), outputValues[i]);
+//                        }
+//                    } else {
+//                        Assert.assertEquals(outputVerifyingString.toString(), inputData.getValue());
+//                    }
+//
+//                }
+//            }
+//        }
+//    }
 
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
index 58ea326..1f5160f 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
@@ -21,23 +21,11 @@
 
 package org.apache.airavata.orchestrator.server;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-
 import org.airavata.appcatalog.cpi.AppCatalog;
 import org.airavata.appcatalog.cpi.AppCatalogException;
 import org.airavata.appcatalog.cpi.ComputeResource;
 import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory;
 import org.apache.aiaravata.application.catalog.data.resources.AbstractResource;
-import org.apache.airavata.client.AiravataAPIFactory;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.AiravataZKUtils;
 import org.apache.airavata.common.utils.Constants;
@@ -51,8 +39,8 @@ import org.apache.airavata.model.error.LaunchValidationException;
 import org.apache.airavata.model.workspace.experiment.*;
 import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
 import org.apache.airavata.orchestrator.cpi.OrchestratorService;
-import org.apache.airavata.orchestrator.cpi.orchestrator_cpi_serviceConstants;
 import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
+import org.apache.airavata.orchestrator.cpi.orchestrator_cpi_serviceConstants;
 import org.apache.airavata.orchestrator.util.OrchestratorRecoveryHandler;
 import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
 import org.apache.airavata.registry.cpi.Registry;
@@ -61,16 +49,15 @@ import org.apache.airavata.registry.cpi.RegistryModelType;
 import org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.TaskDetailConstants;
 import org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.WorkflowNodeConstants;
 import org.apache.thrift.TException;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.ZooDefs;
-import org.apache.zookeeper.ZooKeeper;
+import org.apache.zookeeper.*;
 import org.apache.zookeeper.data.Stat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+
 public class OrchestratorServerHandler implements OrchestratorService.Iface,
 		Watcher {
 	private static Logger log = LoggerFactory
@@ -84,7 +71,6 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface,
 
 	private static Integer mutex = new Integer(-1);
 
-	private AiravataAPI airavataAPI;
 	private String airavataUserName;
 	private String gatewayName;
 
@@ -397,18 +383,6 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface,
 		this.gatewayName = gatewayName;
 	}
 
-	private AiravataAPI getAiravataAPI() {
-		if (airavataAPI == null) {
-			try {
-				airavataAPI = AiravataAPIFactory.getAPI(getGatewayName(),
-						getAiravataUserName());
-			} catch (AiravataAPIInvocationException e) {
-				log.error("Unable to create Airavata API", e);
-			}
-		}
-		return airavataAPI;
-	}
-
 	@Override
 	public boolean launchTask(String taskId, String airavataCredStoreToken) throws TException {
 		try {

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
index 26eab03..72d912b 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
@@ -21,15 +21,18 @@
 
 package org.apache.airavata.orchestrator.client;
 
+import org.apache.airavata.api.Airavata;
+import org.apache.airavata.api.client.AiravataClientFactory;
 import org.apache.airavata.client.AiravataAPIFactory;
-import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
 import org.apache.airavata.client.tools.DocumentCreator;
+import org.apache.airavata.client.tools.DocumentCreatorNew;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.AiravataZKUtils;
 import org.apache.airavata.common.utils.Constants;
 import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.model.error.AiravataClientConnectException;
 import org.apache.airavata.orchestrator.client.util.Initialize;
 import org.apache.airavata.orchestrator.cpi.OrchestratorService;
 import org.apache.airavata.orchestrator.server.OrchestratorServer;
@@ -39,7 +42,7 @@ import org.apache.zookeeper.server.ServerCnxnFactory;
 import org.junit.Test;
 
 public class OrchestratorClientFactoryTest {
-    private DocumentCreator documentCreator;
+    private DocumentCreatorNew documentCreator;
     private OrchestratorService.Client orchestratorClient;
     private Registry registry;
     private int NUM_CONCURRENT_REQUESTS = 1;
@@ -59,13 +62,12 @@ public class OrchestratorClientFactoryTest {
             service = (new OrchestratorServer());
             service.start();
             registry = RegistryFactory.getDefaultRegistry();
+            documentCreator = new DocumentCreatorNew(getAiravataClient());
+            documentCreator.createLocalHostDocs();
         } catch (Exception e) {
             e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
         }
         AiravataUtils.setExecutionAsServer();
-        documentCreator = new DocumentCreator(getAiravataAPI());
-        documentCreator.createLocalHostDocs();
-
         try {
             service.stop();
         } catch (Exception e) {
@@ -74,18 +76,14 @@ public class OrchestratorClientFactoryTest {
 
     }
 
-    private AiravataAPI getAiravataAPI() {
-        AiravataAPI airavataAPI = null;
+    private Airavata.Client getAiravataClient() {
+        Airavata.Client client = null;
             try {
-                String systemUserName = ServerSettings.getDefaultUser();
-                String gateway = ServerSettings.getDefaultUserGateway();
-                airavataAPI = AiravataAPIFactory.getAPI(gateway, systemUserName);
-            } catch (ApplicationSettingsException e) {
-                e.printStackTrace();
-            } catch (AiravataAPIInvocationException e) {
+                client = AiravataClientFactory.createAiravataClient("localhost", 8930);
+            } catch (AiravataClientConnectException e) {
                 e.printStackTrace();
             }
-        return airavataAPI;
+        return client;
     }
 
     private void storeDescriptors() {

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
index 8301ac7..6f61543 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
@@ -23,9 +23,8 @@ package org.apache.airavata.orchestrator.client.util;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.resources.*;
-import org.apache.airavata.registry.api.exception.RegistrySettingsException;
-import org.apache.airavata.registry.api.util.RegistrySettings;
 import org.apache.airavata.registry.cpi.RegistryException;
+import org.apache.airavata.registry.cpi.utils.RegistrySettings;
 import org.apache.derby.drda.NetworkServerControl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -101,7 +100,7 @@ public class Initialize {
             jdbcUser = RegistrySettings.getSetting("registry.jdbc.user");
             jdbcPassword = RegistrySettings.getSetting("registry.jdbc.password");
             jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
-        } catch (RegistrySettingsException e) {
+        } catch (RegistryException e) {
             logger.error("Unable to read properties" , e);
         }
 
@@ -157,8 +156,6 @@ public class Initialize {
             resource.setWorker(workerResource);
             resource.save();
 
-        } catch (RegistrySettingsException e) {
-            logger.error("Unable to read properties", e);
         } catch (RegistryException e) {
             logger.error("Error while saving data to registry", e);
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/orchestrator-core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/pom.xml b/modules/orchestrator/orchestrator-core/pom.xml
index 9b17aad..61a7efc 100644
--- a/modules/orchestrator/orchestrator-core/pom.xml
+++ b/modules/orchestrator/orchestrator-core/pom.xml
@@ -31,11 +31,6 @@ the License. -->
         </dependency>
         <dependency>
             <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-registry-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
             <artifactId>airavata-registry-cpi</artifactId>
             <version>${project.version}</version>
         </dependency>
@@ -61,6 +56,11 @@ the License. -->
         </dependency>
         <dependency>
             <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-client-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
             <artifactId>airavata-gfac-service</artifactId>
             <version>${project.version}</version>
         </dependency>

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/OrchestratorConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/OrchestratorConfiguration.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/OrchestratorConfiguration.java
index b0cbe07..07b5beb 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/OrchestratorConfiguration.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/OrchestratorConfiguration.java
@@ -20,8 +20,6 @@
 */
 package org.apache.airavata.orchestrator.core;
 
-import org.apache.airavata.client.api.AiravataAPI;
-
 import java.net.URL;
 import java.util.List;
 
@@ -41,8 +39,6 @@ public class OrchestratorConfiguration {
 
     private boolean startSubmitter = false;
 
-    private AiravataAPI airavataAPI;
-
     private URL brokerURL;
 
     private boolean embeddedMode;
@@ -108,14 +104,6 @@ public class OrchestratorConfiguration {
         this.startSubmitter = startSubmitter;
     }
 
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
     public String getHangedJobSubmitterClass() {
         return hangedJobSubmitterClass;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/context/OrchestratorContext.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/context/OrchestratorContext.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/context/OrchestratorContext.java
index be3acda..605b0a2 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/context/OrchestratorContext.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/context/OrchestratorContext.java
@@ -25,7 +25,6 @@ import java.util.List;
 
 import org.apache.airavata.orchestrator.core.OrchestratorConfiguration;
 import org.apache.airavata.orchestrator.core.gfac.GFACInstance;
-import org.apache.airavata.registry.api.AiravataRegistry2;
 import org.apache.airavata.registry.cpi.Registry;
 import org.apache.zookeeper.ZooKeeper;
 
@@ -37,8 +36,6 @@ public class OrchestratorContext {
 
     private OrchestratorConfiguration orchestratorConfiguration;
 
-    private AiravataRegistry2 registry;
-
     private Registry newRegistry;
 
     private ZooKeeper zk;
@@ -66,14 +63,6 @@ public class OrchestratorContext {
         this.orchestratorConfiguration = orchestratorConfiguration;
     }
 
-    public AiravataRegistry2 getRegistry() {
-        return registry;
-    }
-
-    public void setRegistry(AiravataRegistry2 registry) {
-        this.registry = registry;
-    }
-
     public Registry getNewRegistry() {
         return newRegistry;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACEmbeddedJobSubmitter.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACEmbeddedJobSubmitter.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACEmbeddedJobSubmitter.java
index cde0135..9bbb0b6 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACEmbeddedJobSubmitter.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACEmbeddedJobSubmitter.java
@@ -21,10 +21,12 @@
 package org.apache.airavata.orchestrator.core.impl;
 
 
+import com.google.common.eventbus.EventBus;
 import org.apache.airavata.common.utils.Constants;
+import org.apache.airavata.common.utils.MonitorPublisher;
 import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.gfac.core.cpi.BetterGfacImpl;
 import org.apache.airavata.gfac.core.cpi.GFac;
-import org.apache.airavata.gfac.core.cpi.GFacImpl;
 import org.apache.airavata.orchestrator.core.context.OrchestratorContext;
 import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
 import org.apache.airavata.orchestrator.core.gfac.GFACInstance;
@@ -47,7 +49,7 @@ public class GFACEmbeddedJobSubmitter implements JobSubmitter {
 
     public void initialize(OrchestratorContext orchestratorContext) throws OrchestratorException {
         this.orchestratorContext = orchestratorContext;
-        gfac = new GFacImpl(orchestratorContext.getNewRegistry(), null, orchestratorContext.getRegistry());
+        gfac = new BetterGfacImpl(orchestratorContext.getNewRegistry(), null, new MonitorPublisher(new EventBus()));
     }
 
     public GFACInstance selectGFACInstance() throws OrchestratorException {

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACServiceJobSubmitter.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACServiceJobSubmitter.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACServiceJobSubmitter.java
index 6c9acec..a052d06 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACServiceJobSubmitter.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACServiceJobSubmitter.java
@@ -29,8 +29,6 @@ import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.AiravataZKUtils;
 import org.apache.airavata.common.utils.Constants;
 import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.gfac.core.cpi.GFac;
-import org.apache.airavata.gfac.core.cpi.GFacImpl;
 import org.apache.airavata.gfac.core.utils.GFacUtils;
 import org.apache.airavata.gfac.cpi.GfacService;
 import org.apache.airavata.orchestrator.core.context.OrchestratorContext;

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java
index 2a8b27b..8a2d574 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java
@@ -34,8 +34,6 @@ import org.apache.airavata.orchestrator.core.impl.GFACEmbeddedJobSubmitter;
 import org.apache.airavata.orchestrator.core.job.JobSubmitter;
 import org.apache.airavata.orchestrator.cpi.Orchestrator;
 import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.exception.RegException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,16 +57,15 @@ public class OrchestratorUtils {
         return orchestratorConfiguration;
     }
 
-    public static HostDescription getHostDescription(Orchestrator orchestrator, TaskDetails taskDetails)throws OrchestratorException {
-        JobSubmitter jobSubmitter = ((SimpleOrchestratorImpl) orchestrator).getJobSubmitter();
-        AiravataRegistry2 registry = ((GFACEmbeddedJobSubmitter) jobSubmitter).getOrchestratorContext().getRegistry();
-        ComputationalResourceScheduling taskScheduling = taskDetails.getTaskScheduling();
-        String resourceHostId = taskScheduling.getResourceHostId();
-        try {
-            return registry.getHostDescriptor(resourceHostId);
-        } catch (RegException e) {
-            throw new OrchestratorException(e);
-        }
-    }
-
+//    public static HostDescription getHostDescription(Orchestrator orchestrator, TaskDetails taskDetails)throws OrchestratorException {
+//        JobSubmitter jobSubmitter = ((SimpleOrchestratorImpl) orchestrator).getJobSubmitter();
+//        AiravataRegistry2 registry = ((GFACEmbeddedJobSubmitter) jobSubmitter).getOrchestratorContext().getRegistry();
+//        ComputationalResourceScheduling taskScheduling = taskDetails.getTaskScheduling();
+//        String resourceHostId = taskScheduling.getResourceHostId();
+//        try {
+//            return registry.getHostDescriptor(resourceHostId);
+//        } catch (RegException e) {
+//            throw new OrchestratorException(e);
+//        }
+//    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/AbstractOrchestrator.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/AbstractOrchestrator.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/AbstractOrchestrator.java
index b86ec3b..6ee8290 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/AbstractOrchestrator.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/AbstractOrchestrator.java
@@ -20,42 +20,22 @@
 */
 package org.apache.airavata.orchestrator.cpi.impl;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.airavata.client.AiravataAPIFactory;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.common.exception.AiravataConfigurationException;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.orchestrator.core.OrchestratorConfiguration;
 import org.apache.airavata.orchestrator.core.context.OrchestratorContext;
 import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
-import org.apache.airavata.orchestrator.core.gfac.GFACInstance;
-import org.apache.airavata.orchestrator.core.utils.OrchestratorConstants;
 import org.apache.airavata.orchestrator.core.utils.OrchestratorUtils;
 import org.apache.airavata.orchestrator.cpi.Orchestrator;
 import org.apache.airavata.persistance.registry.jpa.impl.RegistryImpl;
-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.exception.RegException;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+
 public abstract class AbstractOrchestrator implements Orchestrator {
 	private final static Logger logger = LoggerFactory.getLogger(AbstractOrchestrator.class);
-	protected AiravataRegistry2 airavataRegistry;
-	protected AiravataAPI airavataAPI;
 	protected OrchestratorContext orchestratorContext;
 	protected OrchestratorConfiguration orchestratorConfiguration;
 
@@ -93,42 +73,34 @@ public abstract class AbstractOrchestrator implements Orchestrator {
         	orchestratorConfiguration = OrchestratorUtils.loadOrchestratorConfiguration();
             setGatewayProperties();
             /* initializing the Orchestratorcontext object */
-            airavataRegistry = AiravataRegistryFactory.getRegistry(new Gateway(getGatewayName()), new AiravataUser(getAiravataUserName()));
+//            airavataRegistry = AiravataRegistryFactory.getRegistry(new Gateway(getGatewayName()), new AiravataUser(getAiravataUserName()));
             // todo move this code to gfac service mode Jobsubmitter,
             // todo this is ugly, SHOULD fix these isEmbedded mode code from Orchestrator
-            if (!orchestratorConfiguration.isEmbeddedMode()) {
-                Map<String, Integer> gfacNodeList = airavataRegistry.getGFACNodeList();
-                if (gfacNodeList.size() == 0) {
-                    String error = "No GFAC instances available in the system, Can't initialize Orchestrator";
-                    logger.error(error);
-                    throw new OrchestratorException(error);
-                }
-                Set<String> uriList = gfacNodeList.keySet();
-                Iterator<String> iterator = uriList.iterator();
-                // todo consume these data to
-                List<GFACInstance> gfacInstanceList = new ArrayList<GFACInstance>();
-                while (iterator.hasNext()) {
-                    String uri = iterator.next();
-                    Integer integer = gfacNodeList.get(uri);
-                    gfacInstanceList.add(new GFACInstance(uri, integer));
-                }
-            }
+//            if (!orchestratorConfiguration.isEmbeddedMode()) {
+//                Map<String, Integer> gfacNodeList = airavataRegistry.getGFACNodeList();
+//                if (gfacNodeList.size() == 0) {
+//                    String error = "No GFAC instances available in the system, Can't initialize Orchestrator";
+//                    logger.error(error);
+//                    throw new OrchestratorException(error);
+//                }
+//                Set<String> uriList = gfacNodeList.keySet();
+//                Iterator<String> iterator = uriList.iterator();
+//                // todo consume these data to
+//                List<GFACInstance> gfacInstanceList = new ArrayList<GFACInstance>();
+//                while (iterator.hasNext()) {
+//                    String uri = iterator.next();
+//                    Integer integer = gfacNodeList.get(uri);
+//                    gfacInstanceList.add(new GFACInstance(uri, integer));
+//                }
+//            }
             orchestratorContext = new OrchestratorContext();
             orchestratorContext.setOrchestratorConfiguration(orchestratorConfiguration);
-            orchestratorConfiguration.setAiravataAPI(getAiravataAPI());
-            orchestratorContext.setRegistry(airavataRegistry);
+//            orchestratorConfiguration.setAiravataAPI(getAiravataAPI());
+//            orchestratorContext.setRegistry(airavataRegistry);
 
             /* initializing registry cpi */
             orchestratorContext.setNewRegistry(new RegistryImpl());
-        } catch (RegException e) {
-            logger.error("Failed to initializing Orchestrator");
-            OrchestratorException orchestratorException = new OrchestratorException(e);
-            throw orchestratorException;
-        } catch (AiravataConfigurationException e) {
-            logger.error("Failed to initializing Orchestrator");
-            OrchestratorException orchestratorException = new OrchestratorException(e);
-            throw orchestratorException;
-        } catch (IOException e) {
+        }  catch (IOException e) {
             logger.error("Failed to initializing Orchestrator - Error parsing configuration files");
             OrchestratorException orchestratorException = new OrchestratorException(e);
             throw orchestratorException;
@@ -152,20 +124,16 @@ public abstract class AbstractOrchestrator implements Orchestrator {
         }
     }
 
-   private AiravataAPI getAiravataAPI() {
-       if (airavataAPI == null) {
-           try {
-               airavataAPI = AiravataAPIFactory.getAPI(getGatewayName(), getAiravataUserName());
-           }  catch (AiravataAPIInvocationException e) {
-               logger.error("Unable to create Airavata API", e);
-           }
-       }
-       return airavataAPI;
-   }
-
-    public AiravataRegistry2 getAiravataRegistry() {
-        return airavataRegistry;
-    }
+//   private AiravataAPI getAiravataAPI() {
+//       if (airavataAPI == null) {
+//           try {
+//               airavataAPI = AiravataAPIFactory.getAPI(getGatewayName(), getAiravataUserName());
+//           }  catch (AiravataAPIInvocationException e) {
+//               logger.error("Unable to create Airavata API", e);
+//           }
+//       }
+//       return airavataAPI;
+//   }
 
     public OrchestratorContext getOrchestratorContext() {
         return orchestratorContext;

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
index 0f43190..0a2b5a3 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
@@ -20,12 +20,6 @@
 */
 package org.apache.airavata.orchestrator.cpi.impl;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-
-import javax.naming.OperationNotSupportedException;
-
 import org.apache.airavata.model.error.LaunchValidationException;
 import org.apache.airavata.model.error.ValidationResults;
 import org.apache.airavata.model.error.ValidatorResult;
@@ -40,6 +34,10 @@ import org.apache.airavata.registry.cpi.RegistryModelType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+
 public class SimpleOrchestratorImpl extends AbstractOrchestrator{
     private final static Logger logger = LoggerFactory.getLogger(SimpleOrchestratorImpl.class);
     private ExecutorService executor;

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/BaseOrchestratorTest.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/BaseOrchestratorTest.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/BaseOrchestratorTest.java
index e281851..cbfb573 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/BaseOrchestratorTest.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/BaseOrchestratorTest.java
@@ -21,15 +21,16 @@
 package org.apache.airavata.orchestrator.core;
 
 
-import org.apache.airavata.client.AiravataAPIFactory;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.client.tools.DocumentCreator;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.api.Airavata;
+import org.apache.airavata.api.client.AiravataClientFactory;
+import org.apache.airavata.client.tools.DocumentCreatorNew;
 import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.model.error.AiravataClientConnectException;
 import org.apache.airavata.orchestrator.core.util.Initialize;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
-import org.apache.airavata.persistance.registry.jpa.resources.*;
+import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
+import org.apache.airavata.persistance.registry.jpa.resources.UserResource;
+import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
 
 public class BaseOrchestratorTest {
 
@@ -37,7 +38,7 @@ public class BaseOrchestratorTest {
     private WorkerResource workerResource;
     private UserResource userResource;
     private Initialize initialize;
-    private DocumentCreator documentCreator;
+    private DocumentCreatorNew documentCreator;
 
     public void setUp() throws Exception {
         initialize = new Initialize("registry-derby.sql");
@@ -48,10 +49,9 @@ public class BaseOrchestratorTest {
         userResource.setUserName(ServerSettings.getDefaultUser());
         userResource.setPassword(ServerSettings.getDefaultUser());
 
-        documentCreator = new DocumentCreator(getAiravataAPI());
+        documentCreator = new DocumentCreatorNew(getAiravataClient());
         documentCreator.createLocalHostDocs();
-        documentCreator.createGramDocs();
-        documentCreator.createPBSDocsForOGCE();
+        documentCreator.createPBSDocsForOGCE_Echo();
     }
 
     public void tearDown() throws Exception {
@@ -70,25 +70,21 @@ public class BaseOrchestratorTest {
         return userResource;
     }
 
-    private AiravataAPI getAiravataAPI() {
-        AiravataAPI airavataAPI = null;
+    private Airavata.Client getAiravataClient() {
+        Airavata.Client client = null;
         try {
-            String systemUserName = ServerSettings.getSystemUser();
-            String gateway = ServerSettings.getSystemUserGateway();
-            airavataAPI = AiravataAPIFactory.getAPI(gateway, systemUserName);
-        } catch (ApplicationSettingsException e) {
-            e.printStackTrace();
-        } catch (AiravataAPIInvocationException e) {
+            client = AiravataClientFactory.createAiravataClient("localhost", 8930);
+        } catch (AiravataClientConnectException e) {
             e.printStackTrace();
         }
-        return airavataAPI;
+        return client;
     }
 
-    public DocumentCreator getDocumentCreator() {
+    public DocumentCreatorNew getDocumentCreator() {
         return documentCreator;
     }
 
-    public void setDocumentCreator(DocumentCreator documentCreator) {
+    public void setDocumentCreator(DocumentCreatorNew documentCreator) {
         this.documentCreator = documentCreator;
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
index 0ddd814..eee0001 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
@@ -20,27 +20,6 @@
 */
 package org.apache.airavata.orchestrator.core;
 
-import org.apache.airavata.client.AiravataAPIFactory;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.model.util.ExperimentModelUtil;
-import org.apache.airavata.model.workspace.experiment.*;
-import org.apache.airavata.orchestrator.cpi.Orchestrator;
-import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
-import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
-import org.apache.airavata.registry.cpi.ParentDataType;
-import org.apache.airavata.registry.cpi.Registry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
 public class NewOrchestratorTest extends BaseOrchestratorTest {
 //    private static final Logger log = LoggerFactory.getLogger(NewOrchestratorTest.class);
 //

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/Initialize.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/Initialize.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/Initialize.java
index fe71df5..2823cdf 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/Initialize.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/Initialize.java
@@ -23,9 +23,8 @@ package org.apache.airavata.orchestrator.core.util;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.resources.*;
-import org.apache.airavata.registry.api.exception.RegistrySettingsException;
-import org.apache.airavata.registry.api.util.RegistrySettings;
 import org.apache.airavata.registry.cpi.RegistryException;
+import org.apache.airavata.registry.cpi.utils.RegistrySettings;
 import org.apache.derby.drda.NetworkServerControl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -101,7 +100,7 @@ public class Initialize {
             jdbcUser = RegistrySettings.getSetting("registry.jdbc.user");
             jdbcPassword = RegistrySettings.getSetting("registry.jdbc.password");
             jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
-        } catch (RegistrySettingsException e) {
+        } catch (RegistryException e) {
             logger.error("Unable to read properties" , e);
         }
 
@@ -157,10 +156,8 @@ public class Initialize {
             resource.setWorker(workerResource);
             resource.save();
 
-        } catch (RegistrySettingsException e) {
-            logger.error("Unable to read properties", e);
         } catch (RegistryException e) {
-            logger.error("Error while saving data to registry", e);
+            logger.error("Unable to read properties", e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/registry/airavata-jpa-registry/pom.xml
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/pom.xml b/modules/registry/airavata-jpa-registry/pom.xml
index 483b31a..8fc0e48 100644
--- a/modules/registry/airavata-jpa-registry/pom.xml
+++ b/modules/registry/airavata-jpa-registry/pom.xml
@@ -61,11 +61,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-registry-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
             <artifactId>airavata-credential-store</artifactId>
             <version>${project.version}</version>
         </dependency>

http://git-wip-us.apache.org/repos/asf/airavata/blob/f72637f2/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAResourceAccessor.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAResourceAccessor.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAResourceAccessor.java
deleted file mode 100644
index 5f0b597..0000000
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAResourceAccessor.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * 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.persistance.registry.jpa;
-
-import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
-import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class JPAResourceAccessor {
-	private AiravataRegistry2 registry=null;
-	private ResourceUtils resourceUtils = new ResourceUtils();
-
-	public JPAResourceAccessor(AiravataRegistry2 registry) {
-		this.registry=registry;
-	}
-	
-	public GatewayResource getGateway(){
-        GatewayResource gatewayResource = new GatewayResource();
-        gatewayResource.setGatewayName(this.registry.getGateway().getGatewayName());
-		return gatewayResource;
-	}
-	
-	public ResourceUtils root(){
-		return resourceUtils;
-	}
-	
-	public WorkerResource getWorker(){
-        return new WorkerResource(registry.getUser().getUserName(), getGateway());
-	}
-}


Mime
View raw message