HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
51 Functions for server tasks
Directory Server tasks are usually maintenance operations for the server, such as indexing entries
or importing an LDIF file.
Certain server tasks can be performed through a special task plug-in. When a task entry is added
to the cn=tasks subtree in the directory, the task's handler is called and performs the task.
This chapter describes functions available for task structures.
Table 51-1 Routines for task plug-ins
DescriptionFunction
Frees a Slapi_Task structure when the task is completed.
slapi_destroy_task()
Creates a new server task and returns a pointer to the Slapi_Task structure.
slapi_new_task()
Updates a task entry to indicate that the task is running.slapi_task_begin()
Cancels a current task.slapi_task_cancel()
Decrements the task reference count.slapi_task_dec_refcount()
Called when the process is complete to write to the task entry and to return
the result code.
slapi_task_finish()
Retrieves an opaque data pointer from the task.slapi_task_get_data()
Checks the current reference count of the task. If a task has multiple threads,
this shows whether the individual tasks have completed.
slapi_task_get_refcount()
Shows the current state of the task.slapi_task_get_state()
Automatically increments the task progress, which updates the task entry.slapi_task_inc_progress()
Increments the task reference count, if the task uses multiple threads.slapi_task_inc_refcount()
Writes changes to a log attribute for the task entry.slapi_task_log_notice()
Updates the task status attribute in the entry to maintain a running display
of the task status.
slapi_task_log_status()
Registers a task handler function.slapi_task_register_handler()
Sets a callback to be used when a task is canceled.slapi_task_set_cancel_fn()
Appends an opaque object pointer to the task process.slapi_task_set_data()
Sets a callback to be used when a task is destroyed.slapi_task_set_destructor_fn()
Contains the task's status.slapi_task_status_changed()
51.1 slapi_destroy_task()
Frees a Slapi_Task structure. This does not update the task status, so this function should only
be used to free a task that was not started processing with slapi_task_begin(). For tasks were
started processing with slapi_task_begin(), slapi_task_finish() or slapi_task_cancel() to update
the tasks status and free the task structure.
This function calls any custom desructor callback functions that have been set, so it is safe to use
this function even if some private task data are set with slapi_task_set_data().
Syntax
void slapi_destroy_task(void *arg)
51.1 slapi_destroy_task() 377