org.opends.server.backends.task
Enum TaskState

java.lang.Object
  extended by java.lang.Enum<TaskState>
      extended by org.opends.server.backends.task.TaskState
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TaskState>

public enum TaskState
extends java.lang.Enum<TaskState>

This enumeration defines the various states that a task can have during its lifetime.


Enum Constant Summary
CANCELED_BEFORE_STARTING
          The task state that indicates that the task was canceled by an administrator before it started running.
COMPLETED_SUCCESSFULLY
          The task state that indicates that the task has completed without any errors.
COMPLETED_WITH_ERRORS
          The task state that indicates that the task was able to complete its intended goal, but that one or more errors were encountered during the process.
DISABLED
          The task state that indicates that the task has been disabled by an administrator.
RUNNING
          The task state that indicates that the task is currently running.
STOPPED_BY_ADMINISTRATOR
          The task state that indicates that the task was stopped by an administrator after it had already started but before it was able to complete.
STOPPED_BY_ERROR
          The task state that indicates that one or more errors prevented the task from completing.
STOPPED_BY_SHUTDOWN
          The task state that indicates that the task was unable to complete because it was interrupted by the shutdown of the task backend.
UNSCHEDULED
          The task state that indicates that the task has not yet been scheduled, or possibly that the scheduler is currently not running.
WAITING_ON_DEPENDENCY
          The task state that indicates that at least one of the task's defined dependencies has not yet completed.
WAITING_ON_START_TIME
          The task state that indicates that the task's scheduled start time has not yet arrived.
 
Method Summary
static TaskState fromString(java.lang.String s)
          Retrieves the task state that corresponds to the provided string value.
 Message getDisplayName()
          Gets a locale sensitive representation of this state.
static boolean isCancelled(TaskState taskState)
          Indicates whether or not this task has been cancelled.
static boolean isDone(TaskState taskState)
          Indicates whether a task with the specified state has completed all the processing that it will do, regardless of whether it completed its intended goal.
static boolean isPending(TaskState taskState)
          Indicates whether a task with the specified state is currently pending execution.
static boolean isRunning(TaskState taskState)
          Indicates whether a task with the specified state is currently running.
static boolean isSuccessful(TaskState taskState)
          Indicates whether a task with the specified state has been able to complete its intended goal.
static TaskState valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static TaskState[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNSCHEDULED

public static final TaskState UNSCHEDULED
The task state that indicates that the task has not yet been scheduled, or possibly that the scheduler is currently not running.


DISABLED

public static final TaskState DISABLED
The task state that indicates that the task has been disabled by an administrator.


WAITING_ON_START_TIME

public static final TaskState WAITING_ON_START_TIME
The task state that indicates that the task's scheduled start time has not yet arrived.


WAITING_ON_DEPENDENCY

public static final TaskState WAITING_ON_DEPENDENCY
The task state that indicates that at least one of the task's defined dependencies has not yet completed.


RUNNING

public static final TaskState RUNNING
The task state that indicates that the task is currently running.


COMPLETED_SUCCESSFULLY

public static final TaskState COMPLETED_SUCCESSFULLY
The task state that indicates that the task has completed without any errors.


COMPLETED_WITH_ERRORS

public static final TaskState COMPLETED_WITH_ERRORS
The task state that indicates that the task was able to complete its intended goal, but that one or more errors were encountered during the process.


STOPPED_BY_SHUTDOWN

public static final TaskState STOPPED_BY_SHUTDOWN
The task state that indicates that the task was unable to complete because it was interrupted by the shutdown of the task backend.


STOPPED_BY_ERROR

public static final TaskState STOPPED_BY_ERROR
The task state that indicates that one or more errors prevented the task from completing.


STOPPED_BY_ADMINISTRATOR

public static final TaskState STOPPED_BY_ADMINISTRATOR
The task state that indicates that the task was stopped by an administrator after it had already started but before it was able to complete.


CANCELED_BEFORE_STARTING

public static final TaskState CANCELED_BEFORE_STARTING
The task state that indicates that the task was canceled by an administrator before it started running.

Method Detail

values

public static TaskState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TaskState c : TaskState.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TaskState valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

isPending

public static boolean isPending(TaskState taskState)
Indicates whether a task with the specified state is currently pending execution.

Parameters:
taskState - The task state for which to make the determination.
Returns:
true if the stask tate indicates that the task is currently pending, or false otherwise.

isRunning

public static boolean isRunning(TaskState taskState)
Indicates whether a task with the specified state is currently running.

Parameters:
taskState - The task state for which to make the determination.
Returns:
true if the task state indicates that the task is currently running, or false otherwise.

isDone

public static boolean isDone(TaskState taskState)
Indicates whether a task with the specified state has completed all the processing that it will do, regardless of whether it completed its intended goal.

Parameters:
taskState - The task state for which to make the determination.
Returns:
false if the task state indicates that the task has not yet started or is currently running, or true otherwise.

isSuccessful

public static boolean isSuccessful(TaskState taskState)
Indicates whether a task with the specified state has been able to complete its intended goal.

Parameters:
taskState - The task state for which to make the determination.
Returns:
true if the task state indicates that the task completed successfully or with minor errors that still allowed it to achieve its goal, or false otherwise.

isCancelled

public static boolean isCancelled(TaskState taskState)
Indicates whether or not this task has been cancelled.

Parameters:
taskState - The task state for which to make the determination.
Returns:
true if the task state indicates that the task was cancelled either before or during execution, or false otherwise.

fromString

public static TaskState fromString(java.lang.String s)
Retrieves the task state that corresponds to the provided string value.

Parameters:
s - The string value for which to retrieve the corresponding task state.
Returns:
The corresponding task state, or null if none could be associated with the provided string.

getDisplayName

public Message getDisplayName()
Gets a locale sensitive representation of this state.

Returns:
Message describing state