com.unboundid.directory.sdk.ds.scripting
Class ScriptedPlugin

java.lang.Object
  extended by com.unboundid.directory.sdk.ds.scripting.ScriptedPlugin
All Implemented Interfaces:
Configurable, Reconfigurable<PluginConfig>

@Extensible
@DirectoryServerExtension
@DirectoryProxyServerExtension(appliesToLocalContent=true,
                               appliesToRemoteContent=true,
                               notes="Some plugin types will not be invoked for proxied operations, including pre-operation, post-operation, search result entry, search result reference, intermediate response, and subordinate modify DN.  A proxy transformation may be used to achieve the same result in many cases.")
@SynchronizationServerExtension(appliesToLocalContent=true,
                                appliesToSynchronizedContent=false)
@ThreadSafety(level=INTERFACE_THREADSAFE)
public abstract class ScriptedPlugin
extends java.lang.Object
implements Reconfigurable<PluginConfig>

This class defines an API that must be implemented by scripted extensions which act as server plugins. There are several different kinds of plugins which may be invoked for different purposes, including:



A single plugin instance may be configured to act in any combination of these contexts. For example, a plugin may be configured to operate during both LDIF import and pre-parse add contexts so that it can transform the contents of entries whether regardless of the way they are inserted into the backend.

Configuring Groovy-Scripted Plugins

In order to configure a scripted plugin based on this API and written in the Groovy scripting language, use a command like:
      dsconfig create-plugin \
           --plugin-name "{plugin-name}" \
           --type groovy-scripted \
           --set enabled:true \
           --set plugin-type:{plugin-type} \
           --set "script-class:{class-name}" \
           --set "script-argument:{name=value}"
 
where "{plugin-name}" is the name to use for the plugin instance, "{plugin-type}" is the name of a plugin type for which the plugin should be invoked, "{class-name}" is the fully-qualified name of the Groovy class written using this API, and "{name=value}" represents name-value pairs for any arguments to provide to the plugin. If the plugin should be invoked for multiple plugin types, then the "--set plugin-type:{plugin-type}" option should be provided multiple times. Similarly, if multiple arguments should be provided to the plugin, then the "--set script-argument:{name=value}" option should be provided multiple times.

See Also:
Plugin

Constructor Summary
ScriptedPlugin()
          Creates a new instance of this plugin.
 
