You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ra...@apache.org on 2014/11/06 17:54:00 UTC
[3/3] git commit: Merged the changes. AIRAVATA-1471
Merged the changes. AIRAVATA-1471
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/9e6f748c
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/9e6f748c
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/9e6f748c
Branch: refs/heads/master
Commit: 9e6f748cfb8eed99229ff169fc1ac37f5b818e6d
Parents: 44c72f4
Author: raminder <ra...@apache.org>
Authored: Thu Nov 6 11:53:44 2014 -0500
Committer: raminder <ra...@apache.org>
Committed: Thu Nov 6 11:53:44 2014 -0500
----------------------------------------------------------------------
.../server/handler/AiravataServerHandler.java | 134 +-
.../server/handler/WorkflowServerHandler.java | 158 -
.../java/org/apache/airavata/api/Workflow.java | 8191 ------------------
.../api/client/AiravataClientFactory.java | 29 -
.../client/samples/CreateLaunchExperiment.java | 12 +-
.../ui/dialogs/registry/RegistryWindow.java | 4 +-
.../dialogs/workflow/WorkflowImportWindow.java | 4 +-
.../RegistryWorkflowPublisherWindow.java | 4 +-
.../WorkflowInterpreterLaunchWindow.java | 2 +-
.../apache/airavata/xbaya/util/XBayaUtil.java | 4 +-
10 files changed, 123 insertions(+), 8419 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/9e6f748c/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index d96ce52..810ffcc 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -62,6 +62,7 @@ import org.apache.airavata.registry.cpi.*;
import org.apache.airavata.registry.cpi.utils.Constants;
import org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.TaskDetailConstants;
import org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.WorkflowNodeConstants;
+import org.apache.airavata.workflow.catalog.WorkflowCatalogFactory;
import org.apache.airavata.workflow.engine.WorkflowEngine;
import org.apache.airavata.workflow.engine.WorkflowEngineException;
import org.apache.airavata.workflow.engine.WorkflowEngineFactory;
@@ -74,6 +75,7 @@ public class AiravataServerHandler implements Airavata.Iface {
private Registry registry;
private AppCatalog appCatalog;
private Publisher publisher;
+ private WorkflowCatalog workflowCatalog;
public AiravataServerHandler() {
try {
@@ -2602,38 +2604,118 @@ public class AiravataServerHandler implements Airavata.Iface {
}
@Override
- public List<String> getAllWorkflows() throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
- return null;
- }
-
- @Override
- public Workflow getWorkflow(String workflowTemplateId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
- return null;
- }
+ public List<String> getAllWorkflows() throws InvalidRequestException,
+ AiravataClientException, AiravataSystemException, TException {
+ try {
+ return getWorkflowCatalog().getAllWorkflows();
+ } catch (AppCatalogException e) {
+ String msg = "Error in retrieving all workflow template Ids.";
+ logger.error(msg, e);
+ AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
+ }
- @Override
- public void deleteWorkflow(String workflowTemplateId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+ @Override
+ public Workflow getWorkflow(String workflowTemplateId)
+ throws InvalidRequestException, AiravataClientException,
+ AiravataSystemException, TException {
+ try {
+ return getWorkflowCatalog().getWorkflow(workflowTemplateId);
+ } catch (AppCatalogException e) {
+ String msg = "Error in retrieving the workflow "+workflowTemplateId+".";
+ logger.error(msg, e);
+ AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
+ }
- }
+ @Override
+ public void deleteWorkflow(String workflowTemplateId)
+ throws InvalidRequestException, AiravataClientException,
+ AiravataSystemException, TException {
+ try {
+ getWorkflowCatalog().deleteWorkflow(workflowTemplateId);
+ } catch (AppCatalogException e) {
+ String msg = "Error in deleting the workflow "+workflowTemplateId+".";
+ logger.error(msg, e);
+ AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
+ }
- @Override
- public String registerWorkflow(Workflow workflow) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
- return null;
- }
+ @Override
+ public String registerWorkflow(Workflow workflow)
+ throws InvalidRequestException, AiravataClientException,
+ AiravataSystemException, TException {
+ try {
+ return getWorkflowCatalog().registerWorkflow(workflow);
+ } catch (AppCatalogException e) {
+ String msg = "Error in registering the workflow "+workflow.getName()+".";
+ logger.error(msg, e);
+ AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
+ }
- @Override
- public void updateWorkflow(String workflowTemplateId, Workflow workflow) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+ @Override
+ public void updateWorkflow(String workflowTemplateId, Workflow workflow)
+ throws InvalidRequestException, AiravataClientException,
+ AiravataSystemException, TException {
+ try {
+ getWorkflowCatalog().updateWorkflow(workflowTemplateId, workflow);
+ } catch (AppCatalogException e) {
+ String msg = "Error in updating the workflow "+workflow.getName()+".";
+ logger.error(msg, e);
+ AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
+ }
- }
+ @Override
+ public String getWorkflowTemplateId(String workflowName)
+ throws InvalidRequestException, AiravataClientException,
+ AiravataSystemException, TException {
+ try {
+ return getWorkflowCatalog().getWorkflowTemplateId(workflowName);
+ } catch (AppCatalogException e) {
+ String msg = "Error in retrieving the workflow template id for "+workflowName+".";
+ logger.error(msg, e);
+ AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
+ }
- @Override
- public String getWorkflowTemplateId(String workflowName) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
- return null;
- }
+ @Override
+ public boolean isWorkflowExistWithName(String workflowName)
+ throws InvalidRequestException, AiravataClientException,
+ AiravataSystemException, TException {
+ try {
+ return getWorkflowCatalog().isWorkflowExistWithName(workflowName);
+ } catch (AppCatalogException e) {
+ String msg = "Error in veriying the workflow for workflow name "+workflowName+".";
+ logger.error(msg, e);
+ AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
+ }
- @Override
- public boolean isWorkflowExistWithName(String workflowName) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
- return false;
- }
+ private WorkflowCatalog getWorkflowCatalog() {
+ if (workflowCatalog == null) {
+ try {
+ workflowCatalog = WorkflowCatalogFactory.getWorkflowCatalog();
+ } catch (Exception e) {
+ logger.error("Unable to create Workflow Catalog", e);
+ }
+ }
+ return workflowCatalog;
+ }
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9e6f748c/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java
deleted file mode 100644
index db7779d..0000000
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java
+++ /dev/null
@@ -1,158 +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.api.server.handler;
-
-import java.util.List;
-
-import org.airavata.appcatalog.cpi.AppCatalogException;
-import org.airavata.appcatalog.cpi.WorkflowCatalog;
-import org.apache.airavata.api.Workflow.Iface;
-import org.apache.airavata.model.Workflow;
-import org.apache.airavata.model.error.AiravataClientException;
-import org.apache.airavata.model.error.AiravataErrorType;
-import org.apache.airavata.model.error.AiravataSystemException;
-import org.apache.airavata.model.error.InvalidRequestException;
-import org.apache.airavata.workflow.catalog.WorkflowCatalogFactory;
-import org.apache.thrift.TException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WorkflowServerHandler implements Iface {
- private static final Logger log = LoggerFactory.getLogger(WorkflowServerHandler.class);
-
- private WorkflowCatalog workflowCatalog;
-
- @Override
- public List<String> getAllWorkflows() throws InvalidRequestException,
- AiravataClientException, AiravataSystemException, TException {
- try {
- return getWorkflowCatalog().getAllWorkflows();
- } catch (AppCatalogException e) {
- String msg = "Error in retrieving all workflow template Ids.";
- log.error(msg, e);
- AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage(msg+" More info : " + e.getMessage());
- throw exception;
- }
- }
-
- @Override
- public Workflow getWorkflow(String workflowTemplateId)
- throws InvalidRequestException, AiravataClientException,
- AiravataSystemException, TException {
- try {
- return getWorkflowCatalog().getWorkflow(workflowTemplateId);
- } catch (AppCatalogException e) {
- String msg = "Error in retrieving the workflow "+workflowTemplateId+".";
- log.error(msg, e);
- AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage(msg+" More info : " + e.getMessage());
- throw exception;
- }
- }
-
- @Override
- public void deleteWorkflow(String workflowTemplateId)
- throws InvalidRequestException, AiravataClientException,
- AiravataSystemException, TException {
- try {
- getWorkflowCatalog().deleteWorkflow(workflowTemplateId);
- } catch (AppCatalogException e) {
- String msg = "Error in deleting the workflow "+workflowTemplateId+".";
- log.error(msg, e);
- AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage(msg+" More info : " + e.getMessage());
- throw exception;
- }
- }
-
- @Override
- public String registerWorkflow(Workflow workflow)
- throws InvalidRequestException, AiravataClientException,
- AiravataSystemException, TException {
- try {
- return getWorkflowCatalog().registerWorkflow(workflow);
- } catch (AppCatalogException e) {
- String msg = "Error in registering the workflow "+workflow.getName()+".";
- log.error(msg, e);
- AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage(msg+" More info : " + e.getMessage());
- throw exception;
- }
- }
-
- @Override
- public void updateWorkflow(String workflowTemplateId, Workflow workflow)
- throws InvalidRequestException, AiravataClientException,
- AiravataSystemException, TException {
- try {
- getWorkflowCatalog().updateWorkflow(workflowTemplateId, workflow);
- } catch (AppCatalogException e) {
- String msg = "Error in updating the workflow "+workflow.getName()+".";
- log.error(msg, e);
- AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage(msg+" More info : " + e.getMessage());
- throw exception;
- }
- }
-
- @Override
- public String getWorkflowTemplateId(String workflowName)
- throws InvalidRequestException, AiravataClientException,
- AiravataSystemException, TException {
- try {
- return getWorkflowCatalog().getWorkflowTemplateId(workflowName);
- } catch (AppCatalogException e) {
- String msg = "Error in retrieving the workflow template id for "+workflowName+".";
- log.error(msg, e);
- AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage(msg+" More info : " + e.getMessage());
- throw exception;
- }
- }
-
- @Override
- public boolean isWorkflowExistWithName(String workflowName)
- throws InvalidRequestException, AiravataClientException,
- AiravataSystemException, TException {
- try {
- return getWorkflowCatalog().isWorkflowExistWithName(workflowName);
- } catch (AppCatalogException e) {
- String msg = "Error in veriying the workflow for workflow name "+workflowName+".";
- log.error(msg, e);
- AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage(msg+" More info : " + e.getMessage());
- throw exception;
- }
- }
-
- private WorkflowCatalog getWorkflowCatalog() {
- if (workflowCatalog == null) {
- try {
- workflowCatalog = WorkflowCatalogFactory.getWorkflowCatalog();
- } catch (Exception e) {
- log.error("Unable to create Workflow Catalog", e);
- }
- }
- return workflowCatalog;
- }
-}