| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.unboundid.directory.sdk.ds.api.Task
@Extensible
@DirectoryServerExtension
@DirectoryProxyServerExtension(appliesToLocalContent=true,
                               appliesToRemoteContent=false)
@SynchronizationServerExtension(appliesToLocalContent=true,
                                appliesToSynchronizedContent=false)
@ThreadSafety(level=INTERFACE_THREADSAFE)
public abstract class TaskThis class defines an API that must be implemented by extensions which may be used as administrative tasks. Administrative tasks have the ability to perform arbitrary processing within the server whenever a particular kind of entry is added, and that processing can be performed immediately or at some specified time in the future. The server must be configured as follows to allow creation of third-party tasks:
   dsconfig set-global-configuration-prop
     --add allowed-task:com.unboundid.directory.sdk.extensions.ThirdPartyTask
 
 Tasks may then be scheduled by adding an entry
 below "cn=Scheduled Tasks,cn=tasks" with a format like the following:
 dn: ds-task-id=TASKID,cn=Scheduled Tasks,cn=tasks objectClass: top objectClass: ds-task objectClass: ds-third-party-task ds-task-id: TASKID ds-task-class-name: com.unboundid.directory.sdk.extensions.ThirdPartyTask ds-third-party-task-java-class: com.example.ExampleTask ds-third-party-task-argument: name=valueIn this example, TASKID should be replaced with a string that uniquely identifies the task. The value of the ds-third-party-task-java-class attribute should contain the fully-qualified name of the non-abstract Java class that extends this com.unboundid.directory.sdk.api.Task class, and the ds-third-party-task-argument values (if any) should reflect the set of arguments allowed for the task as per the
defineConfigArguments(com.unboundid.util.args.ArgumentParser)
 method.
 
ScriptedTask| Constructor Summary | |
|---|---|
| Task()Creates a new instance of this task. | |
| Method Summary | |
|---|---|
|  void | defineConfigArguments(com.unboundid.util.args.ArgumentParser parser)Updates the provided argument parser to define any configuration arguments which may be used by this extension. | 
|  java.util.Map<java.util.List<java.lang.String>,java.lang.String> | getExamplesArgumentSets()Retrieves a map containing examples of configurations that may be used for this extension. | 
| abstract  java.lang.String[] | getExtensionDescription()Retrieves a human-readable description for this extension. | 
| abstract  java.lang.String | getExtensionName()Retrieves a human-readable name for this extension. | 
| abstract  java.lang.String | getTaskName()Retrieves a human-readable name that may be used for this task. | 
|  void | initializeTask(DirectoryServerContext serverContext,
                             com.unboundid.util.args.ArgumentParser parser)Initializes this task. | 
|  void | interruptTask(TaskReturnState interruptState,
                           java.lang.String interruptReason)Attempts to interrupt the execution of this task. | 
|  boolean | isInterruptible()Indicates whether this task may be interrupted before it has completed (e.g., canceled by an administrator or aborted at server shutdown). | 
| abstract  TaskReturnState | runTask(TaskContext taskContext)Performs the appropriate processing for this task. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public Task()
initializeTask method.
| Method Detail | 
|---|
public abstract java.lang.String getExtensionName()
getExtensionName in interface UnboundIDExtensionpublic abstract java.lang.String[] getExtensionDescription()
getExtensionDescription in interface UnboundIDExtensionnull
          or an empty array if no description should be available.
public void defineConfigArguments(com.unboundid.util.args.ArgumentParser parser)
                           throws com.unboundid.util.args.ArgumentException
defineConfigArguments in interface Configurableparser - The argument parser to be updated with the configuration
                 arguments which may be used by this extension.
com.unboundid.util.args.ArgumentException - If a problem is encountered while updating the
                             provided argument parser.
public void initializeTask(DirectoryServerContext serverContext,
                           com.unboundid.util.args.ArgumentParser parser)
                    throws com.unboundid.ldap.sdk.LDAPException
serverContext - A handle to the server context for the server in
                        which this task is running.parser - The argument parser which has been initialized from
                        the configuration for this task.
com.unboundid.ldap.sdk.LDAPException - If a problem occurs while initializing this task.public abstract java.lang.String getTaskName()
public abstract TaskReturnState runTask(TaskContext taskContext)
taskContext - Information about the task to be run.
public boolean isInterruptible()
true if this task may be interrupted before it has
          completed, or false if it cannot be interrupted.
public void interruptTask(TaskReturnState interruptState,
                          java.lang.String interruptReason)
isInterruptible() method returns true.
interruptState - The return state that should be used for the task
                          if it is successfully interrupted.interruptReason - A message that provides a reason that the task has
                          been interrupted.public java.util.Map<java.util.List<java.lang.String>,java.lang.String> getExamplesArgumentSets()
getExamplesArgumentSets in interface ExampleUsageProvidernull or empty if there should
          not be any example argument sets.| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||