Method Summary
 com.unboundid.ldap.sdk.ResultCode applyConfiguration(PluginConfig config, com.unboundid.util.args.ArgumentParser parser, java.util.List<java.lang.String> adminActionsRequired, java.util.List<java.lang.String> messages)
          Attempts to apply the configuration from the provided argument parser to this extension.
 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.
 IntermediateResponsePluginResult doIntermediateResponse(ActiveOperationContext operationContext, UpdatableGenericResult result, com.unboundid.ldap.sdk.IntermediateResponse intermediateResponse)
          Performs any processing which may be necessary before the server sends an intermediate response to the client.
 LDIFPluginResult doLDIFExport(UpdatableEntry entry)
          Performs any processing which may be necessary for the provided entry to be exported from the server.
 LDIFPluginResult doLDIFImport(UpdatableEntry entry)
          Performs any processing which may be necessary for the provided entry to be imported into the server.
 PostConnectPluginResult doPostConnect(ClientContext clientContext)
          Performs any processing which may be necessary when the server has accepted a new client connection.
 PostDisconnectPluginResult doPostDisconnect(ClientContext clientContext, DisconnectReason disconnectReason, java.lang.String message)
          Performs any processing which may be necessary when the server has terminated a client connection.
 PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext, AddRequest request, UpdatableAddResult result)
          Performs any processing which may be necessary before the server sends a response for an add operation.
 PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext, CompareRequest request, UpdatableCompareResult result, Entry entry)
          Performs any processing which may be necessary before the server sends a response for a compare operation.
 PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext, DeleteRequest request, UpdatableDeleteResult result, Entry entry)
          Performs any processing which may be necessary before the server sends a response for a delete operation.
 PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext, ExtendedRequest request, UpdatableExtendedResult result)
          Performs any processing which may be necessary before the server sends a response for an extended operation.
 PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext, ModifyDNRequest request, UpdatableModifyDNResult result, Entry oldEntry, Entry newEntry)
          Performs any processing which may be necessary before the server sends a response for a modify DN operation.
 PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext, ModifyRequest request, UpdatableModifyResult result, Entry oldEntry, Entry newEntry)
          Performs any processing which may be necessary before the server sends a response for a modify operation.
 PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext, SASLBindRequest request, UpdatableBindResult result)
          Performs any processing which may be necessary before the server sends a response for a SASL bind operation.
 PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext, SimpleBindRequest request, UpdatableBindResult result)
          Performs any processing which may be necessary before the server sends a response for a simple bind operation.
 PostOperationPluginResult doPostOperation(ActiveSearchOperationContext operationContext, SearchRequest request, UpdatableSearchResult result)
          Performs any processing which may be necessary before the server sends a response for a search operation.
 void doPostReplication(CompletedOperationContext operationContext, AddRequest request, AddResult result)
          Performs any processing which may be necessary after all other processing has been completed for an add operation which has been received from another server via replication.
 void doPostReplication(CompletedOperationContext operationContext, DeleteRequest request, DeleteResult result)
          Performs any processing which may be necessary after all other processing has been completed for a delete operation which has been received from another server via replication.
 void doPostReplication(CompletedOperationContext operationContext, ModifyDNRequest request, ModifyDNResult result)
          Performs any processing which may be necessary after all other processing has been completed for a modify DN operation which has been received from another server via replication.
 void doPostReplication(CompletedOperationContext operationContext, ModifyRequest request, ModifyResult result)
          Performs any processing which may be necessary after all other processing has been completed for a modify operation which has been received from another server via replication.
 PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext, AddRequest request, AddResult result)
          Performs any processing which may be necessary after all other processing has been completed for an add operation and the response has been sent to the client.
 PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext, CompareRequest request, CompareResult result)
          Performs any processing which may be necessary after all other processing has been completed for a compare operation and the response has been sent to the client.
 PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext, DeleteRequest request, DeleteResult result)
          Performs any processing which may be necessary after all other processing has been completed for a delete operation and the response has been sent to the client.
 PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext, ExtendedRequest request, ExtendedResult result)
          Performs any processing which may be necessary after all other processing has been completed for an extended operation and the response has been sent to the client.
 PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext, ModifyDNRequest request, ModifyDNResult result)
          Performs any processing which may be necessary after all other processing has been completed for a modify DN operation and the response has been sent to the client.
 PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext, ModifyRequest request, ModifyResult result)
          Performs any processing which may be necessary after all other processing has been completed for a modify operation and the response has been sent to the client.
 PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext, SASLBindRequest request, BindResult result)
          Performs any processing which may be necessary after all other processing has been completed for a SASL bind operation and the response has been sent to the client.
 PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext, SimpleBindRequest request, BindResult result)
          Performs any processing which may be necessary after all other processing has been completed for a simple bind operation and the response has been sent to the client.
 PostResponsePluginResult doPostResponse(CompletedSearchOperationContext operationContext, SearchRequest request, SearchResult result)
          Performs any processing which may be necessary after all other processing has been completed for a search operation and the response has been sent to the client.
 PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext, AddRequest request, UpdatableAddResult result)
          Performs any processing which may be necessary before the server actually attempts to add an entry to the appropriate backend.
 PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext, CompareRequest request, UpdatableCompareResult result, Entry entry)
          Performs any processing which may be necessary before the server actually attempts to perform the core processing for the compare.
 PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext, DeleteRequest request, UpdatableDeleteResult result, Entry entry)
          Performs any processing which may be necessary before the server actually attempts to remove the entry from the server.
 PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext, ExtendedRequest request, UpdatableExtendedResult result)
          Performs any processing which may be necessary before the server actually attempts to perform the core processing for the extended operation.
 PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext, ModifyDNRequest request, UpdatableModifyDNResult result, Entry oldEntry, Entry newEntry)
          Performs any processing which may be necessary before the server actually attempts to update the entry in the backend.
 PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext, ModifyRequest request, UpdatableModifyResult result, Entry oldEntry, Entry newEntry)
          Performs any processing which may be necessary before the server actually attempts to update the entry in the backend.
 PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext, SASLBindRequest request, UpdatableBindResult result)
          Performs any processing which may be necessary before the server actually attempts to perform the authentication for a SASL bind request.
 PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext, SimpleBindRequest request, UpdatableBindResult result)
          Performs any processing which may be necessary before the server actually attempts to perform the authentication for a simple bind request.
 PreOperationPluginResult doPreOperation(ActiveSearchOperationContext operationContext, SearchRequest request, UpdatableSearchResult result)
          Performs any processing which may be necessary before the server actually attempts to process the search in the backend.
 PreParsePluginResult doPreParse(ActiveOperationContext operationContext, UpdatableAbandonRequest request)
          Performs any processing which may be necessary before the server starts processing for an abandon request.
 PreParsePluginResult doPreParse(ActiveOperationContext operationContext, UpdatableAddRequest request, UpdatableAddResult result)
          Performs any processing which may be necessary before the server starts processing for an add request.
 PreParsePluginResult doPreParse(ActiveOperationContext operationContext, UpdatableCompareRequest request, UpdatableCompareResult result)
          Performs any processing which may be necessary before the server starts processing for a compare request.
 PreParsePluginResult doPreParse(ActiveOperationContext operationContext, UpdatableDeleteRequest request, UpdatableDeleteResult result)
          Performs any processing which may be necessary before the server starts processing for a delete request.
 PreParsePluginResult doPreParse(ActiveOperationContext operationContext, UpdatableExtendedRequest request, UpdatableExtendedResult result)
          Performs any processing which may be necessary before the server starts processing for an extended request.
 PreParsePluginResult doPreParse(ActiveOperationContext operationContext, UpdatableModifyDNRequest request, UpdatableModifyDNResult result)
          Performs any processing which may be necessary before the server starts processing for a modify DN request.
 PreParsePluginResult doPreParse(ActiveOperationContext operationContext, UpdatableModifyRequest request, UpdatableModifyResult result)
          Performs any processing which may be necessary before the server starts processing for a modify request.
 PreParsePluginResult doPreParse(ActiveOperationContext operationContext, UpdatableSASLBindRequest request, UpdatableBindResult result)
          Performs any processing which may be necessary before the server starts processing for a SASL bind request.
 PreParsePluginResult doPreParse(ActiveOperationContext operationContext, UpdatableSimpleBindRequest request, UpdatableBindResult result)
          Performs any processing which may be necessary before the server starts processing for a simple bind request.
 PreParsePluginResult doPreParse(ActiveOperationContext operationContext, UpdatableUnbindRequest request)
          Performs any processing which may be necessary before the server starts processing for an unbind request.
 PreParsePluginResult doPreParse(ActiveSearchOperationContext operationContext, UpdatableSearchRequest request, UpdatableSearchResult result)
          Performs any processing which may be necessary before the server starts processing for a search request.
 SearchEntryPluginResult doSearchEntry(ActiveSearchOperationContext operationContext, SearchRequest request, UpdatableSearchResult result, UpdatableEntry entry, java.util.List<com.unboundid.ldap.sdk.Control> controls)
          Performs any processing which may be necessary before the server sends a search result entry to the client.
 SearchReferencePluginResult doSearchReference(ActiveSearchOperationContext operationContext, SearchRequest request, UpdatableSearchResult result, java.util.List<java.lang.String> referralURLs, java.util.List<com.unboundid.ldap.sdk.Control> controls)
          Performs any processing which may be necessary before the server sends a search result reference to the client.
 void doShutdown(java.lang.String shutdownReason)
          Performs any processing which may be necessary when the server is shutting down.
 StartupPluginResult doStartup()
          Performs any processing which may be necessary when the server is starting.
 SubordinateModifyDNPluginResult doSubordinateModifyDN(ActiveOperationContext operationContext, ModifyDNRequest request, UpdatableModifyDNResult result, Entry oldSubordinateEntry, Entry newSubordinateEntry, java.util.List<com.unboundid.ldap.sdk.Modification> additionalModifications)
          Performs any processing which may be necessary during the course of renaming an entry which is subordinate to an entry targeted by a modify DN operation.
 void finalizePlugin()
          Performs any cleanup which may be necessary when this plugin is to be taken out of service.
 java.util.Set<StartupDependency> getStartupDependencies()
          Retrieves the set of startup dependencies which must be resolved in order for this plugin to be invoked at server startup.
 void initializePlugin(DirectoryServerContext serverContext, PluginConfig config, com.unboundid.util.args.ArgumentParser parser)
          Initializes this plugin.
 boolean isConfigurationAcceptable(PluginConfig config, com.unboundid.util.args.ArgumentParser parser, java.util.List<java.lang.String> unacceptableReasons)
          Indicates whether the configuration represented by the provided argument parser is acceptable for use by this extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptedPlugin

