@Extensible @DirectoryServerExtension @DirectoryProxyServerExtension(appliesToLocalContent=true, appliesToRemoteContent=false) @SynchronizationServerExtension(appliesToLocalContent=true, appliesToSynchronizedContent=false) @ThreadSafety(level=INTERFACE_THREADSAFE) public abstract class ScriptedTask extends java.lang.Object implements Configurable
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=value
In 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 and Description |
|---|
ScriptedTask()
Creates a new instance of this task.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public ScriptedTask()
initializeTask method.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 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.