uk.org.ogsadai.client.toolkit.activities.management
Class BaseCreateDataX

java.lang.Object
  extended by uk.org.ogsadai.client.toolkit.activity.BaseActivity
      extended by uk.org.ogsadai.client.toolkit.activities.management.BaseCreateDataX
All Implemented Interfaces:
Activity, RequestAndStatusHandler
Direct Known Subclasses:
CreateDataSink, CreateDataSource

public abstract class BaseCreateDataX
extends BaseActivity

Abstract base class for for activities the data sink and data source creation activities.

Author:
The OGSA-DAI Project Team

Field Summary
static java.lang.String OUTPUT
          Result output name
static java.lang.String RESOURCE_ID_INPUT
          ResourceID input name
 
Constructor Summary
BaseCreateDataX(ActivityName defaultActivityName)
          Constructor.
 
Method Summary
 void addResourceId(ResourceID resourceID)
          Adds a resource ID.
 void connectResourceIdInput(SingleActivityOutput output)
          Connects the resource ID input to the given output.
protected  ActivityInput[] getInputs()
          Gets the inputs associated with the activity.
protected  ActivityOutput[] getOutputs()
          Gets the outputs associated with the activity.
 SingleActivityOutput getResultOutput()
          Gets the activity's output.
 boolean hasNextResult()
          Gets whether or not there are any unread output values.
 ResourceID nextResult()
          Gets the next resource ID from the output.
protected  void validateIOState()
          Validates the state of the activity inputs and outputs.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.BaseActivity
buildRequest, getActivityName, getConnectedOutputs, getErrorMessages, getInputDescriptors, getInstanceName, getRequestAndStatusHandler, getServer, getStatus, getWarnings, hasErrorMessages, hasWarnings, processRequestStatus, setActivityName, setServer, toString, validateState, writeToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE_ID_INPUT

public static final java.lang.String RESOURCE_ID_INPUT
ResourceID input name

See Also:
Constant Field Values

OUTPUT

public static final java.lang.String OUTPUT
Result output name

See Also:
Constant Field Values
Constructor Detail

BaseCreateDataX

public BaseCreateDataX(ActivityName defaultActivityName)
Constructor.

Parameters:
defaultActivityName - default activity name.
Method Detail

addResourceId

public void addResourceId(ResourceID resourceID)
Adds a resource ID. The activity will attempt to create a data sink resource with this ID.

If no resource IDs are added then the activity will create a single data sink resource with a server generated resource ID.

Parameters:
resourceID - resource ID.

connectResourceIdInput

public void connectResourceIdInput(SingleActivityOutput output)
Connects the resource ID input to the given output.

Parameters:
output - output to connect the input to.

getResultOutput

public SingleActivityOutput getResultOutput()
Gets the activity's output.

Returns:
the activity's output.

hasNextResult

public boolean hasNextResult()
                      throws DataStreamErrorException,
                             UnexpectedDataValueException,
                             DataSourceUsageException
Gets whether or not there are any unread output values.

Returns:
true if there are unread output value, false if there are none.
Throws:
DataStreamErrorException - if there is an error on the data stream.
UnexpectedDataValueException - if there is an unexpected data value on the data stream.
DataSourceUsageException - if there is an error reading from a data source.

nextResult

public ResourceID nextResult()
                      throws DataStreamErrorException,
                             UnexpectedDataValueException,
                             DataSourceUsageException
Gets the next resource ID from the output.

Returns:
resource ID.
Throws:
DataStreamErrorException - if there is an error on the data stream.
UnexpectedDataValueException - if there is an unexpected data value on the data stream.
DataSourceUsageException - if there is an error reading from a data source.

validateIOState

protected void validateIOState()
                        throws ActivityIOIllegalStateException
Description copied from class: BaseActivity
Validates the state of the activity inputs and outputs.

Specified by:
validateIOState in class BaseActivity
Throws:
ActivityIOIllegalStateException - if an activity input is not in a valid state.

getInputs

protected ActivityInput[] getInputs()
Description copied from class: BaseActivity
Gets the inputs associated with the activity. All the inputs including not operational optional inputs will be returned.

Specified by:
getInputs in class BaseActivity
Returns:
the inputs associated with the activity.

getOutputs

protected ActivityOutput[] getOutputs()
Description copied from class: BaseActivity
Gets the outputs associated with the activity. All the outputs including unconnected optional outputs will be returned.

Specified by:
getOutputs in class BaseActivity
Returns:
the outputs associated with the activity.