public ScriptedPlugin()
Creates a new instance of this plugin. All plugin implementations must include a default constructor, but any initialization should generally be done in the initializePlugin method.

Method Detail

defineConfigArguments

public void defineConfigArguments(com.unboundid.util.args.ArgumentParser parser)
                           throws com.unboundid.util.args.ArgumentException
Updates the provided argument parser to define any configuration arguments which may be used by this extension. The argument parser may also be updated to define relationships between arguments (e.g., to specify required, exclusive, or dependent argument sets).

Specified by:
defineConfigArguments in interface Configurable
Parameters:
parser - The argument parser to be updated with the configuration arguments which may be used by this extension.
Throws:
com.unboundid.util.args.ArgumentException - If a problem is encountered while updating the provided argument parser.

initializePlugin

public void initializePlugin(DirectoryServerContext serverContext,
                             PluginConfig config,
                             com.unboundid.util.args.ArgumentParser parser)
                      throws com.unboundid.ldap.sdk.LDAPException
Initializes this plugin.

Parameters:
serverContext - A handle to the server context for the server in which this extension is running.
config - The general configuration for this plugin.
parser - The argument parser which has been initialized from the configuration for this plugin.
Throws:
com.unboundid.ldap.sdk.LDAPException - If a problem occurs while initializing this plugin.

