UnboundID LDAP SDK for Java

Ping Identity
Product Information

Interacting with Ping Identity, UnboundID, or Nokia/Alcatel-Lucent 8661 Directory Server Tasks

The Ping Identity, UnboundID, and Nokia/Alcatel-Lucent 8661 Directory Server products include a tasks backend which can be used to invoke administrative operations in the server. The UnboundID LDAP SDK for Java provides support for the following tasks:

The UnboundID LDAP SDK for Java provides a number of classes that can be used to schedule new tasks or interact with existing tasks defined in the server.

Tasks

The base class for all administrative tasks in the LDAP SDK is the com.unboundid.ldap.sdk.unboundidds.tasks.Task class. This encapsulates a set of common properties that can apply to all types of tasks.

When scheduling a task, the following common task properties are available:

When a task has been scheduled, the following additional properties may be available, depending on the current state of the task and the processing that it has performed:

Task subclasses which are intended for interacting with a specific type of task may have other properties specific to that type of task. For example, the shutdown task can have two additional properties:

Creating Tasks

There are two basic ways of creating tasks using the UnboundID LDAP SDK for Java. The first is to simply create an object using one of the constructors that allows you to specify the values of the specific information needed to schedule that type of task. For example, if you wish to create a task that can be used to export the contents of the "userRoot" backend to a file named "ldif/userRoot.ldif" under the server root directory, you could use the following code:

ExportTask exportTask = new ExportTask(null, "userRoot", "ldif/userRoot.ldif");

Most tasks have a few different constructors of this type, although the arguments available vary based on the type of task. This is the most convenient way to schedule a task if you know exactly what kind of task you want to invoke, although it is not well-suited for use in applications that may wish to discover the types of tasks that are available and the types of properties that may be used to schedule them. To accomplish this, you can either create an instance of a task with the default constructor (the one that doesn't take any arguments), or you can use the static getAvailableTaskTypes method in the Task class to obtain instances of all of the tasks that are available. A task instance created using this default constructor may only be used for calling the following methods:

Once you have a list of the task properties, you may use them to obtain the appropriate information, and then you may use the constructor which takes a Map<TaskProperty,List<Object>> argument.

Once you have an instance of a task (other than one created with the default constructor), you may also use the getTaskPropertyValues method to get the properties and their corresponding values for the task.

Task Properties

As noted above, it is possible to dynamically determine the types of properties that may be provided when scheduling a task. These properties are provided in the form of TaskProperty objects. TaskProperty objects include the following information:

The Task Manager

The TaskManager class provides a set of methods that may be used to actually schedule tasks in a Ping Identity, UnboundID, or Nokia/Alcatel-Lucent 8661 Directory Server instance, or to interact with existing tasks that have already been scheduled. The task manager provides the following methods: