uk.org.ogsadai.client.toolkit.activities.delivery
Class DeliverToSMTP

java.lang.Object
  extended by uk.org.ogsadai.client.toolkit.activity.BaseActivity
      extended by uk.org.ogsadai.client.toolkit.activities.delivery.DeliverToSMTP
All Implemented Interfaces:
Activity, RequestAndStatusHandler

public class DeliverToSMTP
extends BaseActivity
implements Activity

An activity that delivers data as e-mails sent via an SMTP server.

Activity inputs:

Activity outputs: none.

Expected name of activity on server:

Activity input/output ordering:

Activity contracts: none.

Target data resource: none.

Behaviour:

Author:
The OGSA-DAI Project Team.

Field Summary
static int BLOCK_SIZE
          Block size for sending the blocks.
static ActivityName DEFAULT_ACTIVITY_NAME
          Default activity name.
static java.lang.String INPUT_DATA
          Activity output name - the data to delivered through SMTP.
static java.lang.String INPUT_FROM
          Activity input name - from.
static java.lang.String INPUT_SUBJECT
          Activity input name - subject.
static java.lang.String INPUT_TO
          Activity input name - to.
 
Constructor Summary
DeliverToSMTP()
          Constructor.
 
Method Summary
 void addData(java.io.Reader data)
          Add data to the corresponding input.
 void addFrom(java.lang.String from)
          Adds the sender to the corresponding input.
 void addSubject(java.lang.String subject)
          Adds subject to the corresponding input.
 void addTo(java.util.Iterator to)
          Add the recipient(s) to the corresponding input.
 void addTo(java.lang.String[] to)
          Add the recipient(s) to the corresponding input.
 void connectDataInput(SingleActivityOutput output)
          Connects the input to the given output.
 void connectFromInput(SingleActivityOutput output)
          Connects the input to the given output.
 void connectSubjectInput(SingleActivityOutput output)
          Connects the input to the given output.
 void connectToInput(SingleActivityOutput output)
          Connects the 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.
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
 
Methods inherited from interface uk.org.ogsadai.client.toolkit.Activity
getActivityName, getErrorMessages, getInstanceName, getRequestAndStatusHandler, getStatus, getWarnings, hasErrorMessages, hasWarnings, setActivityName
 

Field Detail

DEFAULT_ACTIVITY_NAME

public static final ActivityName DEFAULT_ACTIVITY_NAME
Default activity name.


INPUT_TO

public static final java.lang.String INPUT_TO
Activity input name - to.

See Also:
Constant Field Values

INPUT_FROM

public static final java.lang.String INPUT_FROM
Activity input name - from.

See Also:
Constant Field Values

INPUT_SUBJECT

public static final java.lang.String INPUT_SUBJECT
Activity input name - subject.

See Also:
Constant Field Values

INPUT_DATA

public static final java.lang.String INPUT_DATA
Activity output name - the data to delivered through SMTP.

See Also:
Constant Field Values

BLOCK_SIZE

public static final int BLOCK_SIZE
Block size for sending the blocks.

See Also:
Constant Field Values
Constructor Detail

DeliverToSMTP

public DeliverToSMTP()
Constructor.

Method Detail

addTo

public void addTo(java.util.Iterator to)
Add the recipient(s) to the corresponding input.

Parameters:
to - the recipient(s) to add.

addTo

public void addTo(java.lang.String[] to)
Add the recipient(s) to the corresponding input.

Parameters:
to - the recipient(s) to add.

addFrom

public void addFrom(java.lang.String from)
Adds the sender to the corresponding input.

Parameters:
from - sender to add.

addSubject

public void addSubject(java.lang.String subject)
Adds subject to the corresponding input.

Parameters:
subject - subject to add.

addData

public void addData(java.io.Reader data)
             throws java.io.IOException
Add data to the corresponding input.

Parameters:
data - data to be delivered
Throws:
java.io.IOException - in case an exception is encountered while reading from the Reader.

connectToInput

public void connectToInput(SingleActivityOutput output)
Connects the input to the given output.

Parameters:
output - output to connect to.

connectFromInput

public void connectFromInput(SingleActivityOutput output)
Connects the input to the given output.

Parameters:
output - output to connect to.

connectSubjectInput

public void connectSubjectInput(SingleActivityOutput output)
Connects the input to the given output.

Parameters:
output - output to connect to.

connectDataInput

public void connectDataInput(SingleActivityOutput output)
Connects the input to the given output.

Parameters:
output - output to connect to.

validateIOState

protected void validateIOState()
                        throws ActivityIOIllegalStateException
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()
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()
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.