|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.ldap.sdk.unboundidds.tasks.TaskManager
@ThreadSafety(level=COMPLETELY_THREADSAFE) public final class TaskManager
NOTE: This class is part of the Commercial Edition of the UnboundID LDAP SDK for Java. It is not available for use in applications that include only the Standard Edition of the LDAP SDK, and is not supported for use in conjunction with non-UnboundID products.This class provides a number of utility methods for interacting with tasks in an UnboundID Directory Server instance. It provides methods for the following:
List<Task> allTasks = TaskManager.getTasks(connection); for (Task task : allTasks) { String taskID = task.getTaskID(); String taskName = task.getTaskName(); TaskState taskState = task.getState(); Map<TaskProperty,List<Object>> taskProperties = task.getTaskPropertyValues(); }
Method Summary | |
---|---|
static void |
cancelTask(java.lang.String taskID,
LDAPConnection connection)
Submits a request to cancel the task with the specified task ID. |
static void |
deleteTask(java.lang.String taskID,
LDAPConnection connection)
Attempts to delete the task with the specified task ID. |
static Task |
getTask(java.lang.String taskID,
LDAPConnection connection)
Retrieves the task with the specified task ID using the given connection. |
static java.util.List<Task> |
getTasks(LDAPConnection connection)
Retrieves all of the tasks defined in the Directory Server using the provided connection. |
static Task |
scheduleTask(Task task,
LDAPConnection connection)
Schedules a new instance of the provided task in the Directory Server. |
static Task |
waitForTask(java.lang.String taskID,
LDAPConnection connection,
long pollFrequency,
long maxWaitTime)
Waits for the specified task to complete. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Task getTask(java.lang.String taskID, LDAPConnection connection) throws LDAPException, TaskException
connection
- The connection to the Directory Server from which to
retrieve the task. It must not be null
.taskID
- The task ID for the task to retrieve. It must not be
null
.
null
if no such task exists in the
server. An attempt will be made to instantiate the task as the
most appropriate task type, but if this is not possible then it
will be a generic Task
object.
LDAPException
- If a problem occurs while communicating with the
Directory Server over the provided connection.
TaskException
- If the retrieved entry cannot be parsed as a task.public static java.util.List<Task> getTasks(LDAPConnection connection) throws LDAPException
connection
- The connection to the Directory Server instance from
which to retrieve the defined tasks.
LDAPException
- If a problem occurs while communicating with the
Directory Server over the provided connection.public static Task scheduleTask(Task task, LDAPConnection connection) throws LDAPException, TaskException
task
- The task to be scheduled.connection
- The connection to the Directory Server in which the
task is to be scheduled.
Task
object representing the task that was scheduled and
re-read from the server.
LDAPException
- If a problem occurs while communicating with the
Directory Server, or if it rejects the task.
TaskException
- If the entry read back from the server after the
task was created could not be parsed as a task.public static void cancelTask(java.lang.String taskID, LDAPConnection connection) throws LDAPException
taskID
- The task ID of the task to be canceled.connection
- The connection to the Directory Server in which to
perform the operation.
LDAPException
- If a problem occurs while communicating with the
Directory Server.public static void deleteTask(java.lang.String taskID, LDAPConnection connection) throws LDAPException
taskID
- The task ID of the task to be deleted.connection
- The connection to the Directory Server in which to
perform the operation.
LDAPException
- If a problem occurs while communicating with the
Directory Server.public static Task waitForTask(java.lang.String taskID, LDAPConnection connection, long pollFrequency, long maxWaitTime) throws LDAPException, TaskException
taskID
- The task ID of the task to poll.connection
- The connection to the Directory Server containing
the desired task.pollFrequency
- The minimum length of time in milliseconds between
checks to see if the task has completed. A value
less than or equal to zero will cause the client to
check as quickly as possible.maxWaitTime
- The maximum length of time in milliseconds to wait
for the task to complete before giving up. A value
less than or equal to zero indicates that it will
keep checking indefinitely until the task has
completed.
LDAPException
- If a problem occurs while communicating with the
Directory Server.
TaskException
- If a problem occurs while attempting to parse the
task entry as a task, or if the specified task
entry could not be found.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |