com.ibm.websphere.scheduler
Interface TaskStatus

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

public interface TaskStatus
extends java.io.Serializable

The current state of a scheduled task.

The Scheduler object has methods which allow modifying and viewing a task that was created using it's create method. Throughout the lifetime of a task, the status will change and it may be useful to know what that state is.

Since:
5.0
Version:
5.0
See Also:
Scheduler

Field Summary
static int CANCELLED
          The scheduled task has been cancelled using the Scheduler.cancel method.
static int COMPLETE
          The scheduled task has fired to completion.
static int INVALID
          The scheduled task has been purged and is no longer valid.
static int RUNNING
          The scheduled task is currently executing.
static int SCHEDULED
          The scheduled task is currently scheduled to execute.
static long serialVersionUID
           
static int SUSPENDED
          The scheduled task is suspended.
 
Method Summary
 java.lang.String getName()
          Get the name of the task.
 java.util.Date getNextFireTime()
          Get the date and time which this task is scheduled to fire next.
 int getRepeatsLeft()
          Get the number of repeats that are left for this task.
 int getStatus()
          Get the status of a task that is retrieved from a Scheduler.
 java.lang.String getTaskId()
          Get the task identifier for this task that was assigned when the task was created.
 java.util.Date getTimeCreated()
          Get the date and time which this task was originally created.
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

SCHEDULED

public static final int SCHEDULED
The scheduled task is currently scheduled to execute.

Since:
5.0
See Also:
Constant Field Values

SUSPENDED

public static final int SUSPENDED
The scheduled task is suspended. The task will not fire until it is resumed.

Since:
5.0
See Also:
Scheduler.suspend(java.lang.String), Scheduler.resume(java.lang.String), Constant Field Values

CANCELLED

public static final int CANCELLED
The scheduled task has been cancelled using the Scheduler.cancel method. The task will not fire and it cannot be resumed, but it can be purged.

Since:
5.0
See Also:
Scheduler.cancel(java.lang.String, boolean), Scheduler.purge(java.lang.String), Constant Field Values

COMPLETE

public static final int COMPLETE
The scheduled task has fired to completion. Each time a task fires, the number of repeats is decremented until it reaches zero. Once it reaches this state, it cannot be resumed, but it can be purged.

Since:
5.0
See Also:
Scheduler.purge(java.lang.String), TaskInfo.setAutoPurge(boolean), TaskInfo.setNumberOfRepeats(int), Constant Field Values

RUNNING

public static final int RUNNING
The scheduled task is currently executing. Typically, a class will never be in this state. When it is running, the task will usually have the SCHEDULED state.

Since:
5.0
See Also:
Constant Field Values

INVALID

public static final int INVALID
The scheduled task has been purged and is no longer valid.

Since:
5.0
See Also:
Scheduler.purge(java.lang.String), Constant Field Values
Method Detail

getStatus

public int getStatus()
Get the status of a task that is retrieved from a Scheduler.

Returns:
one of the several status constants defined in TaskStatus
Since:
5.0
See Also:
Scheduler

getTaskId

public java.lang.String getTaskId()
Get the task identifier for this task that was assigned when the task was created.

Returns:
the task identifier for this task.
Since:
5.0
See Also:
Scheduler.create(com.ibm.websphere.scheduler.TaskInfo)

getName

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

Returns:
the name of the task which was set with TaskInfo.setName.
Since:
5.0
See Also:
TaskInfo.setName(java.lang.String)

getRepeatsLeft

public int getRepeatsLeft()
Get the number of repeats that are left for this task.

Returns:
the number of outstanding repeats for this task.
Since:
5.0

getNextFireTime

public java.util.Date getNextFireTime()
Get the date and time which this task is scheduled to fire next.

Returns:
the date and time which this task is scheduled to fire next.
Since:
5.0

getTimeCreated

public java.util.Date getTimeCreated()
Get the date and time which this task was originally created.

Returns:
the date and time which this task was originally created.
Since:
5.0