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/09 17:10:38 UTC

svn commit: r1359212 - in /incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client: AiravataClientUtils.java api/ApplicationManager.java api/ExecutionManager.java api/ProvenanceManager.java

Author: samindaw
Date: Mon Jul  9 15:10:38 2012
New Revision: 1359212

URL: http://svn.apache.org/viewvc?rev=1359212&view=rev
Log:
adding comments & overloading getAPI function to allow backward compatibility

Modified:
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClientUtils.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java

Modified: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClientUtils.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClientUtils.java?rev=1359212&r1=1359211&r2=1359212&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClientUtils.java (original)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClientUtils.java Mon Jul  9 15:10:38 2012
@@ -21,8 +21,10 @@
 
 package org.apache.airavata.client;
 
+import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URI;
+import java.util.Map;
 
 import javax.jcr.RepositoryException;
 
@@ -39,4 +41,14 @@ public class AiravataClientUtils {
 		apiObj.setCurrentUser(alternateUsername);
 		return apiObj;
 	}
+	
+	public static AiravataAPI getAPI(Map<String,String> configuration) throws MalformedURLException{
+		AiravataClient apiObj = new AiravataClient(configuration);
+		return apiObj;
+	}
+	
+	public static AiravataAPI getAPI(String filename) throws MalformedURLException, RegistryException, IOException{
+		AiravataClient apiObj = new AiravataClient(filename);
+		return apiObj;
+	}
 }

