com.ibm.websphere.scheduler
Class TaskNotificationInfo
- java.lang.Object
-
- com.ibm.websphere.scheduler.TaskNotificationInfo
-
- All Implemented Interfaces:
- java.io.Serializable
public class TaskNotificationInfo extends java.lang.Object implements java.io.SerializableThe notification information sent to a NotificationSink bean.When a notification is fired, the NotificationSink bean will receive an instance of this object and can then retrieve the TaskStatus and type of event that has occurred.
Several event types are available as constants within this class. The are used both when specifying a filter on the
TaskInfo.setNotificationSinkmethod and in theTaskNotificationInfo.getEventTypemethod when receiving a notification.- Since:
- 5.0
- Version:
- 5.0
- See Also:
NotificationSink,TaskInfo.setNotificationSink(com.ibm.websphere.scheduler.NotificationSinkHome), Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static intALL_EVENTSUsed in theTaskInfo.setNotificationSinkmethod to indicate that all events should be captured.static intCANCELLEDThe task has been cancelled.static intCOMPLETEThe task has been completed.protected inteventTypeAn event type constant defined in this class.static intFIRE_DELAYEDThe task was unable to start by the designated time or interval and was skipped.static intFIRE_FAILEDThe task has fired, but the TaskInfo threw an unexpected exception when executing.static intFIREDThe task has fired.static intFIRINGThe task is firing.static intPURGEDThe task was purged from the persistent store.static intRESUMEDThe task was resumed.static intSCHEDULEDThe task was currently scheduled.static intSUSPENDEDThe task was suspended.protected TaskStatustaskStatusThe TaskStatus of the task that fired this notification.protected java.util.DatetimeThe date/time at which the notification fired or created
-
Constructor Summary
Constructors Constructor and Description TaskNotificationInfo(TaskStatus taskStatus, int eventType)Main constructor for the TaskNotificationInfo
-
Method Summary
Methods Modifier and Type Method and Description intgetEventType()The type of event that was fired.TaskStatusgetTaskStatus()Get the TaskStatus of the task that fired this notification.java.util.DategetTime()The date/time at which the notification was fired.
-
-
-
Field Detail
-
SCHEDULED
public static final int SCHEDULED
The task was currently scheduled. This will occur either when a TaskInfo is scheduled for the first time usingScheduler.createor when the task reschedules itself when theTaskInfo.setNumberOfRepeatsparameter is >1.- Since:
- 5.0
- See Also:
Scheduler.create(com.ibm.websphere.scheduler.TaskInfo), Constant Field Values
-
PURGED
public static final int PURGED
The task was purged from the persistent store. This happens when theScheduler.purgemethod is called, whenScheduler.cancelis called with the purgeAlso parameter set to true and when a task has completed and theTaskInfo.setAutoPurgeproperty is set to true.- Since:
- 5.0
- See Also:
Scheduler.purge(java.lang.String),TaskInfo.setAutoPurge(boolean), Constant Field Values
-
SUSPENDED
public static final int SUSPENDED
The task was suspended.- Since:
- 5.0
- See Also:
Scheduler.suspend(java.lang.String), Constant Field Values
-
RESUMED
public static final int RESUMED
The task was resumed.- Since:
- 5.0
- See Also:
Scheduler.resume(java.lang.String), Constant Field Values
-
COMPLETE
public static final int COMPLETE
The task has been completed. The number of repeats left on the scheduled TaskInfo have reached zero.- Since:
- 5.0
- See Also:
- Constant Field Values
-
CANCELLED
public static final int CANCELLED
The task has been cancelled.- Since:
- 5.0
- See Also:
Scheduler.cancel(java.lang.String, boolean), Constant Field Values
-
FIRED
public static final int FIRED
The task has fired. The FIRED event occurs immediately after the task successfully executes. The FIRED event only occurs when task execution is successful, if the task throws an exeception during execution, then the notification event will be FIRE_FAILED rather than FIRED.- Since:
- 5.0
- See Also:
TaskInfo,FIRE_FAILED, Constant Field Values
-
FIRE_FAILED
public static final int FIRE_FAILED
The task has fired, but the TaskInfo threw an unexpected exception when executing.- Since:
- 5.0
- See Also:
TaskInfo, Constant Field Values
-
FIRE_DELAYED
public static final int FIRE_DELAYED
The task was unable to start by the designated time or interval and was skipped. This occurs when the scheduler daemon was unable to fire a task at the scheduled time and has exceeded the start-by interval set for the task. The task will be rescheduled for the next available time if the repeat count hasn't reached zero.- Since:
- 5.0
- See Also:
TaskInfo.setStartByInterval(java.lang.String), Constant Field Values
-
FIRING
public static final int FIRING
The task is firing. The FIRING event occurs immediately before the task executes.- Since:
- 5.03
- See Also:
- Constant Field Values
-
ALL_EVENTS
public static final int ALL_EVENTS
Used in theTaskInfo.setNotificationSinkmethod to indicate that all events should be captured.- Since:
- 5.0
- See Also:
- Constant Field Values
-
taskStatus
protected TaskStatus taskStatus
The TaskStatus of the task that fired this notification.- Since:
- 5.0
-
eventType
protected int eventType
An event type constant defined in this class.- Since:
- 5.0
-
time
protected java.util.Date time
The date/time at which the notification fired or created- Since:
- 5.0
-
-
Constructor Detail
-
TaskNotificationInfo
public TaskNotificationInfo(TaskStatus taskStatus, int eventType)
Main constructor for the TaskNotificationInfo- Parameters:
taskStatus- the current TaskStatus.eventType- the type of event to notify with.- Since:
- 5.0
-
-
Method Detail
-
getTaskStatus
public TaskStatus getTaskStatus()
Get the TaskStatus of the task that fired this notification.- Returns:
- the TaskStatus of the task that fired this notification.
- Since:
- 5.0
-
getEventType
public int getEventType()
The type of event that was fired.
-
getTime
public java.util.Date getTime()
The date/time at which the notification was fired.- Returns:
- the java.util.Date at which the notification was fired.
- Since:
- 5.0
-
-