finalizePlugin

public void finalizePlugin()
Performs any cleanup which may be necessary when this plugin is to be taken out of service.


isConfigurationAcceptable

public boolean isConfigurationAcceptable(PluginConfig config,
                                         com.unboundid.util.args.ArgumentParser parser,
                                         java.util.List<java.lang.String> unacceptableReasons)
Indicates whether the configuration represented by the provided argument parser is acceptable for use by this extension. The parser will have been used to parse any configuration available for this extension, and any automatic validation will have been performed. This method may be used to perform any more complex validation which cannot be performed automatically by the argument parser.

Specified by:
isConfigurationAcceptable in interface Reconfigurable<PluginConfig>
Parameters:
config - The general configuration for this extension.
parser - The argument parser that has been used to parse the proposed configuration for this extension.
unacceptableReasons - A list to which messages may be added to provide additional information about why the provided configuration is not acceptable.
Returns:
true if the configuration in the provided argument parser appears to be acceptable, or false if not.

applyConfiguration

public com.unboundid.ldap.sdk.ResultCode applyConfiguration(PluginConfig config,
                                                            com.unboundid.util.args.ArgumentParser parser,
                                                            java.util.List<java.lang.String> adminActionsRequired,
                                                            java.util.List<java.lang.String> messages)
Attempts to apply the configuration from the provided argument parser to this extension.

Specified by:
applyConfiguration in interface Reconfigurable<PluginConfig>
Parameters:
config - The general configuration for this extension.
parser - The argument parser that has been used to parse the new configuration for this extension.
adminActionsRequired - A list to which messages may be added to provide additional information about any additional administrative actions that may be required to apply some of the configuration changes.
messages - A list to which messages may be added to provide additional information about the processing performed by this method.
Returns:
A result code providing information about the result of applying the configuration change. A result of SUCCESS should be used to indicate that all processing completed successfully. Any other result will indicate that a problem occurred during processing.

getStartupDependencies

public java.util.Set<StartupDependency> getStartupDependencies()
Retrieves the set of startup dependencies which must be resolved in order for this plugin to be invoked at server startup. This is only applicable for startup plugins, in which case it may be possible to have the plugin startup processing invoked as early as possible. If it returns null then startup processing for this plugin will be performed at the default time during startup.

Returns:
The set of startup dependencies for this plugin, or null if it is not a startup plugin, or if startup processing should be invoked at the default time during server startup.

doStartup

public StartupPluginResult doStartup()
Performs any processing which may be necessary when the server is starting.

Returns:
Information about the result of the plugin processing.

doShutdown

public void doShutdown(java.lang.String shutdownReason)
Performs any processing which may be necessary when the server is shutting down.

Parameters:
shutdownReason - A message which may provide information about the reason the server is shutting down.

doLDIFImport

public LDIFPluginResult doLDIFImport(UpdatableEntry entry)
Performs any processing which may be necessary for the provided entry to be imported into the server.

Parameters:
entry - The entry to be imported. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doLDIFExport

public LDIFPluginResult doLDIFExport(UpdatableEntry entry)
Performs any processing which may be necessary for the provided entry to be exported from the server.

Parameters:
entry - The entry to be exported. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPostConnect

public PostConnectPluginResult doPostConnect(ClientContext clientContext)
Performs any processing which may be necessary when the server has accepted a new client connection.

Parameters:
clientContext - Information about the client connection that has been established.
Returns:
Information about the result of the plugin processing.

doPostDisconnect

public PostDisconnectPluginResult doPostDisconnect(ClientContext clientContext,
                                                   DisconnectReason disconnectReason,
                                                   java.lang.String message)
Performs any processing which may be necessary when the server has terminated a client connection.

Parameters:
clientContext - Information about the client connection that has been established.
disconnectReason - A general reason for the disconnect.
message - A message which may provide additional information about the disconnect. It may be null if none is available.
Returns:
Information about the result of the plugin processing.

doPreParse

public PreParsePluginResult doPreParse(ActiveOperationContext operationContext,
                                       UpdatableAbandonRequest request)
Performs any processing which may be necessary before the server starts processing for an abandon request.

Parameters:
operationContext - The context for the abandon operation.
request - The abandon request to be processed. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPreParse

public PreParsePluginResult doPreParse(ActiveOperationContext operationContext,
                                       UpdatableAddRequest request,
                                       UpdatableAddResult result)
Performs any processing which may be necessary before the server starts processing for an add request. This will be invoked only for add operations requested directly by clients, but not for add operations received from another server via replication.

Parameters:
operationContext - The context for the add operation.
request - The add request to be processed. It may be altered if desired.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPreOperation

public PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext,
                                               AddRequest request,
                                               UpdatableAddResult result)
Performs any processing which may be necessary before the server actually attempts to add an entry to the appropriate backend. This will be invoked only for add operations requested directly by clients, but not for add operations received from another server via replication.

Parameters:
operationContext - The context for the add operation.
request - The add request to be processed.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPostOperation

public PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext,
                                                 AddRequest request,
                                                 UpdatableAddResult result)
Performs any processing which may be necessary before the server sends a response for an add operation. This will be invoked only for add operations requested directly by clients, but not for add operations received from another server via replication.

Parameters:
operationContext - The context for the add operation.
request - The add request that was processed.
result - The result to be returned to the client. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPostResponse

public PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext,
                                               AddRequest request,
                                               AddResult result)
Performs any processing which may be necessary after all other processing has been completed for an add operation and the response has been sent to the client. This will be invoked only for add operations requested directly by clients, but not for add operations received from another server via replication.

Parameters:
operationContext - The context for the add operation.
request - The add request that was processed.
result - The result that was returned to the client.
Returns:
Information about the result of the plugin processing.

doPostReplication

public void doPostReplication(CompletedOperationContext operationContext,
                              AddRequest request,
                              AddResult result)
Performs any processing which may be necessary after all other processing has been completed for an add operation which has been received from another server via replication.

Parameters:
operationContext - The context for the add operation.
request - The add request that was processed.
result - The result that was returned to the client.

doPreParse

public PreParsePluginResult doPreParse(ActiveOperationContext operationContext,
                                       UpdatableSimpleBindRequest request,
                                       UpdatableBindResult result)
Performs any processing which may be necessary before the server starts processing for a simple bind request.

Parameters:
operationContext - The context for the bind operation.
request - The bind request to be processed. It may be altered if desired.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPreOperation

public PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext,
                                               SimpleBindRequest request,
                                               UpdatableBindResult result)
Performs any processing which may be necessary before the server actually attempts to perform the authentication for a simple bind request.

Parameters:
operationContext - The context for the bind operation.
request - The bind request to be processed.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPostOperation

public PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext,
                                                 SimpleBindRequest request,
                                                 UpdatableBindResult result)
Performs any processing which may be necessary before the server sends a response for a simple bind operation.

Parameters:
operationContext - The context for the bind operation.
request - The bind request that was processed.
result - The result to be returned to the client. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPostResponse

public PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext,
                                               SimpleBindRequest request,
                                               BindResult result)
Performs any processing which may be necessary after all other processing has been completed for a simple bind operation and the response has been sent to the client.

Parameters:
operationContext - The context for the bind operation.
request - The bind request that was processed.
result - The result that was returned to the client.
Returns:
Information about the result of the plugin processing.

doPreParse

public PreParsePluginResult doPreParse(ActiveOperationContext operationContext,
                                       UpdatableSASLBindRequest request,
                                       UpdatableBindResult result)
Performs any processing which may be necessary before the server starts processing for a SASL bind request.

Parameters:
operationContext - The context for the bind operation.
request - The bind request to be processed. It may be altered if desired.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPreOperation

public PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext,
                                               SASLBindRequest request,
                                               UpdatableBindResult result)
Performs any processing which may be necessary before the server actually attempts to perform the authentication for a SASL bind request.

Parameters:
operationContext - The context for the bind operation.
request - The bind request to be processed.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPostOperation

public PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext,
                                                 SASLBindRequest request,
                                                 UpdatableBindResult result)
Performs any processing which may be necessary before the server sends a response for a SASL bind operation.

Parameters:
operationContext - The context for the bind operation.
request - The bind request that was processed.
result - The result to be returned to the client. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPostResponse

public PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext,
                                               SASLBindRequest request,
                                               BindResult result)
Performs any processing which may be necessary after all other processing has been completed for a SASL bind operation and the response has been sent to the client.

Parameters:
operationContext - The context for the bind operation.
request - The bind request that was processed.
result - The result that was returned to the client.
Returns:
Information about the result of the plugin processing.

doPreParse

public PreParsePluginResult doPreParse(ActiveOperationContext operationContext,
                                       UpdatableCompareRequest request,
                                       UpdatableCompareResult result)
Performs any processing which may be necessary before the server starts processing for a compare request.

Parameters:
operationContext - The context for the compare operation.
request - The compare request to be processed. It may be altered if desired.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPreOperation

public PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext,
                                               CompareRequest request,
                                               UpdatableCompareResult result,
                                               Entry entry)
Performs any processing which may be necessary before the server actually attempts to perform the core processing for the compare.

Parameters:
operationContext - The context for the compare operation.
request - The compare request to be processed.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
entry - The entry targeted by the compare operation.
Returns:
Information about the result of the plugin processing.

doPostOperation

public PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext,
                                                 CompareRequest request,
                                                 UpdatableCompareResult result,
                                                 Entry entry)
Performs any processing which may be necessary before the server sends a response for a compare operation.

Parameters:
operationContext - The context for the compare operation.
request - The compare request that was processed.
result - The result to be returned to the client. It may be altered if desired.
entry - The entry targeted by the compare operation, if it exists.
Returns:
Information about the result of the plugin processing.

doPostResponse

public PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext,
                                               CompareRequest request,
                                               CompareResult result)
Performs any processing which may be necessary after all other processing has been completed for a compare operation and the response has been sent to the client.

Parameters:
operationContext - The context for the compare operation.
request - The compare request that was processed.
result - The result that was returned to the client.
Returns:
Information about the result of the plugin processing.

doPreParse

public PreParsePluginResult doPreParse(ActiveOperationContext operationContext,
                                       UpdatableDeleteRequest request,
                                       UpdatableDeleteResult result)
Performs any processing which may be necessary before the server starts processing for a delete request. This will be invoked only for delete operations requested directly by clients, but not for delete operations received from another server via replication.

Parameters:
operationContext - The context for the delete operation.
request - The delete request to be processed. It may be altered if desired.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPreOperation

public PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext,
                                               DeleteRequest request,
                                               UpdatableDeleteResult result,
                                               Entry entry)
Performs any processing which may be necessary before the server actually attempts to remove the entry from the server. This will be invoked only for delete operations requested directly by clients, but not for delete operations received from another server via replication.

Parameters:
operationContext - The context for the delete operation.
request - The delete request to be processed.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
entry - The entry targeted by the delete operation.
Returns:
Information about the result of the plugin processing.

doPostOperation

public PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext,
                                                 DeleteRequest request,
                                                 UpdatableDeleteResult result,
                                                 Entry entry)
Performs any processing which may be necessary before the server sends a response for a delete operation. This will be invoked only for delete operations requested directly by clients, but not for delete operations received from another server via replication.

Parameters:
operationContext - The context for the delete operation.
request - The delete request that was processed.
result - The result to be returned to the client. It may be altered if desired.
entry - The entry targeted by the delete operation, if it exists.
Returns:
Information about the result of the plugin processing.

doPostResponse

public PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext,
                                               DeleteRequest request,
                                               DeleteResult result)
Performs any processing which may be necessary after all other processing has been completed for a delete operation and the response has been sent to the client. This will be invoked only for delete operations requested directly by clients, but not for delete operations received from another server via replication.

Parameters:
operationContext - The context for the delete operation.
request - The delete request that was processed.
result - The result that was returned to the client.
Returns:
Information about the result of the plugin processing.

doPostReplication

public void doPostReplication(CompletedOperationContext operationContext,
                              DeleteRequest request,
                              DeleteResult result)
Performs any processing which may be necessary after all other processing has been completed for a delete operation which has been received from another server via replication.

Parameters:
operationContext - The context for the delete operation.
request - The delete request that was processed.
result - The result that was returned to the client.

doPreParse

public PreParsePluginResult doPreParse(ActiveOperationContext operationContext,
                                       UpdatableExtendedRequest request,
                                       UpdatableExtendedResult result)
Performs any processing which may be necessary before the server starts processing for an extended request.

Parameters:
operationContext - The context for the extended operation.
request - The extended request to be processed. It may be altered if desired.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPreOperation

public PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext,
                                               ExtendedRequest request,
                                               UpdatableExtendedResult result)
Performs any processing which may be necessary before the server actually attempts to perform the core processing for the extended operation.

Parameters:
operationContext - The context for the extended operation.
request - The extended request to be processed.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPostOperation

public PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext,
                                                 ExtendedRequest request,
                                                 UpdatableExtendedResult result)
Performs any processing which may be necessary before the server sends a response for an extended operation.

Parameters:
operationContext - The context for the extended operation.
request - The extended request that was processed.
result - The result to be returned to the client. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPostResponse

public PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext,
                                               ExtendedRequest request,
                                               ExtendedResult result)
Performs any processing which may be necessary after all other processing has been completed for an extended operation and the response has been sent to the client.

Parameters:
operationContext - The context for the extended operation.
request - The extended request that was processed.
result - The result that was returned to the client.
Returns:
Information about the result of the plugin processing.

doPreParse

public PreParsePluginResult doPreParse(ActiveOperationContext operationContext,
                                       UpdatableModifyRequest request,
                                       UpdatableModifyResult result)
Performs any processing which may be necessary before the server starts processing for a modify request. This will be invoked only for modify operations requested directly by clients, but not for modify operations received from another server via replication.