Modified: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java?rev=1359212&r1=1359211&r2=1359212&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java (original)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java Mon Jul  9 15:10:38 2012
@@ -32,22 +32,22 @@ public interface ApplicationManager {
 	//Service descriptors
 
     /**
-     *
-     * @param serviceId
+     * Retrieve registered service description of the given service name 
+     * @param serviceName
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public ServiceDescription getServiceDescription(String serviceId) throws AiravataAPIInvocationException;
+	public ServiceDescription getServiceDescription(String serviceName) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve all registered service descriptions
      * @return
      * @throws AiravataAPIInvocationException
      */
     public List<ServiceDescription> getAllServiceDescriptions() throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Save service description on registry
      * @param service
      * @return
      * @throws AiravataAPIInvocationException
@@ -55,14 +55,14 @@ public interface ApplicationManager {
     public String saveServiceDescription(ServiceDescription service)throws AiravataAPIInvocationException;
 
     /**
-     *
-     * @param serviceId
+     * Delete service description from the registry
+     * @param serviceName
      * @throws AiravataAPIInvocationException
      */
-    public void deleteServiceDescription(String serviceId) throws AiravataAPIInvocationException;
+    public void deleteServiceDescription(String serviceName) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve a list of registered service descriptions of the given regex service name
      * @param nameRegEx
      * @return
      * @throws AiravataAPIInvocationException
@@ -72,16 +72,16 @@ public interface ApplicationManager {
     //Application descriptors
 
     /**
-     *
-     * @param serviceId
-     * @param hostId
+     * Retrieve registered application description of the given service name & hostName
+     * @param serviceName
+     * @param hostName
      * @return
      * @throws AiravataAPIInvocationException
      */
-    public ApplicationDeploymentDescription getDeploymentDescription(String serviceId, String hostId)throws AiravataAPIInvocationException;
+    public ApplicationDeploymentDescription getDeploymentDescription(String serviceName, String hostName)throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Save deployment description on registry for a given service for a host
      * @param serviceId
      * @param hostId
      * @param app
@@ -91,7 +91,7 @@ public interface ApplicationManager {
     public String saveDeploymentDescription(String serviceId, String hostId, ApplicationDeploymentDescription app)throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve list of registered deployment descriptions of the given regex service name & regex host name
      * @param serviceName
      * @param hostName
      * @return
@@ -100,14 +100,14 @@ public interface ApplicationManager {
     public List<ApplicationDeploymentDescription> searchDeploymentDescription(String serviceName, String hostName)throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve all registered deployment descriptions
      * @return
      * @throws AiravataAPIInvocationException
      */
     public Map<ApplicationDeploymentDescription, String> getAllDeploymentDescriptions() throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve list of registered deployment descriptions of the given regex service name, regex host name & regex application name 
      * @param serviceName
      * @param hostName
      * @param applicationName
@@ -117,7 +117,7 @@ public interface ApplicationManager {
     public List<ApplicationDeploymentDescription> searchDeploymentDescription(String serviceName, String hostName,String applicationName) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve registered map of deployment descriptions for their host description of the given service name
      * @param serviceName
      * @return
      * @throws AiravataAPIInvocationException
@@ -125,7 +125,7 @@ public interface ApplicationManager {
     public Map<HostDescription, List<ApplicationDeploymentDescription>> searchDeploymentDescription(String serviceName)throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Delete deployment description from the registry which is exposed as the service name in the host name 
      * @param serviceName
      * @param hostName
      * @param applicationName
@@ -136,22 +136,22 @@ public interface ApplicationManager {
     //Host descriptors
 
     /**
-     *
-     * @param hostId
+     * Retrieve registered host description of the given host name
+     * @param hostName
      * @return
      * @throws AiravataAPIInvocationException
      */
-    public HostDescription getHostDescription(String hostId) throws AiravataAPIInvocationException;
+    public HostDescription getHostDescription(String hostName) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve all registered host descriptions
      * @return
      * @throws AiravataAPIInvocationException
      */
     public List<HostDescription> getAllHostDescriptions() throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Save host description on registry
      * @param host
      * @return
      * @throws AiravataAPIInvocationException
@@ -159,7 +159,7 @@ public interface ApplicationManager {
     public String saveHostDescription(HostDescription host)throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve a list of registered hsot descriptions of the given regex host name
      * @param regExName
      * @return
      * @throws AiravataAPIInvocationException
@@ -167,14 +167,14 @@ public interface ApplicationManager {
     public List<HostDescription> searchHostDescription(String regExName) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Delete host description from the registry
      * @param hostId
      * @throws AiravataAPIInvocationException
      */
     public void deleteHostDescription(String hostId) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Map services to possible hosts 
      * @param serviceName
      * @param hostName
      * @return

Modified: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java?rev=1359212&r1=1359211&r2=1359212&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java (original)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java Mon Jul  9 15:10:38 2012
@@ -31,7 +31,7 @@ import org.apache.airavata.xbaya.monitor
 
 public interface ExecutionManager {
     /**
-     *
+     * Run an experiment containing single workflow 
      * @param workflowTemplateId
      * @param inputs
      * @return
@@ -40,7 +40,7 @@ public interface ExecutionManager {
 	public abstract String runExperiment(String workflowTemplateId,List<WorkflowInput> inputs) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Run an experiment containing single workflow
      * @param workflow
      * @param inputs
      * @return
@@ -49,7 +49,7 @@ public interface ExecutionManager {
 	public abstract String runExperiment(Workflow workflow,List<WorkflowInput> inputs) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Run an experiment containing single workflow
      * @param workflowTemplateId
      * @param inputs
      * @param user
@@ -61,7 +61,7 @@ public interface ExecutionManager {
 	public abstract String runExperiment(String workflowTemplateId,List<WorkflowInput> inputs, String user, String metadata, String workflowInstanceName)throws AiravataAPIInvocationException;
 
 	/**
-	 * 
+	 * Run an experiment containing single workflow
 	 * @param workflowTemplateId
 	 * @param inputs
 	 * @param user
@@ -74,7 +74,7 @@ public interface ExecutionManager {
 	public abstract String runExperiment(String workflowTemplateId,List<WorkflowInput> inputs, String user, String metadata, String workflowInstanceName, WorkflowContextHeaderBuilder builder)throws AiravataAPIInvocationException;
 	
     /**
-     *
+     * Run an experiment containing single workflow
      * @param workflow
      * @param inputs
      * @param user
@@ -85,7 +85,7 @@ public interface ExecutionManager {
 	public abstract String runExperiment(Workflow workflow,List<WorkflowInput> inputs, String user, String metadata)throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Get a monitor for a running experiment
      * @param experimentId
      * @return
      * @throws AiravataAPIInvocationException
@@ -93,7 +93,7 @@ public interface ExecutionManager {
 	public Monitor getExperimentMonitor(String experimentId)throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Get a monitor for a running experiment
      * @param experimentId
      * @param listener
      * @return

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=1359212&r1=1359211&r2=1359212&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 Mon Jul  9 15:10:38 2012
@@ -39,14 +39,14 @@ import org.apache.airavata.registry.api.
 public interface ProvenanceManager {
 
     /**
-     *
+     * Add input port data for a node in a running instance of a Workflow 
      * @param data
      * @throws AiravataAPIInvocationException
      */
 	public void addWorkflowInstanceNodeInputData(WorkflowInstanceNodePortData data) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Add input port data for a node in a running instance of a Workflow
      * @param experimentId
      * @param workflowInstanceId
      * @param nodeId
@@ -56,14 +56,14 @@ public interface ProvenanceManager {
 	public void addWorkflowInstanceNodeInputData(String experimentId, String workflowInstanceId, String nodeId, String data) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Add output port data for a node in a running instance of a Workflow
      * @param data
      * @throws AiravataAPIInvocationException
      */
 	public void addWorkflowInstanceNodeOutputData(WorkflowInstanceNodePortData data) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Add output port data for a node in a running instance of a Workflow
      * @param experimentId
      * @param workflowInstanceId
      * @param nodeId
@@ -73,7 +73,7 @@ public interface ProvenanceManager {
 	public void addWorkflowInstanceNodeOutputData(String experimentId, String workflowInstanceId, String nodeId, String data) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Get data of input ports of a node in a running instance of a Workflow
      * @param node
      * @return
      * @throws AiravataAPIInvocationException
@@ -81,7 +81,7 @@ public interface ProvenanceManager {
 	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeInputData(WorkflowInstanceNode node) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Get data of input ports of a node in a running instance of a Workflow
      * @param experimentId
      * @param workflowInstanceId
      * @param nodeId
@@ -91,7 +91,7 @@ public interface ProvenanceManager {
 	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeInputData(String experimentId, String workflowInstanceId, String nodeId) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Get data of input ports of a node in all the running instance of a particular Workflow template
      * @param workflowTemplateId
      * @param nodeId
      * @return
@@ -100,7 +100,7 @@ public interface ProvenanceManager {
 	public Map<WorkflowInstanceNode,List<WorkflowInstanceNodePortData>> getWorkflowInstanceNodeInputData(String workflowTemplateId, String nodeId) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Get data of output ports of a node in a running instance of a Workflow
      * @param node
      * @return
      * @throws AiravataAPIInvocationException
@@ -108,7 +108,7 @@ public interface ProvenanceManager {
 	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeOutputData(WorkflowInstanceNode node) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Get data of output ports of a node in a running instance of a Workflow
      * @param experimentId
      * @param workflowInstanceId
      * @param nodeId
@@ -118,7 +118,7 @@ public interface ProvenanceManager {
 	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeOutputData(String experimentId, String workflowInstanceId, String nodeId) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Get data of output ports of a node in all the running instance of a particular Workflow template
      * @param workflowName
      * @param nodeId
      * @return
@@ -127,7 +127,7 @@ public interface ProvenanceManager {
 	public Map<WorkflowInstanceNode,List<WorkflowInstanceNodePortData>> getWorkflowInstanceNodeOutputData(String workflowName, String nodeId) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Update the status of the Workflow instance
      * @param experimentId
      * @param workflowInstanceId
      * @param status
@@ -136,14 +136,14 @@ public interface ProvenanceManager {
 	public void setWorkflowInstanceStatus(String experimentId, String workflowInstanceId, ExecutionStatus status) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Update the status of the Workflow instance
      * @param status
      * @throws AiravataAPIInvocationException
      */
 	public void setWorkflowInstanceStatus(WorkflowInstanceStatus status) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve the status of the Workflow instance
      * @param experimentId
      * @param workflowInstanceId
      * @return
@@ -152,7 +152,7 @@ public interface ProvenanceManager {
 	public WorkflowInstanceStatus getWorkflowInstanceStatus(String experimentId, String workflowInstanceId) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve the status of the Workflow instance
      * @param workflowInstance
      * @return
      * @throws AiravataAPIInvocationException
@@ -160,7 +160,7 @@ public interface ProvenanceManager {
 	public WorkflowInstanceStatus getWorkflowInstanceStatus(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Update the User of the Workflow instance
      * @param experimentId
      * @param workflowInstanceId
      * @param user
@@ -169,14 +169,14 @@ public interface ProvenanceManager {
 	public void setWorkflowInstanceUser(String experimentId, String workflowInstanceId, String user) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Update the User of the Workflow instance
      * @param user
      * @throws AiravataAPIInvocationException
      */
 	public void setWorkflowInstanceUser(WorkflowInstanceUser user) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve the User of the Workflow instance
      * @param experimentId
      * @param workflowInstanceId
      * @return
@@ -185,7 +185,7 @@ public interface ProvenanceManager {
 	public WorkflowInstanceUser getWorkflowInstanceUser(String experimentId, String workflowInstanceId) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve the User of the Workflow instance
      * @param workflowInstance
      * @return
      * @throws AiravataAPIInvocationException
@@ -193,7 +193,7 @@ public interface ProvenanceManager {
 	public WorkflowInstanceUser getWorkflowInstanceUser(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Update the metadata of the Workflow instance
      * @param experimentId
      * @param workflowInstanceId
      * @param metadata
@@ -202,14 +202,14 @@ public interface ProvenanceManager {
 	public void setWorkflowInstanceMetadata(String experimentId, String workflowInstanceId, String metadata) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Update the metadata of the Workflow instance
      * @param instanceMetadata
      * @throws AiravataAPIInvocationException
      */
 	public void setWorkflowInstanceMetadata(WorkflowInstanceMetadata instanceMetadata) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve the metadata of the Workflow instance
      * @param experimentId
      * @param workflowInstanceId
      * @return
@@ -218,7 +218,7 @@ public interface ProvenanceManager {
 	public WorkflowInstanceMetadata getWorkflowInstanceMetadata(String experimentId, String workflowInstanceId) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve the metadata of the Workflow instance
      * @param workflowInstance
      * @return
      * @throws AiravataAPIInvocationException
@@ -226,7 +226,7 @@ public interface ProvenanceManager {
 	public WorkflowInstanceMetadata getWorkflowInstanceMetadata(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve the id's of all the experiments run by the given owner  
      * @param owner
      * @return
      * @throws AiravataAPIInvocationException
@@ -234,21 +234,21 @@ public interface ProvenanceManager {
 	public List<String> getExperiments(String owner) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve the id's of all the experiments run by the current user
      * @return
      * @throws AiravataAPIInvocationException
      */
 	public List<String> getExperiments() throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve all the experiments run by the current user
      * @return
      * @throws AiravataAPIInvocationException
      */
 	public List<WorkflowInstance> getWorkflowInstances() throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve all the experiments run by the given owner
      * @param user
      * @return
      * @throws AiravataAPIInvocationException
@@ -256,7 +256,7 @@ public interface ProvenanceManager {
 	public List<WorkflowInstance> getWorkflowInstances(String user) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve all the experiment data run by the given owner with paging
      * @param user
      * @param pageSize
      * @param pageNo
@@ -266,7 +266,7 @@ public interface ProvenanceManager {
 	public List<WorkflowInstanceData> getWorkflowInstances(String user, int pageSize, int pageNo) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve experiment data for a given workflow instance
      * @param experimentId
      * @param workflowInstanceId
      * @return
@@ -275,7 +275,7 @@ public interface ProvenanceManager {
 	public WorkflowInstanceData getWorkflowInstanceData(String experimentId, String workflowInstanceId) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve experiment data for a given workflow instance
      * @param workflowInstance
      * @return
      * @throws AiravataAPIInvocationException
@@ -283,7 +283,7 @@ public interface ProvenanceManager {
 	public WorkflowInstanceData getWorkflowInstanceData(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
 
     /**
-     *
+     * Retrieve output node names of a experiment
      * @param experimentId
      * @return
      * @throws AiravataAPIInvocationException