com.ibm.websphere.scheduler
Interface TaskInfo

All Superinterfaces:
java.io.Serializable, TaskStatus
All Known Subinterfaces:
BeanTaskInfo, MessageTaskInfo

public interface TaskInfo
extends TaskStatus

Interface for all scheduled tasks.

Contains the data to be used when scheduling a task using the Scheduler.create method.

Since:
5.0
Version:
5.0
See Also:
BeanTaskInfo, MessageTaskInfo

Field Summary
 
Fields inherited from interface com.ibm.websphere.scheduler.TaskStatus
CANCELLED, COMPLETE, INVALID, RUNNING, SCHEDULED, serialVersionUID, SUSPENDED
 
Method Summary
 boolean getAutoPurge()
          Get the AutoPurge value for this task.
 java.lang.String getName()
          Get the name of the task.
 NotificationSinkHome getNotificationSink()
          Gets the NotificationSinkHome associated with this TaskInfo.
 int getNumberOfRepeats()
          Get the number of repeats that were set with setNumberOfRepeats.
 java.lang.String getRepeatInterval()
          Get the UserCalendar repeat interval.
 java.lang.String getStartByInterval()
          Get the start-by interval that was set with setStartByInterval
 java.util.Date getStartTime()
          Get the start date and time for this task that was set with setStartTime.
 java.lang.String getStartTimeInterval()
          Get the UserCalendar start time interval that was set with setStartTime
 java.lang.String getUserCalendarJNDIName()
          Get the UserCalendar JNDI name
 java.lang.String getUserCalendarSpecifier()
          Get the UserCalendar specifier.
 void setAutoPurge(boolean purge)
          Specifies that upon completion, the task will be deleted from the persistent store.
 void setInitialState(int initialState)
          Set the state that this task should default to when initially created.
 void setName(java.lang.String name)
          Set the name of the task.
 void setNotificationSink(NotificationSinkHome home)
          Specifies a callback which will be invoked for all events.
 void setNotificationSink(NotificationSinkHome home, int eventMask)
          Specifies a callback which will be invoked based upon the requested filter.
 void setNumberOfRepeats(int repeatCount)
          Sets the number of times this task will be repeated:
 void setRepeatInterval(java.lang.String userCalendarDelta)
          Specifies a UserCalendar interval which represents the time between firings.
 void setStartByInterval(java.lang.String userCalendarDelta)
          Specifies that if the task has not executed within the specified UserCalendar interval, the associated work should not be fired.
 void setStartTime(java.util.Date start)
          Sets the start date and time for this task.
 void setStartTimeInterval(java.lang.String userCalendarDelta)
          Sets the start time for the task given a UserCalendar interval.
 void setUserCalendar(java.lang.String homeJNDIName, java.lang.String specifier)
          Set the UserCalendar for this task.
 void validate()
          Validates various attributes of a TaskInfo.
 
Methods inherited from interface com.ibm.websphere.scheduler.TaskStatus
getNextFireTime, getRepeatsLeft, getStatus, getTaskId, getTimeCreated
 

Method Detail

setStartByInterval

public void setStartByInterval(java.lang.String userCalendarDelta)
Specifies that if the task has not executed within the specified UserCalendar interval, the associated work should not be fired. The next fire time will still be calculated and if applicable, the repeat count decremented.

Parameters:
userCalendarDelta - the UserCalendar interval used to apply to each calculated fire time.
Since:
5.0
See Also:
UserCalendar

getStartByInterval

public java.lang.String getStartByInterval()
Get the start-by interval that was set with setStartByInterval

Returns:
String
Since:
5.0

setStartTime

public void setStartTime(java.util.Date start)
Sets the start date and time for this task. The task will not run until this time elapses.

Parameters:
start - the Date to use for the start date and time.
Since:
5.0

getStartTime

public java.util.Date getStartTime()
Get the start date and time for this task that was set with setStartTime.

Returns:
the start date and time.
Since:
5.0

setStartTimeInterval

public void setStartTimeInterval(java.lang.String userCalendarDelta)
Sets the start time for the task given a UserCalendar interval. The actual time will be calculated during task creation using the UserCalendar associated with this task info, or if unspecified, the default calendar.

Parameters:
userCalendarDelta - the UserCalendar interval used to apply to the current time.
Since:
5.0
See Also:
UserCalendar

getStartTimeInterval

public java.lang.String getStartTimeInterval()
Get the UserCalendar start time interval that was set with setStartTime

Returns:
get the UserCalendar start time interval.
Since:
5.0

setNumberOfRepeats

public void setNumberOfRepeats(int repeatCount)
Sets the number of times this task will be repeated:


The default number of repeats is 1.

Parameters:
repeatCount - the total number of times to execute the task.
Since:
5.0

getNumberOfRepeats

public int getNumberOfRepeats()
Get the number of repeats that were set with setNumberOfRepeats.

Returns:
the number of repeats that was set with setNumberOfRepeats.
Since:
5.0

setRepeatInterval