Parameters:
operationContext - The context for the modify operation.
request - The modify request to be processed. It may be altered if desired.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPreOperation

public PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext,
                                               ModifyRequest request,
                                               UpdatableModifyResult result,
                                               Entry oldEntry,
                                               Entry newEntry)
Performs any processing which may be necessary before the server actually attempts to update the entry in the backend. This will be invoked only for modify operations requested directly by clients, but not for modify operations received from another server via replication.

Parameters:
operationContext - The context for the modify operation.
request - The modify request to be processed.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
oldEntry - The entry as it appeared before the modifications were applied.
newEntry - The updated entry as it will appear after the modifications have been applied.
Returns:
Information about the result of the plugin processing.

doPostOperation

public PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext,
                                                 ModifyRequest request,
                                                 UpdatableModifyResult result,
                                                 Entry oldEntry,
                                                 Entry newEntry)
Performs any processing which may be necessary before the server sends a response for a modify operation. This will be invoked only for modify operations requested directly by clients, but not for modify operations received from another server via replication.

Parameters:
operationContext - The context for the modify operation.
request - The modify request that was processed.
result - The result to be returned to the client. It may be altered if desired.
oldEntry - The entry as it appeared before the modifications were applied, if it exists. .
newEntry - The entry as it appears after the modifications have been applied, if it exists. .
Returns:
Information about the result of the plugin processing.

doPostResponse

public PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext,
                                               ModifyRequest request,
                                               ModifyResult result)
Performs any processing which may be necessary after all other processing has been completed for a modify operation and the response has been sent to the client. This will be invoked only for modify operations requested directly by clients, but not for modify operations received from another server via replication.

Parameters:
operationContext - The context for the modify operation.
request - The modify request that was processed.
result - The result that was returned to the client.
Returns:
Information about the result of the plugin processing.

doPostReplication

public void doPostReplication(CompletedOperationContext operationContext,
                              ModifyRequest request,
                              ModifyResult result)
Performs any processing which may be necessary after all other processing has been completed for a modify operation which has been received from another server via replication.

Parameters:
operationContext - The context for the modify operation.
request - The modify request that was processed.
result - The result that was returned to the client.

doPreParse

public PreParsePluginResult doPreParse(ActiveOperationContext operationContext,
                                       UpdatableModifyDNRequest request,
                                       UpdatableModifyDNResult result)
Performs any processing which may be necessary before the server starts processing for a modify DN request. This will be invoked only for modify DN operations requested directly by clients, but not for modify DN operations received from another server via replication.

Parameters:
operationContext - The context for the modify DN operation.
request - The modify DN request to be processed. It may be altered if desired.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPreOperation

public PreOperationPluginResult doPreOperation(ActiveOperationContext operationContext,
                                               ModifyDNRequest request,
                                               UpdatableModifyDNResult result,
                                               Entry oldEntry,
                                               Entry newEntry)
Performs any processing which may be necessary before the server actually attempts to update the entry in the backend. This will be invoked only for modify DN operations requested directly by clients, but not for modify DN operations received from another server via replication.

Parameters:
operationContext - The context for the modify DN operation.
request - The modify DN request to be processed.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
oldEntry - The entry as it appeared before being renamed.
newEntry - The updated entry as it will appear after it has been renamed.
Returns:
Information about the result of the plugin processing.

doSubordinateModifyDN

public SubordinateModifyDNPluginResult doSubordinateModifyDN(ActiveOperationContext operationContext,
                                                             ModifyDNRequest request,
                                                             UpdatableModifyDNResult result,
                                                             Entry oldSubordinateEntry,
                                                             Entry newSubordinateEntry,
                                                             java.util.List<com.unboundid.ldap.sdk.Modification> additionalModifications)
Performs any processing which may be necessary during the course of renaming an entry which is subordinate to an entry targeted by a modify DN operation. This will be invoked only for both modify DN operations requested by clients and for modify DN operations received from another server via replication.

Parameters:
operationContext - The context for the modify DN operation.
request - The modify DN request being processed.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
oldSubordinateEntry - The subordinate entry as it appeared before being renamed.
newSubordinateEntry - The subordinate entry as it will appear after being renamed.
additionalModifications - A list of additional modifications that should be applied to the entry as it is renamed. This list may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPostOperation

public PostOperationPluginResult doPostOperation(ActiveOperationContext operationContext,
                                                 ModifyDNRequest request,
                                                 UpdatableModifyDNResult result,
                                                 Entry oldEntry,
                                                 Entry newEntry)
Performs any processing which may be necessary before the server sends a response for a modify DN operation. This will be invoked only for modify DN operations requested directly by clients, but not for modify DN operations received from another server via replication.

