uk.org.ogsadai.activity.pipeline
Interface ActivityPipeline

All Known Implementing Classes:
SimpleActivityPipeline

public interface ActivityPipeline

An activity pipeline describes a one or more activities that are connected together by their inputs and outputs. In mathematical terms, an activity pipeline is a directed, edge-ordered connected graph.

Author:
The OGSA-DAI Project Team

Method Summary
 void addActivity(ActivityDescriptor descriptor)
          Adds an activity to the pipeline.
 void connect(ActivityDescriptor sourceActivity, java.lang.String outputName, ActivityDescriptor targetActivity, java.lang.String inputName)
          Creates a new connection between two activities.
 boolean containsActivity(ActivityDescriptor activity)
          Determines whether or not the pipeline contains the specified activity descriptor.
 boolean containsActivityInstance(ActivityInstanceName instanceName)
          Indicates whether or not the activity pipeline contains an activity with the specified instance name.
 boolean containsPipe(java.lang.String pipeName)
          Determines whether the activity pipeline contains a pipe with the specified name connecting two activities.
 java.util.Set getActivities()
          Get the set of activities contained in the pipeline.
 ActivityDescriptor getActivityInstance(ActivityInstanceName instanceName)
          Gets the activity descriptor for the activity with the specified instance name, if it is contained in the pipeline.
 Activity getParent()
          Gets the parent activity of this pipeline.
 boolean hasParent()
          Gets whether or not this pipeline has a parent activity.
 void setParent(Activity parentActivity)
          Sets the parent activty of this pipeline.
 

Method Detail

getActivities

java.util.Set getActivities()
Get the set of activities contained in the pipeline.

Returns:
a set of ActivityDescriptor objects

connect

void connect(ActivityDescriptor sourceActivity,
             java.lang.String outputName,
             ActivityDescriptor targetActivity,
             java.lang.String inputName)
Creates a new connection between two activities. If the activities have not already been added to the pipeline, then this operation will add them. The connection is known as a pipe and will be assigned a unique pipe name.

Parameters:
sourceActivity - description of the source activity for the connection
outputName - name of the output of the source activity
targetActivity - description of the target activity for the connection
inputName - name of the input of the target activity

addActivity

void addActivity(ActivityDescriptor descriptor)
Adds an activity to the pipeline.

Parameters:
descriptor - description of the activity to add

getActivityInstance

ActivityDescriptor getActivityInstance(ActivityInstanceName instanceName)
Gets the activity descriptor for the activity with the specified instance name, if it is contained in the pipeline.

Parameters:
instanceName - activity instance name
Returns:
activity descriptor or null if no such activity is contained in the graph

containsActivityInstance

boolean containsActivityInstance(ActivityInstanceName instanceName)
Indicates whether or not the activity pipeline contains an activity with the specified instance name.

Parameters:
instanceName - activity instance name
Returns:
true if so, false otherwise

containsPipe

boolean containsPipe(java.lang.String pipeName)
Determines whether the activity pipeline contains a pipe with the specified name connecting two activities.

Parameters:
pipeName - name of the pipe
Returns:
true if it exists within the graph, false otherwise

containsActivity

boolean containsActivity(ActivityDescriptor activity)
Determines whether or not the pipeline contains the specified activity descriptor.

Parameters:
activity - activity descriptor
Returns:
true if so, false otherwise

setParent

void setParent(Activity parentActivity)
Sets the parent activty of this pipeline. A pipeline will have a parent activity only if it was generated as a sub-workflow executed at run time by an activity.

Parameters:
parentActivity - parent activity.

getParent

Activity getParent()
Gets the parent activity of this pipeline. A pipeline will have a parent activity only if it was generated as a sub-workflow executed at run time by an activity.

Returns:
the parent activity or null if there is no parent activity.

hasParent

boolean hasParent()
Gets whether or not this pipeline has a parent activity. A pipeline will have a parent activity only if it was generated as a sub-workflow executed at run time by an activity.

Returns:
true if the pipeline has a parent activity, false otherwise.