public void setRepeatInterval(java.lang.String userCalendarDelta)
Specifies a UserCalendar interval which represents the time between firings. The UserCalendar used for calculations can be specified with the setUserCalendar and setUserCalendarSpecifier methods. If no calendar is specified, the DefaultUserCalendar calendar will be used. If this repeat interval is less than the scheduler's poll interval, then the repeat interval will be ignored and the poll interval will be used.

Parameters:
userCalendarDelta - the UserCalendar interval used to apply to each calculated fire time.
Since:
5.0
See Also:
UserCalendar

getRepeatInterval

public java.lang.String getRepeatInterval()
Get the UserCalendar repeat interval.

Returns:
the current UserCalendar repeat interval.
Since:
5.0

setUserCalendar

public void setUserCalendar(java.lang.String homeJNDIName,
                            java.lang.String specifier)
                     throws UserCalendarInvalid
Set the UserCalendar for this task. If not set, then the default UserCalendar bean is used without a specifier.

Parameters:
homeJNDIName - the JNDI name used to retrieve the Home interface of a UserCalendar implementation object. If null or an empty string, the DefaultUserCalendar is used.
specifier - optional name of an individual calendar within the UserCalendar bean.
Throws:
UserCalendarInvalid - The specified JNDI name for the UserCalendarHome could not be looked-up or is of the wrong type.
Since:
5.0
See Also:
UserCalendar

getUserCalendarJNDIName

public java.lang.String getUserCalendarJNDIName()
Get the UserCalendar JNDI name

Returns:
the current UserCalendar JNDI name.
Since:
5.0

getUserCalendarSpecifier

public java.lang.String getUserCalendarSpecifier()
Get the UserCalendar specifier.

Returns:
the current UserCalendar specifier.
Since:
5.0

setNotificationSink

public void setNotificationSink(NotificationSinkHome home)
                         throws NotificationSinkInvalid
Specifies a callback which will be invoked for all events.

Parameters:
home - A stateless session bean which uses NotificationSink remote interface.
Throws:
NotificationSinkInvalid - The HomeHandle for the session bean cannot be retrieved or the home is null;
Since:
5.0
See Also:
NotificationSink, TaskNotificationInfo

setNotificationSink

public void setNotificationSink(NotificationSinkHome home,
                                int eventMask)
                         throws NotificationSinkInvalid
Specifies a callback which will be invoked based upon the requested filter. The filter is an ORred list of TaskNotificationInfo constants.

Parameters:
home - A stateless session bean which uses NotificationSink remote interface.
eventMask - the events to monitor for. To monitor multiple events, you can OR the event types together. The default is to be notified on all events.
Throws:
NotificationSinkInvalid - The HomeHandle for the session bean cannot be retrieved or the home is null;
Since:
5.0
See Also:
NotificationSink, TaskNotificationInfo

getNotificationSink

public NotificationSinkHome getNotificationSink()
                                         throws NotificationSinkInvalid
Gets the NotificationSinkHome associated with this TaskInfo.

Returns:
the Home of the NotificationSink bean.
Throws:
NotificationSinkInvalid - The HomeHandle for the session bean cannot be retrieved or the home is null;
Since:
5.0
See Also:
NotificationSink

validate

public void validate()
              throws UserCalendarSpecifierInvalid,
                     UserCalendarPeriodInvalid,
                     UserCalendarInvalid,
                     TaskInvalid,
                     NotificationSinkInvalid
Validates various attributes of a TaskInfo. If invalid, exceptions are thrown.

Throws:
UserCalendarSpecifierInvalid - The specified UserCalendar calendar name for the specified UserCalendar is not valid.
UserCalendarPeriodInvalid - The specified UserCalendar period for the specified UserCalendar is not valid.
UserCalendarInvalid - The specified JNDI name for the UserCalendarHome could not be looked-up or is of the wrong type.
TaskInvalid - The TaskInfo object is missing or has incorrect data.
NotificationSinkInvalid - The HomeHandle for the session bean cannot be retrieved or the home is null;
Since:
5.0

setName

public void setName(java.lang.String name)
Set the name of the task. Tasks can be labeled and later queried by this name.

Parameters:
name - the label of this task
Since:
5.0

getName

public java.lang.String getName()
Get the name of the task.

Specified by:
getName in interface TaskStatus
Returns:
the name of the task which was set with setName.
Since:
5.0
See Also:
setName(java.lang.String)

setAutoPurge

public void setAutoPurge(boolean purge)
Specifies that upon completion, the task will be deleted from the persistent store.

Default is true.

Parameters:
purge - if true, automatically remove completed tasks.
Since:
5.0

getAutoPurge

public boolean getAutoPurge()
Get the AutoPurge value for this task.

Returns:
the AutoPurge value.
Since:
5.0

setInitialState

public void setInitialState(int initialState)
Set the state that this task should default to when initially created.

By default each scheduled instance is immediately scheduled (TaskStatus.SCHEDULED). The only valid parameters for this method are TaskStatus.SUSPENDED and TaskStatus.SCHEDULED

This value does not persist with the task, therefore there is no "get" method for this setting.

Parameters:
initialState - the state to set the newly-created task to.
Since:
5.0