You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2015/01/21 19:46:45 UTC
[5/9] airavata git commit: removing previous airavata client API -
AIRAVATA-1371
http://git-wip-us.apache.org/repos/asf/airavata/blob/32fff944/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowManagerImpl.java b/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowManagerImpl.java
deleted file mode 100644
index 4596e42..0000000
--- a/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowManagerImpl.java
+++ /dev/null
@@ -1,535 +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.client.impl;
-
-import org.apache.airavata.client.AiravataClient;
-import org.apache.airavata.client.api.WorkflowManager;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.client.api.exception.WorkflowAlreadyExistsException;
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.workflow.model.wf.WorkflowData;
-import org.apache.airavata.workflow.model.wf.WorkflowInput;
-
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-
-public class WorkflowManagerImpl implements WorkflowManager {
- private AiravataClient client;
-
- public WorkflowManagerImpl(AiravataClient client) {
- setClient(client);
- }
-
- public AiravataClient getClient() {
- return client;
- }
-
- public void setClient(AiravataClient client) {
- this.client = client;
- }
-
- @Override
- public boolean saveWorkflow(String workflowAsString, String owner)
- throws AiravataAPIInvocationException {
- return saveWorkflow(getWorkflowFromString(workflowAsString), workflowAsString, owner);
- }
-
- @Override
- public void addOwnerWorkflow (String workflowAsString, String owner)
- throws AiravataAPIInvocationException, WorkflowAlreadyExistsException {
- addWorkflow(getWorkflowFromString(workflowAsString), workflowAsString, owner);
- }
-
- @Override
- public void updateOwnerWorkflow (String workflowAsString, String owner)
- throws AiravataAPIInvocationException {
- updateWorkflow(getWorkflowFromString(workflowAsString), workflowAsString, owner);
- }
-
- @Override
- public void addOwnerWorkflow (URI workflowPath, String owner)
- throws AiravataAPIInvocationException, WorkflowAlreadyExistsException {
- Workflow workflow = getWorkflowFromURI(workflowPath);
- addWorkflow(workflow, XMLUtil.xmlElementToString(workflow.toXML()), owner);
- }
-
- @Override
- public void updateOwnerWorkflow (URI workflowPath, String owner)
- throws AiravataAPIInvocationException {
- Workflow workflow = getWorkflowFromURI(workflowPath);
- updateWorkflow(workflow, XMLUtil.xmlElementToString(workflow.toXML()), owner);
- }
-
- @Override
- public boolean saveWorkflow(Workflow workflow, String owner)
- throws AiravataAPIInvocationException {
- return saveWorkflow(workflow, XMLUtil.xmlElementToString(workflow.toXML()), owner);
- }
-
- @Override
- public void addOwnerWorkflow (Workflow workflow, String owner) throws WorkflowAlreadyExistsException,
- AiravataAPIInvocationException{
- addWorkflow(workflow, XMLUtil.xmlElementToString(workflow.toXML()), owner);
- }
-
- @Override
- public void updateOwnerWorkflow (Workflow workflow, String owner) throws AiravataAPIInvocationException {
- updateWorkflow(workflow, XMLUtil.xmlElementToString(workflow.toXML()), owner);
- }
-
- private void addWorkflow(Workflow workflow, String workflowAsString, String owner)
- throws WorkflowAlreadyExistsException, AiravataAPIInvocationException {
-// try {
-// getClient().getRegistryClient().addWorkflow(workflow.getName(), workflowAsString);
-// } catch (UserWorkflowAlreadyExistsException e) {
-// throw new WorkflowAlreadyExistsException("Workflow " +
-// workflow.getName()
-// + " already exists in the system.", e);
-// } catch (RegException e) {
-// throw new AiravataAPIInvocationException("An internal error occurred while adding workflow " +
-// workflow.getName(), e);
-// } catch (AiravataConfigurationException e) {
-// throw new AiravataAPIInvocationException("Error retrieving registry client for workflow " +
-// workflow.getName(), e);
-// }
-
-// if (owner == null) {
-// try {
-// getClient().getRegistryClient().publishWorkflow(workflow.getName());
-// } catch (RegException e) {
-// throw new AiravataAPIInvocationException("An internal error occurred while adding workflow " +
-// workflow.getName(), e);
-// } catch (AiravataConfigurationException e) {
-// throw new AiravataAPIInvocationException("Error retrieving registry client for workflow " +
-// workflow.getName(), e);
-// }
-// }
- }
-
- private void updateWorkflow(Workflow workflow, String workflowAsString, String owner)
- throws AiravataAPIInvocationException {
-// try {
-// getClient().getRegistryClient().updateWorkflow(workflow.getName(), workflowAsString);
-// } catch (RegException e) {
-// throw new AiravataAPIInvocationException("An internal error occurred while adding workflow " +
-// workflow.getName(), e);
-// } catch (AiravataConfigurationException e) {
-// throw new AiravataAPIInvocationException("Error retrieving registry client for workflow " +
-// workflow.getName(), e);
-// }
-//
-// if (owner == null) {
-// try {
-// getClient().getRegistryClient().publishWorkflow(workflow.getName());
-// } catch (RegException e) {
-// throw new AiravataAPIInvocationException("An internal error occurred while adding workflow " +
-// workflow.getName(), e);
-// } catch (AiravataConfigurationException e) {
-// throw new AiravataAPIInvocationException("Error retrieving registry client for workflow " +
-// workflow.getName(), e);
-// }
-// }
- }
-
- // Remove once deprecated methods are removed from the API
- @Deprecated
- private boolean saveWorkflow(Workflow workflow, String workflowAsString,String owner)
- throws AiravataAPIInvocationException {
-// try {
-//
-// if (getClient().getRegistryClient().isWorkflowExists(workflow.getName())) {
-// getClient().getRegistryClient().updateWorkflow(workflow.getName(),workflowAsString);
-// }else{
-// getClient().getRegistryClient().addWorkflow(workflow.getName(),workflowAsString);
-// }
-// if (owner==null){
-// getClient().getRegistryClient().publishWorkflow(workflow.getName());
-// }
-// return true;
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- return false;
- }
-
- @Override
- public List<Workflow> getWorkflows(String owner)
- throws AiravataAPIInvocationException {
-// try {
-// List<Workflow> workflows=new ArrayList<Workflow>();
-// Map<String, String> workflowMap = getClient().getRegistryClient().getWorkflows();
-// for(String workflowStr:workflowMap.values()){
-// workflows.add(getWorkflowFromString(workflowStr));
-// }
-// return workflows;
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- return null;
- }
-
- @Override
- public List<String> getWorkflowTemplateIds(String owner)
- throws AiravataAPIInvocationException {
-// try {
-// List<String> workflowList = new ArrayList<String>();
-// Map<String, String> workflows;
-// workflows = getClient().getRegistryClient().getWorkflows();
-// for (String name : workflows.keySet()) {
-// workflowList.add(name);
-// }
-// return workflowList;
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- return null;
- }
-
- @Override
- public Workflow getWorkflow(String workflowName, String owner)
- throws AiravataAPIInvocationException {
- return getWorkflowFromString(getWorkflowAsString(workflowName, owner));
- }
-
- @Override
- public String getWorkflowAsString(String workflowName, String owner)
- throws AiravataAPIInvocationException {
-// try {
-// return getClient().getRegistryClient().getWorkflowGraphXML(workflowName);
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- return null;
- }
-
- @Override
- public boolean deleteWorkflow(String workflowName, String owner)
- throws AiravataAPIInvocationException {
-// try {
-// getClient().getRegistryClient().removeWorkflow(workflowName);
-// return true;
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- return false;
- }
-
- @Override
- public boolean saveWorkflow(String workflowAsString)
- throws AiravataAPIInvocationException {
- return saveWorkflow(workflowAsString, getCurrentUser());
- }
-
- @Override
- public void addWorkflow (String workflowAsString) throws WorkflowAlreadyExistsException,
- AiravataAPIInvocationException {
- addOwnerWorkflow(workflowAsString, getCurrentUser());
- }
-
- @Override
- public void updateWorkflow (String workflowAsString) throws AiravataAPIInvocationException {
- updateOwnerWorkflow(workflowAsString, getCurrentUser());
- }
-
- @Override
- public boolean saveWorkflowAsPublic(String workflowAsString)
- throws AiravataAPIInvocationException {
- return saveWorkflow(workflowAsString, null);
- }
-
- @Override
- public void addWorkflowAsPublic (String workflowAsString) throws AiravataAPIInvocationException,
- WorkflowAlreadyExistsException {
- addOwnerWorkflow (workflowAsString, null);
- }
-
- @Override
- public void updateWorkflowAsPublic (String workflowAsString) throws AiravataAPIInvocationException {
- updateOwnerWorkflow(workflowAsString, null);
- }
-
- @Override
- public void addWorkflowAsPublic (URI workflowPath) throws AiravataAPIInvocationException,
- WorkflowAlreadyExistsException {
- addOwnerWorkflow (getWorkflowFromURI(workflowPath), null);
- }
-
- @Override
- public void updateWorkflowAsPublic (URI workflowPath) throws AiravataAPIInvocationException {
- updateOwnerWorkflow(getWorkflowFromURI(workflowPath), null);
- }
-
- @Override
- public boolean saveWorkflow(Workflow workflow)
- throws AiravataAPIInvocationException {
- return saveWorkflow(workflow, getCurrentUser());
- }
-
- @Override
- public void addWorkflow (Workflow workflow) throws WorkflowAlreadyExistsException,
- AiravataAPIInvocationException{
- addOwnerWorkflow(workflow, getCurrentUser());
- }
-
- @Override
- public void updateWorkflow (Workflow workflow) throws AiravataAPIInvocationException {
- updateOwnerWorkflow(workflow, getCurrentUser());
- }
-
- @Override
- public void addWorkflow (URI workflowPath) throws AiravataAPIInvocationException,
- WorkflowAlreadyExistsException {
- addOwnerWorkflow(getWorkflowFromURI(workflowPath), getCurrentUser());
- }
-
- @Override
- public void updateWorkflow (URI workflowPath) throws AiravataAPIInvocationException {
- updateOwnerWorkflow(getWorkflowFromURI(workflowPath), getCurrentUser());
- }
-
- private String getCurrentUser() {
- return getClient().getCurrentUser();
- }
-
- @Override
- public boolean saveWorkflowAsPublic(Workflow workflow)
- throws AiravataAPIInvocationException {
- return saveWorkflow(workflow, null);
- }
-
- @Override
- public List<Workflow> getWorkflows() throws AiravataAPIInvocationException {
- return getWorkflows(getCurrentUser());
- }
-
- @Override
- public List<String> getWorkflowTemplateIds()
- throws AiravataAPIInvocationException {
- return getWorkflowTemplateIds(getCurrentUser());
- }
-
- @Override
- public Workflow getWorkflow(String workflowName)
- throws AiravataAPIInvocationException {
- return getWorkflow(workflowName, getCurrentUser());
- }
-
- @Override
- public String getWorkflowAsString(String workflowName)
- throws AiravataAPIInvocationException {
- return getWorkflowAsString(workflowName, getCurrentUser());
- }
-
- @Override
- public boolean deleteWorkflow(String workflowName)
- throws AiravataAPIInvocationException {
- return deleteWorkflow(workflowName, getCurrentUser());
- }
-
- @Override
- public Workflow getWorkflowFromString(String workflowAsString)
- throws AiravataAPIInvocationException {
- try {
- return new Workflow(workflowAsString);
- } catch (Exception e) {
- throw new AiravataAPIInvocationException(e);
- }
- }
-
- @Override
- public Workflow getWorkflowFromURI(URI workflowPath) throws AiravataAPIInvocationException {
- try {
- return new Workflow(workflowPath);
- } catch (Exception e) {
- throw new AiravataAPIInvocationException(e);
- }
- }
-
- @Override
- public String getWorkflowAsString(Workflow workflow)
- throws AiravataAPIInvocationException {
- return XMLUtil.xmlElementToString(workflow.toXML());
- }
-
- @Override
- public List<String> getWorkflowServiceNodeIDs(String templateID) throws AiravataAPIInvocationException{
- return getWorkflow(templateID).getWorkflowServiceNodeIDs();
- }
-
- @Override
- public boolean isPublishedWorkflowExists(String workflowName)
- throws AiravataAPIInvocationException {
-// try {
-// return getClient().getRegistryClient().isPublishedWorkflowExists(workflowName);
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- return false;
- }
-
- @Override
- public void publishWorkflow(String workflowName, String publishWorkflowName)
- throws AiravataAPIInvocationException {
-// try {
-// getClient().getRegistryClient().publishWorkflow(workflowName, publishWorkflowName);
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- }
-
- @Override
- public void publishWorkflow(String workflowName)
- throws AiravataAPIInvocationException {
-// try {
-// getClient().getRegistryClient().publishWorkflow(workflowName);
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- }
-
- @Override
- public String getPublishedWorkflowGraphXML(String workflowName)
- throws AiravataAPIInvocationException {
-// try {
-// return getClient().getRegistryClient().getPublishedWorkflowGraphXML(workflowName);
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- return null;
- }
-
- @Override
- public Workflow getPublishedWorkflow(String workflowName)
- throws AiravataAPIInvocationException {
- return getWorkflowFromString(getPublishedWorkflowGraphXML(workflowName));
- }
-
- @Override
- public List<String> getPublishedWorkflowNames()
- throws AiravataAPIInvocationException {
-// try {
-// return getClient().getRegistryClient().getPublishedWorkflowNames();
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- return null;
- }
-
- @Override
- public Map<String, Workflow> getPublishedWorkflows()
- throws AiravataAPIInvocationException {
-// try {
-// Map<String, Workflow> workflows=new HashMap<String, Workflow>();
-// Map<String, String> publishedWorkflows = getClient().getRegistryClient().getPublishedWorkflows();
-// for (String name : publishedWorkflows.keySet()) {
-// workflows.put(name, getWorkflowFromString(publishedWorkflows.get(name)));
-// }
-// return workflows;
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- return null;
- }
-
- @Override
- public void removePublishedWorkflow(String workflowName)
- throws AiravataAPIInvocationException {
-// try {
-// getClient().getRegistryClient().removePublishedWorkflow(workflowName);
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- }
-
- @Override
- public List<WorkflowInput> getWorkflowInputs(String workflowName) throws AiravataAPIInvocationException {
- try {
- return getWorkflow(workflowName).getWorkflowInputs();
- } catch (Exception e) {
- throw new AiravataAPIInvocationException(e);
- }
- }
-
- @Override
- public List<WorkflowInput> getWorkflowInputs(WorkflowData workflowData) throws AiravataAPIInvocationException {
-// try {
-// if (workflowData.isPublished()){
-// return getWorkflowFromString(getClient().getRegistryClient().getPublishedWorkflowGraphXML(workflowData.getName())).getWorkflowInputs();
-// }else{
-// return getWorkflowInputs(workflowData.getName());
-// }
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- return null;
- }
-
- @Override
- public List<WorkflowData> getAllWorkflows() throws AiravataAPIInvocationException {
-// List<WorkflowData> list = new ArrayList<WorkflowData>();
-// List<String> workflowTemplateIds = getWorkflowTemplateIds();
-// try {
-// for (String id : workflowTemplateIds) {
-// list.add(new WorkflowData(id,null,false));
-// }
-// List<String> publishedWorkflowNames = getClient().getRegistryClient().getPublishedWorkflowNames();
-// for (String id : publishedWorkflowNames) {
-// list.add(new WorkflowData(id,null,false));
-// }
-// return list;
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- return null;
- }
-
- @Override
- public boolean isWorkflowExists(String workflowName) throws AiravataAPIInvocationException {
-// try {
-// return getClient().getRegistryClient().isWorkflowExists(workflowName);
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- return false;
- }
-
- @Override
- public void updateWorkflow(String workflowName, String workflowGraphXml) throws AiravataAPIInvocationException {
-// try {
-// getClient().getRegistryClient().updateWorkflow(workflowName, workflowGraphXml);
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- }
-
- @Override
- public void removeWorkflow(String workflowName) throws AiravataAPIInvocationException {
-// try {
-// getClient().getRegistryClient().removeWorkflow(workflowName);
-// } catch (Exception e) {
-// throw new AiravataAPIInvocationException(e);
-// }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/32fff944/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowOutputDataSettingsImpl.java
----------------------------------------------------------------------
diff --git a/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowOutputDataSettingsImpl.java b/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowOutputDataSettingsImpl.java
deleted file mode 100644
index 98e24ea..0000000
--- a/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowOutputDataSettingsImpl.java
+++ /dev/null
@@ -1,78 +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.client.impl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.airavata.client.api.OutputDataSettings;
-import org.apache.airavata.client.api.WorkflowOutputDataSettings;
-
-public class WorkflowOutputDataSettingsImpl implements
- WorkflowOutputDataSettings {
- private List<OutputDataSettings> outputDataSettingsList;
-
- private List<OutputDataSettings> getOutputDataSettingsListArray(){
- if (outputDataSettingsList==null){
- outputDataSettingsList=new ArrayList<OutputDataSettings>();
- }
- return outputDataSettingsList;
- }
-
- @Override
- public OutputDataSettings[] getOutputDataSettingsList() {
- return getOutputDataSettingsListArray().toArray(new OutputDataSettings[]{});
- }
-
- @Override
- public OutputDataSettings addNewOutputDataSettings(String nodeId,
- String outputDataDirectory, String dataRegistryURL,
- Boolean isDataPersistent) {
- addNewOutputDataSettings(new ApplicationOutputDataSettingsImpl(nodeId, outputDataDirectory, dataRegistryURL, isDataPersistent));
- return getOutputDataSettingsListArray().get(getOutputDataSettingsListArray().size()-1);
- }
-
- @Override
- public void addNewOutputDataSettings(
- OutputDataSettings... outputDataSettings) {
- getOutputDataSettingsListArray().addAll(Arrays.asList(outputDataSettings));
- }
-
- @Override
- public void removeOutputDataSettings(OutputDataSettings outputDataSettings) {
- if (getOutputDataSettingsListArray().contains(outputDataSettings)){
- getOutputDataSettingsListArray().remove(outputDataSettings);
- }
- }
-
- @Override
- public void removeAllOutputDataSettings() {
- getOutputDataSettingsListArray().clear();
- }
-
- @Override
- public OutputDataSettings addNewOutputDataSettings(String nodeId) {
- return addNewOutputDataSettings(nodeId,null,null,null);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/32fff944/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowSchedulingSettingsImpl.java
----------------------------------------------------------------------
diff --git a/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowSchedulingSettingsImpl.java b/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowSchedulingSettingsImpl.java
deleted file mode 100644
index a439066..0000000
--- a/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowSchedulingSettingsImpl.java
+++ /dev/null
@@ -1,97 +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.client.impl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.airavata.client.api.NodeSettings;
-import org.apache.airavata.client.api.WorkflowSchedulingSettings;
-
-public class WorkflowSchedulingSettingsImpl implements
- WorkflowSchedulingSettings {
-
- private List<NodeSettings> nodeSettingsList;
-
- private List<NodeSettings> getNodeSettingsListArray(){
- if (nodeSettingsList==null){
- nodeSettingsList=new ArrayList<NodeSettings>();
- }
- return nodeSettingsList;
- }
-
- @Override
- public NodeSettings[] getNodeSettingsList() {
- return getNodeSettingsListArray().toArray(new NodeSettings[]{});
- }
-
- @Override
- public NodeSettings addNewNodeSettings(String nodeId) {
- getNodeSettingsListArray().add(new NodeSettingsImpl(nodeId));
- return getNodeSettingsListArray().get(getNodeSettingsListArray().size()-1);
- }
-
- @Override
- public NodeSettings addNewNodeSettings(String nodeId, String serviceId,
- int cpuCount, int nodeCount) {
- NodeSettingsImpl nodeSettings = new NodeSettingsImpl(nodeId, serviceId);
- nodeSettings.getHPCSettings().setCPUCount(cpuCount);
- nodeSettings.getHPCSettings().setNodeCount(nodeCount);
- addNewNodeSettings(nodeSettings);
- return nodeSettings;
- }
-
- @Override
- public void addNewNodeSettings(NodeSettings... newNodeSettingsList) {
- getNodeSettingsListArray().addAll(Arrays.asList(newNodeSettingsList));
- }
-
- @Override
- public boolean hasNodeSettings(String nodeId) {
- return getNodeSettings(nodeId)!=null;
- }
-
- @Override
- public NodeSettings getNodeSettings(String nodeId) {
- for(NodeSettings nodeSettings:getNodeSettingsList()){
- if (nodeSettings.getNodeId().equals(nodeId)){
- return nodeSettings;
- }
- }
- return null;
- }
-
- @Override
- public void removeNodeSettings(String nodeId) {
- if (hasNodeSettings(nodeId)){
- getNodeSettingsListArray().remove(getNodeSettings(nodeId));
- }
-
- }
-
- @Override
- public void removeAllNodeSettings() {
- getNodeSettingsListArray().clear();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/32fff944/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/NameValue.java
----------------------------------------------------------------------
diff --git a/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/NameValue.java b/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/NameValue.java
deleted file mode 100644
index 5faeb10..0000000
--- a/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/NameValue.java
+++ /dev/null
@@ -1,559 +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.client.stub.interpretor;
-
-
-// http://silktree.cs.indiana.edu:18080/axis2/services/WorkflowInterpretor
-public class NameValue implements org.apache.axis2.databinding.ADBBean {
- /*
- * This type was generated from the piece of schema that had name = NameValue Namespace URI =
- * http://interpretor.xbaya.airavata.apache.org Namespace Prefix = ns1
- */
-
- private static String generatePrefix(String namespace) {
- if (namespace.equals("http://interpretor.xbaya.airavata.apache.org")) {
- return "ns1";
- }
- return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
- }
-
- /**
- * field for Name
- */
-
- protected String localName;
-
- /*
- * This tracker boolean wil be used to detect whether the user called the set method for this attribute. It will be
- * used to determine whether to include this field in the serialized XML
- */
- protected boolean localNameTracker = false;
-
- /**
- * Auto generated getter method
- *
- * @return java.lang.String
- */
- public String getName() {
- return localName;
- }
-
- /**
- * Auto generated setter method
- *
- * @param param
- * Name
- */
- public void setName(String param) {
-
- if (param != null) {
- // update the setting tracker
- localNameTracker = true;
- } else {
- localNameTracker = true;
-
- }
-
- this.localName = param;
-
- }
-
- /**
- * field for Value
- */
-
- protected String localValue;
-
- /*
- * This tracker boolean wil be used to detect whether the user called the set method for this attribute. It will be
- * used to determine whether to include this field in the serialized XML
- */
- protected boolean localValueTracker = false;
-
- /**
- * Auto generated getter method
- *
- * @return java.lang.String
- */
- public String getValue() {
- return localValue;
- }
-
- /**
- * Auto generated setter method
- *
- * @param param
- * Value
- */
- public void setValue(String param) {
-
- if (param != null) {
- // update the setting tracker
- localValueTracker = true;
- } else {
- localValueTracker = true;
-
- }
-
- this.localValue = param;
-
- }
-
- /**
- * isReaderMTOMAware
- *
- * @return true if the reader supports MTOM
- */
- public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) {
- boolean isReaderMTOMAware = false;
-
- try {
- isReaderMTOMAware = Boolean.TRUE.equals(reader
- .getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE));
- } catch (IllegalArgumentException e) {
- isReaderMTOMAware = false;
- }
- return isReaderMTOMAware;
- }
-
- /**
- *
- * @param parentQName
- * @param factory
- * @return org.apache.axiom.om.OMElement
- */
- public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName,
- final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException {
-
- org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(this, parentQName) {
-
- public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter)
- throws javax.xml.stream.XMLStreamException {
- NameValue.this.serialize(parentQName, factory, xmlWriter);
- }
- };
- return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource);
-
- }
-
- public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory,
- org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter)
- throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException {
- serialize(parentQName, factory, xmlWriter, false);
- }
-
- public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory,
- org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, boolean serializeType)
- throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException {
-
- String prefix = null;
- String namespace = null;
-
- prefix = parentQName.getPrefix();
- namespace = parentQName.getNamespaceURI();
-
- if ((namespace != null) && (namespace.trim().length() > 0)) {
- String writerPrefix = xmlWriter.getPrefix(namespace);
- if (writerPrefix != null) {
- xmlWriter.writeStartElement(namespace, parentQName.getLocalPart());
- } else {
- if (prefix == null) {
- prefix = generatePrefix(namespace);
- }
-
- xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace);
- xmlWriter.writeNamespace(prefix, namespace);
- xmlWriter.setPrefix(prefix, namespace);
- }
- } else {
- xmlWriter.writeStartElement(parentQName.getLocalPart());
- }
-
- if (serializeType) {
-
- String namespacePrefix = registerPrefix(xmlWriter, "http://interpretor.xbaya.airavata.apache.org");
- if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) {
- writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix
- + ":NameValue", xmlWriter);
- } else {
- writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "NameValue", xmlWriter);
- }
-
- }
- if (localNameTracker) {
- namespace = "";
- if (!namespace.equals("")) {
- prefix = xmlWriter.getPrefix(namespace);
-
- if (prefix == null) {
- prefix = generatePrefix(namespace);
-
- xmlWriter.writeStartElement(prefix, "name", namespace);
- xmlWriter.writeNamespace(prefix, namespace);
- xmlWriter.setPrefix(prefix, namespace);
-
- } else {
- xmlWriter.writeStartElement(namespace, "name");
- }
-
- } else {
- xmlWriter.writeStartElement("name");
- }
-
- if (localName == null) {
- // write the nil attribute
-
- writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter);
-
- } else {
-
- xmlWriter.writeCharacters(localName);
-
- }
-
- xmlWriter.writeEndElement();
- }
- if (localValueTracker) {
- namespace = "";
- if (!namespace.equals("")) {
- prefix = xmlWriter.getPrefix(namespace);
-
- if (prefix == null) {
- prefix = generatePrefix(namespace);
-
- xmlWriter.writeStartElement(prefix, "value", namespace);
- xmlWriter.writeNamespace(prefix, namespace);
- xmlWriter.setPrefix(prefix, namespace);
-
- } else {
- xmlWriter.writeStartElement(namespace, "value");
- }
-
- } else {
- xmlWriter.writeStartElement("value");
- }
-
- if (localValue == null) {
- // write the nil attribute
-
- writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter);
-
- } else {
-
- xmlWriter.writeCharacters(localValue);
-
- }
-
- xmlWriter.writeEndElement();
- }
- xmlWriter.writeEndElement();
-
- }
-
- /**
- * Util method to write an attribute with the ns prefix
- */
- private void writeAttribute(String prefix, String namespace, String attName, String attValue,
- javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
- if (xmlWriter.getPrefix(namespace) == null) {
- xmlWriter.writeNamespace(prefix, namespace);
- xmlWriter.setPrefix(prefix, namespace);
-
- }
-
- xmlWriter.writeAttribute(namespace, attName, attValue);
-
- }
-
- /**
- * Util method to write an attribute without the ns prefix
- */
- private void writeAttribute(String namespace, String attName, String attValue,
- javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
- if (namespace.equals("")) {
- xmlWriter.writeAttribute(attName, attValue);
- } else {
- registerPrefix(xmlWriter, namespace);
- xmlWriter.writeAttribute(namespace, attName, attValue);
- }
- }
-
- /**
- * Util method to write an attribute without the ns prefix
- */
- private void writeQNameAttribute(String namespace, String attName, javax.xml.namespace.QName qname,
- javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
-
- String attributeNamespace = qname.getNamespaceURI();
- String attributePrefix = xmlWriter.getPrefix(attributeNamespace);
- if (attributePrefix == null) {
- attributePrefix = registerPrefix(xmlWriter, attributeNamespace);
- }
- String attributeValue;
- if (attributePrefix.trim().length() > 0) {
- attributeValue = attributePrefix + ":" + qname.getLocalPart();
- } else {
- attributeValue = qname.getLocalPart();
- }
-
- if (namespace.equals("")) {
- xmlWriter.writeAttribute(attName, attributeValue);
- } else {
- registerPrefix(xmlWriter, namespace);
- xmlWriter.writeAttribute(namespace, attName, attributeValue);
- }
- }
-
- /**
- * method to handle Qnames
- */
-
- private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter)
- throws javax.xml.stream.XMLStreamException {
- String namespaceURI = qname.getNamespaceURI();
- if (namespaceURI != null) {
- String prefix = xmlWriter.getPrefix(namespaceURI);
- if (prefix == null) {
- prefix = generatePrefix(namespaceURI);
- xmlWriter.writeNamespace(prefix, namespaceURI);
- xmlWriter.setPrefix(prefix, namespaceURI);
- }
-
- if (prefix.trim().length() > 0) {
- xmlWriter.writeCharacters(prefix + ":"
- + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
- } else {
- // i.e this is the default namespace
- xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
- }
-
- } else {
- xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
- }
- }
-
- private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter)
- throws javax.xml.stream.XMLStreamException {
-
- if (qnames != null) {
- // we have to store this data until last moment since it is not
- // possible to write any
- // namespace data after writing the charactor data
- StringBuffer stringToWrite = new StringBuffer();
- String namespaceURI = null;
- String prefix = null;
-
- for (int i = 0; i < qnames.length; i++) {
- if (i > 0) {
- stringToWrite.append(" ");
- }
- namespaceURI = qnames[i].getNamespaceURI();
- if (namespaceURI != null) {
- prefix = xmlWriter.getPrefix(namespaceURI);
- if ((prefix == null) || (prefix.length() == 0)) {
- prefix = generatePrefix(namespaceURI);
- xmlWriter.writeNamespace(prefix, namespaceURI);
- xmlWriter.setPrefix(prefix, namespaceURI);
- }
-
- if (prefix.trim().length() > 0) {
- stringToWrite.append(prefix).append(":")
- .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
- } else {
- stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil
- .convertToString(qnames[i]));
- }
- } else {
- stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
- }
- }
- xmlWriter.writeCharacters(stringToWrite.toString());
- }
-
- }
-
- /**
- * Register a namespace prefix
- */
- private String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, String namespace)
- throws javax.xml.stream.XMLStreamException {
- String prefix = xmlWriter.getPrefix(namespace);
-
- if (prefix == null) {
- prefix = generatePrefix(namespace);
-
- while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) {
- prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
- }
-
- xmlWriter.writeNamespace(prefix, namespace);
- xmlWriter.setPrefix(prefix, namespace);
- }
-
- return prefix;
- }
-
- /**
- * databinding method to get an XML representation of this object
- *
- */
- public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName)
- throws org.apache.axis2.databinding.ADBException {
-
- java.util.ArrayList elementList = new java.util.ArrayList();
- java.util.ArrayList attribList = new java.util.ArrayList();
-
- if (localNameTracker) {
- elementList.add(new javax.xml.namespace.QName("", "name"));
-
- elementList.add(localName == null ? null : org.apache.axis2.databinding.utils.ConverterUtil
- .convertToString(localName));
- }
- if (localValueTracker) {
- elementList.add(new javax.xml.namespace.QName("", "value"));
-
- elementList.add(localValue == null ? null : org.apache.axis2.databinding.utils.ConverterUtil
- .convertToString(localValue));
- }
-
- return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(),
- attribList.toArray());
-
- }
-
- /**
- * Factory class that keeps the parse method
- */
- public static class Factory {
-
- /**
- * static method to create the object Precondition: If this object is an element, the current or next start
- * element starts this object and any intervening reader events are ignorable If this object is not an element,
- * it is a complex type and the reader is at the event just after the outer start element Postcondition: If this
- * object is an element, the reader is positioned at its end element If this object is a complex type, the
- * reader is positioned at the end element of its outer element
- */
- public static NameValue parse(javax.xml.stream.XMLStreamReader reader) throws Exception {
- NameValue object = new NameValue();
-
- String nillableValue = null;
- try {
-
- while (!reader.isStartElement() && !reader.isEndElement())
- reader.next();
-
- if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) {
- String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type");
- if (fullTypeName != null) {
- String nsPrefix = null;
- if (fullTypeName.indexOf(":") > -1) {
- nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":"));
- }
- nsPrefix = nsPrefix == null ? "" : nsPrefix;
-
- String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1);
-
- if (!"NameValue".equals(type)) {
- // find namespace for the prefix
- String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);
- return (NameValue) WorkflowInterpretorStub.ExtensionMapper.getTypeObject(nsUri, type,
- reader);
- }
-
- }
-
- }
-
- new java.util.Vector();
-
- reader.next();
-
- while (!reader.isStartElement() && !reader.isEndElement())
- reader.next();
-
- if (reader.isStartElement() && new javax.xml.namespace.QName("", "name").equals(reader.getName())) {
-
- nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil");
- if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) {
-
- String content = reader.getElementText();
-
- object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
-
- } else {
-
- reader.getElementText(); // throw away text nodes if
- // any.
- }
-
- reader.next();
-
- } // End of if for expected property start element
-
- else {
-
- }
-
- while (!reader.isStartElement() && !reader.isEndElement())
- reader.next();
-
- if (reader.isStartElement() && new javax.xml.namespace.QName("", "value").equals(reader.getName())) {
-
- nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil");
- if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) {
-
- String content = reader.getElementText();
-
- object.setValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
-
- } else {
-
- reader.getElementText(); // throw away text nodes if
- // any.
- }
-
- reader.next();
-
- } // End of if for expected property start element
-
- else {
-
- }
-
- while (!reader.isStartElement() && !reader.isEndElement())
- reader.next();
-
- if (reader.isStartElement())
- // A start element we are not expecting indicates a
- // trailing invalid property
- throw new org.apache.axis2.databinding.ADBException("Unexpected subelement "
- + reader.getLocalName());
-
- } catch (javax.xml.stream.XMLStreamException e) {
- throw new Exception(e);
- }
-
- return object;
- }
-
- }// end of factory class
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/32fff944/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/WorkflowInterpretorCallbackHandler.java
----------------------------------------------------------------------
diff --git a/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/WorkflowInterpretorCallbackHandler.java b/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/WorkflowInterpretorCallbackHandler.java
deleted file mode 100644
index bf0a4ed..0000000
--- a/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/WorkflowInterpretorCallbackHandler.java
+++ /dev/null
@@ -1,72 +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.client.stub.interpretor;
-
-/**
- * WorkflowInterpretorCallbackHandler Callback class, Users can extend this class and implement their own receiveResult
- * and receiveError methods.
- */
-public abstract class WorkflowInterpretorCallbackHandler {
-
- protected Object clientData;
-
- /**
- * User can pass in any object that needs to be accessed once the NonBlocking Web service call is finished and
- * appropriate method of this CallBack is called.
- *
- * @param clientData
- * Object mechanism by which the user can pass in user data that will be avilable at the time this
- * callback is called.
- */
- public WorkflowInterpretorCallbackHandler(Object clientData) {
- this.clientData = clientData;
- }
-
- /**
- * Please use this constructor if you don't want to set any clientData
- */
- public WorkflowInterpretorCallbackHandler() {
- this.clientData = null;
- }
-
- /**
- * Get the client data
- */
-
- public Object getClientData() {
- return clientData;
- }
-
- /**
- * auto generated Axis2 call back method for launchWorkflow method override this method for handling normal response
- * from launchWorkflow operation
- */
- public void receiveResultlaunchWorkflow(java.lang.String result) {
- }
-
- /**
- * auto generated Axis2 Error handler override this method for handling error response from launchWorkflow operation
- */
- public void receiveErrorlaunchWorkflow(java.lang.Exception e) {
- }
-
-}