You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2012/07/11 19:53:43 UTC
svn commit: r1360322 - in /incubator/airavata/trunk/modules:
airavata-client/src/main/java/org/apache/airavata/client/api/
airavata-client/src/main/java/org/apache/airavata/client/impl/
commons/registry-api/src/main/java/org/apache/airavata/registry/ap...
Author: samindaw
Date: Wed Jul 11 17:53:43 2012
New Revision: 1360322
URL: http://svn.apache.org/viewvc?rev=1360322&view=rev
Log:
updating the API to save/get the workflow instance name
Added:
incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceName.java
Modified:
incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
Modified: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java?rev=1360322&r1=1360321&r2=1360322&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java (original)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java Wed Jul 11 17:53:43 2012
@@ -27,6 +27,7 @@ import java.util.Map;
import org.apache.airavata.registry.api.workflow.WorkflowInstance;
import org.apache.airavata.registry.api.workflow.WorkflowInstanceData;
import org.apache.airavata.registry.api.workflow.WorkflowInstanceMetadata;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceName;
import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodePortData;
import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
@@ -207,7 +208,7 @@ public interface ProvenanceManager {
* @throws AiravataAPIInvocationException
*/
public void setWorkflowInstanceMetadata(WorkflowInstanceMetadata instanceMetadata) throws AiravataAPIInvocationException;
-
+
/**
* Retrieve the metadata of the Workflow instance
* @param experimentId
@@ -225,6 +226,39 @@ public interface ProvenanceManager {
*/
public WorkflowInstanceMetadata getWorkflowInstanceMetadata(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
+ /**
+ * Update the instance name of the Workflow
+ * @param experimentId
+ * @param workflowInstanceId
+ * @param instanceName
+ * @throws AiravataAPIInvocationException
+ */
+ public void setWorkflowInstanceName(String experimentId, String workflowInstanceId, String instanceName) throws AiravataAPIInvocationException;
+
+ /**
+ * Update the instance name of the Workflow
+ * @param instanceName
+ * @throws AiravataAPIInvocationException
+ */
+ public void setWorkflowInstanceName(WorkflowInstanceName instanceName) throws AiravataAPIInvocationException;
+
+ /**
+ * Retrieve the metadata of the Workflow instance
+ * @param experimentId
+ * @param workflowInstanceId
+ * @return
+ * @throws AiravataAPIInvocationException
+ */
+ public WorkflowInstanceName getWorkflowInstanceName(String experimentId, String workflowInstanceId) throws AiravataAPIInvocationException;
+
+ /**
+ * Retrieve the metadata of the Workflow instance
+ * @param workflowInstance
+ * @return
+ * @throws AiravataAPIInvocationException
+ */
+ public WorkflowInstanceName getWorkflowInstanceName(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
+
/**
* Retrieve the id's of all the experiments run by the given owner
* @param owner
Modified: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java?rev=1360322&r1=1360321&r2=1360322&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java (original)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java Wed Jul 11 17:53:43 2012
@@ -34,6 +34,7 @@ import org.apache.airavata.registry.api.
import org.apache.airavata.registry.api.workflow.WorkflowInstance;
import org.apache.airavata.registry.api.workflow.WorkflowInstanceData;
import org.apache.airavata.registry.api.workflow.WorkflowInstanceMetadata;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceName;
import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodeData;
import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodePortData;
@@ -332,7 +333,7 @@ public class ProvenanceManagerImpl imple
private WorkflowInstanceData createWorkflowInstanceData(
WorkflowExecution execution) {
WorkflowInstance workflowInstance = new WorkflowInstance(execution.getExperimentId(),execution.getTopic());
- WorkflowInstanceData workflowInstanceData = new WorkflowInstanceData(workflowInstance, new WorkflowInstanceUser(workflowInstance,execution.getUser()), new WorkflowInstanceStatus(workflowInstance,execution.getExecutionStatus().getExecutionStatus(),execution.getExecutionStatus().getStatusUpdateTime()), new WorkflowInstanceMetadata(workflowInstance,execution.getMetadata()), null);
+ WorkflowInstanceData workflowInstanceData = new WorkflowInstanceData(workflowInstance, new WorkflowInstanceName(workflowInstance, execution.getWorkflowInstanceName()),new WorkflowInstanceUser(workflowInstance,execution.getUser()), new WorkflowInstanceStatus(workflowInstance,execution.getExecutionStatus().getExecutionStatus(),execution.getExecutionStatus().getStatusUpdateTime()), new WorkflowInstanceMetadata(workflowInstance,execution.getMetadata()), null);
Map<WorkflowInstanceNode, List<WorkflowInstanceNodePortData>> groupNodePortInputData = groupNodePortData(execution.getServiceInput());
Map<WorkflowInstanceNode, List<WorkflowInstanceNodePortData>> groupNodePortOutputData = groupNodePortData(execution.getServiceOutput());
for (WorkflowInstanceNode instanceNode : groupNodePortInputData.keySet()) {
@@ -379,5 +380,39 @@ public class ProvenanceManagerImpl imple
this.client = client;
}
+ @Override
+ public void setWorkflowInstanceName(String experimentId,
+ String workflowInstanceId, String instanceName)
+ throws AiravataAPIInvocationException {
+ try {
+ getClient().getRegistry().saveWorkflowExecutionName(experimentId, instanceName);
+ } catch (RegistryException e) {
+ throw new AiravataAPIInvocationException(e);
+ }
+ }
+
+ @Override
+ public void setWorkflowInstanceName(WorkflowInstanceName instanceName)
+ throws AiravataAPIInvocationException {
+ setWorkflowInstanceName(instanceName.getWorkflowInstance().getExperimentId(),instanceName.getWorkflowInstance().getWorkflowInstanceId(),instanceName.getInstanceName());
+ }
+
+ @Override
+ public WorkflowInstanceName getWorkflowInstanceName(String experimentId,
+ String workflowInstanceId) throws AiravataAPIInvocationException {
+ return getWorkflowInstanceName(new WorkflowInstance(experimentId, workflowInstanceId));
+ }
+
+ @Override
+ public WorkflowInstanceName getWorkflowInstanceName(
+ WorkflowInstance workflowInstance)
+ throws AiravataAPIInvocationException {
+ try {
+ return new WorkflowInstanceName(workflowInstance, getClient().getRegistry().getWorkflowExecutionName(workflowInstance.getExperimentId()));
+ } catch (RegistryException e) {
+ throw new AiravataAPIInvocationException(e);
+ }
+ }
+
}
Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java?rev=1360322&r1=1360321&r2=1360322&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java Wed Jul 11 17:53:43 2012
@@ -33,14 +33,16 @@ public class WorkflowInstanceData {
private WorkflowInstanceUser workflowInstanceUser;
private WorkflowInstanceStatus workflowInstanceStatus;
private WorkflowInstanceMetadata workflowInstanceMetadata;
+ private WorkflowInstanceName workflowInstanceName;
private List<WorkflowInstanceNodeData> nodeDataList;
- public WorkflowInstanceData(WorkflowInstance workflowInstance,WorkflowInstanceUser workflowInstanceUser,WorkflowInstanceStatus workflowInstanceStatus,WorkflowInstanceMetadata workflowInstanceMetadata,List<WorkflowInstanceNodeData> nodeDataList) {
+ public WorkflowInstanceData(WorkflowInstance workflowInstance,WorkflowInstanceName workflowInstanceName,WorkflowInstanceUser workflowInstanceUser,WorkflowInstanceStatus workflowInstanceStatus,WorkflowInstanceMetadata workflowInstanceMetadata,List<WorkflowInstanceNodeData> nodeDataList) {
this.workflowInstance=workflowInstance;
this.workflowInstanceUser=workflowInstanceUser;
this.workflowInstanceStatus=workflowInstanceStatus;
this.workflowInstanceMetadata=workflowInstanceMetadata;
+ this.workflowInstanceName=workflowInstanceName;
this.nodeDataList=nodeDataList;
}
@@ -101,4 +103,9 @@ public class WorkflowInstanceData {
//TODO
return null;
}
+
+ public WorkflowInstanceName getWorkflowInstanceName() {
+ return workflowInstanceName;
+ }
+
}
Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceName.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceName.java?rev=1360322&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceName.java (added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceName.java Wed Jul 11 17:53:43 2012
@@ -0,0 +1,49 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.registry.api.workflow;
+
+public class WorkflowInstanceName {
+ private WorkflowInstance workflowInstance;
+ private String instanceName;
+
+ public WorkflowInstanceName(WorkflowInstance workflowInstance, String instanceName) {
+ setWorkflowInstance(workflowInstance);
+ setInstanceName(instanceName);
+ }
+
+ public WorkflowInstance getWorkflowInstance() {
+ return workflowInstance;
+ }
+
+ public void setWorkflowInstance(WorkflowInstance workflowInstance) {
+ this.workflowInstance = workflowInstance;
+ }
+
+ public String getInstanceName() {
+ return instanceName;
+ }
+
+ public void setInstanceName(String instanceName) {
+ this.instanceName = instanceName;
+ }
+
+}