uk.org.ogsadai.client.toolkit.activity.misc
Class Notification

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
              |
              +--uk.org.ogsadai.client.toolkit.activity.misc.Notification

public class Notification
extends Activity

This activity generates a notification message upon commencement or completion of processing of a perform document. It can be chained between two activities, such as an SQLQuery and an OutputStream, in order to produce a notification message. The data flowing between the two activities is unchanged and the message is available on a separate output, which can be connected to another activity, such as a DeliverToSMTP (which would deliver the notification message as an email).

It has one input and two outputs.

Author:
The OGSA-DAI Project Team

Constructor Summary
Notification(ActivityOutput input)
          Constructs an activity to generate a notification upon commencement or completion of processing of the perform document.
Notification(ActivityOutput input, NotificationType type, java.lang.String message)
          Constructs an activity to generate a notification upon commencement or completion of processing of the perform document.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 ActivityOutput getDataOutput()
          Gets the activity's output for the data flowing through it.
 ActivityOutput getNotificationOutput()
          Gets the activity's output for the notification message.
 void setDataInput(ActivityOutput input)
          Sets the name of the output that will provide the input to this activity.
 void setNotificationMessage(java.lang.String message)
          Sets the message that will be sent to the notification output of this activity.
 void setNotificationType(NotificationType type)
          Sets the notification type.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
addInput, addOutput, addOutputs, getDataResourceID, getDataServiceStub, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setDataServiceStub, setInput
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Notification

public Notification(ActivityOutput input)
Constructs an activity to generate a notification upon commencement or completion of processing of the perform document. Sets the notification type to be NotificationType.NONE and the notification message to be "none".

Parameters:
input - output from another activity

Notification

public Notification(ActivityOutput input,
                    NotificationType type,
                    java.lang.String message)
Constructs an activity to generate a notification upon commencement or completion of processing of the perform document.

Parameters:
input - output from another activity
type - the type of notification to do - either on commencement of processing, completion of processing or none.
message - message to send to the notification output.
Throws:
java.lang.IllegalArgumentException - if any arguments are null
Method Detail

setNotificationMessage

public void setNotificationMessage(java.lang.String message)
Sets the message that will be sent to the notification output of this activity.

Parameters:
message - message to send to the notification output.
Throws:
java.lang.IllegalArgumentException - if the argument is null

setNotificationType

public void setNotificationType(NotificationType type)
Sets the notification type.

Parameters:
type - notification type.
Throws:
java.lang.IllegalArgumentException - if the argument is null

getDataOutput

public ActivityOutput getDataOutput()
Gets the activity's output for the data flowing through it.

Returns:
the data output

getNotificationOutput

public ActivityOutput getNotificationOutput()
Gets the activity's output for the notification message.

Returns:
the notification output

setDataInput

public final void setDataInput(ActivityOutput input)
Sets the name of the output that will provide the input to this activity.

Parameters:
input - output from another activity
Throws:
java.lang.IllegalArgumentException - if the argument is null

generateXML

protected java.lang.String generateXML()
Description copied from class: RequestComponent
Generates the XML representing the activity. This XML can then be inserted into a perform document that is sent to a data service.

Specified by:
generateXML in class Activity
Returns:
the XML for the activity
See Also:
Activity.generateXML()