Parameters:
operationContext - The context for the modify DN operation.
request - The modify DN request that was processed.
result - The result to be returned to the client. It may be altered if desired.
oldEntry - The entry as it appeared before it was renamed, if it exists.
newEntry - The entry as it appears after it was renamed, if it exists. .
Returns:
Information about the result of the plugin processing.

doPostResponse

public PostResponsePluginResult doPostResponse(CompletedOperationContext operationContext,
                                               ModifyDNRequest request,
                                               ModifyDNResult result)
Performs any processing which may be necessary after all other processing has been completed for a modify DN operation and the response has been sent to the client. This will be invoked only for modify DN operations requested directly by clients, but not for modify DN operations received from another server via replication.

Parameters:
operationContext - The context for the modify DN operation.
request - The modify DN request that was processed.
result - The result that was returned to the client.
Returns:
Information about the result of the plugin processing.

doPostReplication

public void doPostReplication(CompletedOperationContext operationContext,
                              ModifyDNRequest request,
                              ModifyDNResult result)
Performs any processing which may be necessary after all other processing has been completed for a modify DN operation which has been received from another server via replication.

Parameters:
operationContext - The context for the modify DN operation.
request - The modify DN request that was processed.
result - The result that was returned to the client.

doPreParse

public PreParsePluginResult doPreParse(ActiveSearchOperationContext operationContext,
                                       UpdatableSearchRequest request,
                                       UpdatableSearchResult result)
Performs any processing which may be necessary before the server starts processing for a search request.

Parameters:
operationContext - The context for the search operation.
request - The search request to be processed. It may be altered if desired.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPreOperation

public PreOperationPluginResult doPreOperation(ActiveSearchOperationContext operationContext,
                                               SearchRequest request,
                                               UpdatableSearchResult result)
Performs any processing which may be necessary before the server actually attempts to process the search in the backend.

Parameters:
operationContext - The context for the search operation.
request - The search request to be processed.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doSearchEntry

public SearchEntryPluginResult doSearchEntry(ActiveSearchOperationContext operationContext,
                                             SearchRequest request,
                                             UpdatableSearchResult result,
                                             UpdatableEntry entry,
                                             java.util.List<com.unboundid.ldap.sdk.Control> controls)
Performs any processing which may be necessary before the server sends a search result entry to the client.

Parameters:
operationContext - The context for the search operation.
request - The search request being processed.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
entry - The entry to be returned to the client. It may be altered if desired.
controls - The set of controls to be included with the entry. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doSearchReference

public SearchReferencePluginResult doSearchReference(ActiveSearchOperationContext operationContext,
                                                     SearchRequest request,
                                                     UpdatableSearchResult result,
                                                     java.util.List<java.lang.String> referralURLs,
                                                     java.util.List<com.unboundid.ldap.sdk.Control> controls)
Performs any processing which may be necessary before the server sends a search result reference to the client.

Parameters:
operationContext - The context for the search operation.
request - The search request being processed.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
referralURLs - The set of referral URLs to be returned to the client. It may be altered if desired.
controls - The set of controls to be included with the reference. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPostOperation

public PostOperationPluginResult doPostOperation(ActiveSearchOperationContext operationContext,
                                                 SearchRequest request,
                                                 UpdatableSearchResult result)
Performs any processing which may be necessary before the server sends a response for a search operation.

Parameters:
operationContext - The context for the search operation.
request - The search request that was processed.
result - The result to be returned to the client. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doPostResponse

public PostResponsePluginResult doPostResponse(CompletedSearchOperationContext operationContext,
                                               SearchRequest request,
                                               SearchResult result)
Performs any processing which may be necessary after all other processing has been completed for a search operation and the response has been sent to the client.

Parameters:
operationContext - The context for the search operation.
request - The search request that was processed.
result - The result that was returned to the client.
Returns:
Information about the result of the plugin processing.

doPreParse

public PreParsePluginResult doPreParse(ActiveOperationContext operationContext,
                                       UpdatableUnbindRequest request)
Performs any processing which may be necessary before the server starts processing for an unbind request.

Parameters:
operationContext - The context for the unbind operation.
request - The unbind request to be processed. It may be altered if desired.
Returns:
Information about the result of the plugin processing.

doIntermediateResponse

public IntermediateResponsePluginResult doIntermediateResponse(ActiveOperationContext operationContext,
                                                               UpdatableGenericResult result,
                                                               com.unboundid.ldap.sdk.IntermediateResponse intermediateResponse)
Performs any processing which may be necessary before the server sends an intermediate response to the client.

Parameters:
operationContext - The context for the associated operation.
result - The result that will be returned to the client if the plugin result indicates that processing on the operation should be interrupted. It may be altered if desired.
intermediateResponse - The intermediate response to be returned to the client. It may be altered if desired.
Returns:
Information about the result of the plugin processing.