|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.unboundid.directory.sdk.ds.scripting.ScriptedTask
@Extensible @DirectoryServerExtension @DirectoryProxyServerExtension(appliesToLocalContent=true, appliesToRemoteContent=false) @SynchronizationServerExtension(appliesToLocalContent=true, appliesToSynchronizedContent=false) @ThreadSafety(level=INTERFACE_THREADSAFE) public abstract class ScriptedTask
This class defines an API that must be implemented by scripted 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. Tasks may 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-groovy-scripted-task ds-task-id: TASKID ds-task-class-name: com.unboundid.directory.sdk.extensions.GroovyScrip tedTask ds-scripted-task-class: com.example.ExampleGroovyTask ds-scripted-task-argument: name=valueIn this example, TASKID should be replaced with a string that uniquely identifies the task. The value of the ds-scripted-task-class attribute should contain the fully-qualified name of the non-abstract Groovy class that extends this com.unboundid.directory.sdk.scripting.ScriptedTask class, and the ds-scripted-task-argument values (if any) should reflect the set of arguments to be provided for the task. method.
Task
Constructor Summary | |
---|---|
ScriptedTask()
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. |
void |
initializeTask(DirectoryServerContext serverContext,
com.unboundid.util.args.ArgumentParser parser)
Initializes this task. |
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 ScriptedTask()
initializeTask
method.
Method Detail |
---|
public void defineConfigArguments(com.unboundid.util.args.ArgumentParser parser) throws com.unboundid.util.args.ArgumentException
defineConfigArguments
in interface Configurable
parser
- 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 extension 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 TaskReturnState runTask(TaskContext taskContext)
taskContext
- Information about the task to be run.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |