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 SQL query and an output stream, 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 delivery activity (e.g. a deliver to SMTP activity could be used which would deliver the notification message as an email).

It has one input and two outputs - one is the data received as input into the activity and the other is the notification message.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private static int DATA_INPUT_INDEX
          Index of data input parameter.
private static int DATA_OUTPUT_INDEX
          Index of data output parameter.
private  java.lang.String mNotificationMessage
          Notification message - default is none
private  NotificationType mNotificationType
          Notification type - default is NONE.
private static int NOTIFICATION_OUTPUT_INDEX
          Index of notification output parameter.
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
 
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 data output.
 ActivityOutput getNotificationOutput()
          Gets the activity's notification message output.
 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, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setInput
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
getDataService, getName, getSession, setDataService, setSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

mNotificationType

private NotificationType mNotificationType
Notification type - default is NONE.


mNotificationMessage

private java.lang.String mNotificationMessage
Notification message - default is none


DATA_INPUT_INDEX

private static final int DATA_INPUT_INDEX
Index of data input parameter.

See Also:
Constant Field Values

DATA_OUTPUT_INDEX

private static final int DATA_OUTPUT_INDEX
Index of data output parameter.

See Also:
Constant Field Values

NOTIFICATION_OUTPUT_INDEX

private static final int NOTIFICATION_OUTPUT_INDEX
Index of notification output parameter.

See Also:
Constant Field Values
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".

setInput should be called to set the activity that provides input to this activity.

Parameters:
input - Output from another activity.
Throws:
java.lang.IllegalArgumentException - If input is null.

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 input, type or message 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 message is null.

setNotificationType

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

Parameters:
type - The type of notification to do - either on commencement of processing, completion of processing or none.
Throws:
java.lang.IllegalArgumentException - If type is null.

getDataOutput

public ActivityOutput getDataOutput()
Gets the activity's data output.

Returns:
the data output

getNotificationOutput

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

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 input 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