001    /*
002     * CDDL HEADER START
003     *
004     * The contents of this file are subject to the terms of the
005     * Common Development and Distribution License, Version 1.0 only
006     * (the "License").  You may not use this file except in compliance
007     * with the License.
008     *
009     * You can obtain a copy of the license at
010     * docs/licenses/cddl.txt
011     * or http://www.opensource.org/licenses/cddl1.php.
012     * See the License for the specific language governing permissions
013     * and limitations under the License.
014     *
015     * When distributing Covered Code, include this CDDL HEADER in each
016     * file and include the License file at
017     * docs/licenses/cddl.txt.  If applicable,
018     * add the following below this CDDL HEADER, with the fields enclosed
019     * by brackets "[]" replaced with your own identifying information:
020     *      Portions Copyright [yyyy] [name of copyright owner]
021     *
022     * CDDL HEADER END
023     *
024     *
025     *      Copyright 2010-2013 UnboundID Corp.
026     */
027    package com.unboundid.directory.sdk.ds.api;
028    
029    
030    
031    import java.util.Collections;
032    import java.util.List;
033    import java.util.Map;
034    import java.util.Set;
035    
036    import com.unboundid.directory.sdk.common.internal.ExampleUsageProvider;
037    import com.unboundid.directory.sdk.common.internal.Reconfigurable;
038    import com.unboundid.directory.sdk.common.internal.UnboundIDExtension;
039    import com.unboundid.directory.sdk.common.operation.AddRequest;
040    import com.unboundid.directory.sdk.common.operation.AddResult;
041    import com.unboundid.directory.sdk.common.operation.BindResult;
042    import com.unboundid.directory.sdk.common.operation.CompareRequest;
043    import com.unboundid.directory.sdk.common.operation.CompareResult;
044    import com.unboundid.directory.sdk.common.operation.DeleteRequest;
045    import com.unboundid.directory.sdk.common.operation.DeleteResult;
046    import com.unboundid.directory.sdk.common.operation.ExtendedRequest;
047    import com.unboundid.directory.sdk.common.operation.ExtendedResult;
048    import com.unboundid.directory.sdk.common.operation.ModifyRequest;
049    import com.unboundid.directory.sdk.common.operation.ModifyResult;
050    import com.unboundid.directory.sdk.common.operation.ModifyDNRequest;
051    import com.unboundid.directory.sdk.common.operation.ModifyDNResult;
052    import com.unboundid.directory.sdk.common.operation.SASLBindRequest;
053    import com.unboundid.directory.sdk.common.operation.SearchRequest;
054    import com.unboundid.directory.sdk.common.operation.SearchResult;
055    import com.unboundid.directory.sdk.common.operation.SimpleBindRequest;
056    import com.unboundid.directory.sdk.common.operation.UpdatableAbandonRequest;
057    import com.unboundid.directory.sdk.common.operation.UpdatableAddRequest;
058    import com.unboundid.directory.sdk.common.operation.UpdatableAddResult;
059    import com.unboundid.directory.sdk.common.operation.UpdatableBindResult;
060    import com.unboundid.directory.sdk.common.operation.UpdatableCompareRequest;
061    import com.unboundid.directory.sdk.common.operation.UpdatableCompareResult;
062    import com.unboundid.directory.sdk.common.operation.UpdatableDeleteRequest;
063    import com.unboundid.directory.sdk.common.operation.UpdatableDeleteResult;
064    import com.unboundid.directory.sdk.common.operation.UpdatableExtendedRequest;
065    import com.unboundid.directory.sdk.common.operation.UpdatableExtendedResult;
066    import com.unboundid.directory.sdk.common.operation.UpdatableGenericResult;
067    import com.unboundid.directory.sdk.common.operation.UpdatableModifyRequest;
068    import com.unboundid.directory.sdk.common.operation.UpdatableModifyResult;
069    import com.unboundid.directory.sdk.common.operation.UpdatableModifyDNRequest;
070    import com.unboundid.directory.sdk.common.operation.UpdatableModifyDNResult;
071    import com.unboundid.directory.sdk.common.operation.UpdatableSASLBindRequest;
072    import com.unboundid.directory.sdk.common.operation.UpdatableSearchRequest;
073    import com.unboundid.directory.sdk.common.operation.UpdatableSearchResult;
074    import com.unboundid.directory.sdk.common.operation.UpdatableSimpleBindRequest;
075    import com.unboundid.directory.sdk.common.operation.UpdatableUnbindRequest;
076    import com.unboundid.directory.sdk.common.types.ActiveOperationContext;
077    import com.unboundid.directory.sdk.common.types.ActiveSearchOperationContext;
078    import com.unboundid.directory.sdk.common.types.CompletedOperationContext;
079    import com.unboundid.directory.sdk.common.types.CompletedSearchOperationContext;
080    import com.unboundid.directory.sdk.common.types.ClientContext;
081    import com.unboundid.directory.sdk.common.types.DisconnectReason;
082    import com.unboundid.directory.sdk.common.types.Entry;
083    import com.unboundid.directory.sdk.common.types.UpdatableEntry;
084    import com.unboundid.directory.sdk.ds.config.PluginConfig;
085    import com.unboundid.directory.sdk.ds.internal.DirectoryServerExtension;
086    import com.unboundid.directory.sdk.ds.types.DirectoryServerContext;
087    import com.unboundid.directory.sdk.ds.types.IntermediateResponsePluginResult;
088    import com.unboundid.directory.sdk.ds.types.LDIFPluginResult;
089    import com.unboundid.directory.sdk.ds.types.PostConnectPluginResult;
090    import com.unboundid.directory.sdk.ds.types.PostDisconnectPluginResult;
091    import com.unboundid.directory.sdk.ds.types.PostOperationPluginResult;
092    import com.unboundid.directory.sdk.ds.types.PostResponsePluginResult;
093    import com.unboundid.directory.sdk.ds.types.PreOperationPluginResult;
094    import com.unboundid.directory.sdk.ds.types.PreParsePluginResult;
095    import com.unboundid.directory.sdk.ds.types.SearchEntryPluginResult;
096    import com.unboundid.directory.sdk.ds.types.SearchReferencePluginResult;
097    import com.unboundid.directory.sdk.ds.types.StartupDependency;
098    import com.unboundid.directory.sdk.ds.types.StartupPluginResult;
099    import com.unboundid.directory.sdk.ds.types.SubordinateModifyDNPluginResult;
100    import com.unboundid.directory.sdk.proxy.internal.DirectoryProxyServerExtension;
101    import com.unboundid.directory.sdk.sync.internal.SynchronizationServerExtension;
102    import com.unboundid.ldap.sdk.Control;
103    import com.unboundid.ldap.sdk.IntermediateResponse;
104    import com.unboundid.ldap.sdk.LDAPException;
105    import com.unboundid.ldap.sdk.Modification;
106    import com.unboundid.ldap.sdk.ResultCode;
107    import com.unboundid.util.Extensible;
108    import com.unboundid.util.ThreadSafety;
109    import com.unboundid.util.ThreadSafetyLevel;
110    import com.unboundid.util.args.ArgumentException;
111    import com.unboundid.util.args.ArgumentParser;
112    
113    
114    
115    /**
116     * This class defines an API that must be implemented by extensions which act as
117     * server plugins.  There are several different kinds of plugins which may be
118     * invoked for different purposes, including:
119     * <UL>
120     *   <LI>startup -- Startup plugins may be used to perform custom processing
121     *       when the server is in the process of staring up.  By default, the
122     *       processing will be performed near the end of the startup phase just
123     *       before the server begins to accept connections from external clients,
124     *       but if one or more startup dependencies are defined, then the plugin
125     *       may be invoked earlier in the startup process as soon as all declared
126     *       dependencies have been satisfied.</LI>
127     *   <LI>shutdown -- Shutdown plugins may be used to perform custom processing
128     *       when the server is in the process of shutting down.  This will occur
129     *       near the beginning of the shutdown process, just after the server stops
130     *       accepting new client connections and terminates existing connections
131     *       but before shutting down any other components.  Note that shutdown
132     *       plugins may not always be invoked in some unusual shutdown scenarios
133     *       (e.g., if the server process is forcefully killed, or in the event of a
134     *       hardware, OS, or JVM failure).</LI>
135     *   <LI>LDIF import -- LDIF import plugins are invoked for each entry read from
136     *       an LDIF file to be imported into a backend.  It is possible to alter
137     *       the contents of the entry or to cause the entry to be excluded from the
138     *       import.</LI>
139     *   <LI>LDIF export -- LDIF export plugins are invoked for each entry exported
140     *       from a backend to be written to an LDIF file.  It is possible to alter
141     *       the contents of the entry or to cause the entry to be excluded from the
142     *       export.</LI>
143     *   <LI>post-connect -- Post-connect plugins are invoked during the course of
144     *       accepting a new client connection.  They may access information about
145     *       the client and may optionally terminate the client connection if it is
146     *       deemed appropriate.</LI>
147     *   <LI>post-disconnect -- Post-disconnect plugins are invoked after a client
148     *       connection has been closed, regardless of whether the closure was
149     *       initiated by the client (e.g., because of an unbind request or simply
150     *       closing the socket) or by the server (e.g., because the connection had
151     *       been idle for too long or because the client violated some server-side
152     *       constraint.</LI>
153     *   <LI>pre-parse -- Pre-parse plugins are invoked just after the server has
154     *       received an abandon, add, bind, compare, delete, extended, modify,
155     *       modify DN, search, or unbind request.  They may be used to obtain
156     *       information about the requests, alter the contents of the request or
157     *       prevent the server from processing the request.
158     *   <LI>pre-operation -- Pre-operation plugins are invoked for add, bind,
159     *       compare, delete, extended, modify, modify DN, and search operations
160     *       after some level of validation has been performed but just before the
161     *       core processing for the operation.  They may not be used to alter the
162     *       request, but they may still be used to obtain information about the
163     *       request or to prevent the operation from being processed.</LI>
164     *   <LI>post-operation -- Post-operation plugins are invoked for add, bind,
165     *       compare, delete, extended, modify, modify DN, and search operations
166     *       after most processing has completed for the operation but before the
167     *       result has been returned to the client.  They may be used to obtain
168     *       information about the result or to alter the contents of the result to
169     *       be returned.</LI>
170     *   <LI>post-response -- Post-response plugins are invoked for add, bind,
171     *       compare, delete, extended, modify, modify DN, and search operations
172     *       after the response has already been sent to the client.  They may be
173     *       used to perform processing for operations without delaying the response
174     *       to the client.</LI>
175     *   <LI>post-replication -- Post-replication plugins are invoked for add,
176     *       delete, modify, and modify DN operations that have been received and
177     *       processed via replication.  They may be used to obtain information or
178     *       perform processing for replicated changes, but may not alter those
179     *       changes.</LI>
180     *   <LI>search result entry -- Search result entry plugins are invoked for each
181     *       entry to be returned to the client during the course of processing a
182     *       search operation.  They may obtain information about the entry to be
183     *       returned, alter the entry contents, or prevent the entry from being
184     *       returned.</LI>
185     *   <LI>search result reference -- Search result reference plugins are invoked
186     *       for each reference to be returned to the client during the course of
187     *       processing a search operation.  They may obtain information about the
188     *       reference to be returned, alter the referral URLs to be returned, or
189     *       prevent the reference from being returned.</LI>
190     *   <LI>subordinate modify DN -- Subordinate modify DN plugins are invoked for
191     *       each entry below the target entry being renamed in the course of a
192     *       modify DN operation.  They may be used to obtain information about the
193     *       subordinate entry to be renamed and optionally to alter the contents
194     *       of that entry.</LI>
195     *   <LI>intermediate response -- Intermediate response plugins are invoked for
196     *       each intermediate response to be returned to the client.  They may be
197     *       used to obtain information about the response or to prevent it from
198     *       being returned to the client.</LI>
199     * </UL>
200     * <BR><BR>
201     * A single plugin instance may be configured to act in any combination of these
202     * contexts.  For example, a plugin may be configured to operate during both
203     * LDIF import and pre-parse add contexts so that it can transform the contents
204     * of entries whether regardless of the way they are inserted into the backend.
205     * <BR>
206     * <H2>Configuring Plugins</H2>
207     * In order to configure a plugin created using this API, use a command like:
208     * <PRE>
209     *      dsconfig create-plugin \
210     *           --plugin-name "<I>{plugin-name}</I>" \
211     *           --type third-party \
212     *           --set enabled:true \
213     *           --set plugin-type:{plugin-type} \
214     *           --set "extension-class:<I>{class-name}</I>" \
215     *           --set "extension-argument:<I>{name=value}</I>"
216     * </PRE>
217     * where "<I>{plugin-name}</I>" is the name to use for the plugin instance,
218     * "<I>{plugin-type}</I>" is the name of a plugin type for which the plugin
219     * should be invoked,  "<I>{class-name}</I>" is the fully-qualified name of the
220     * Java class that extends {@code com.unboundid.directory.sdk.ds.api.Plugin},
221     * and "<I>{name=value}</I>" represents name-value pairs for any arguments to
222     * provide to the plugin.  If the plugin should be invoked for multiple plugin
223     * types, then the "<CODE>--set plugin-type:<I>{plugin-type}</I></CODE>"
224     * option should be provided multiple times.  Similarly, if multiple arguments
225     * should be provided to the plugin, then the
226     * "<CODE>--set extension-argument:<I>{name=value}</I></CODE>" option should be
227     * provided multiple times.
228     *
229     * @see  com.unboundid.directory.sdk.ds.scripting.ScriptedPlugin
230     */
231    @Extensible()
232    @DirectoryServerExtension()
233    @DirectoryProxyServerExtension(appliesToLocalContent=true,
234         appliesToRemoteContent=true,
235         notes="Some plugin types will not be invoked for proxied operations, " +
236              "including pre-operation, post-operation, search result entry, " +
237              "search result reference, intermediate response, and subordinate " +
238              "modify DN.  A proxy transformation may be used to achieve the " +
239              "same result in many cases.")
240    @SynchronizationServerExtension(appliesToLocalContent=true,
241         appliesToSynchronizedContent=false)
242    @ThreadSafety(level=ThreadSafetyLevel.INTERFACE_THREADSAFE)
243    public abstract class Plugin
244           implements UnboundIDExtension, Reconfigurable<PluginConfig>,
245                      ExampleUsageProvider
246    {
247      /**
248       * Creates a new instance of this plugin.  All plugin implementations must
249       * include a default constructor, but any initialization should generally be
250       * done in the {@code initializePlugin} method.
251       */
252      public Plugin()
253      {
254        // No implementation is required.
255      }
256    
257    
258    
259      /**
260       * {@inheritDoc}
261       */
262      public abstract String getExtensionName();
263    
264    
265    
266      /**
267       * {@inheritDoc}
268       */
269      public abstract String[] getExtensionDescription();
270    
271    
272    
273      /**
274       * {@inheritDoc}
275       */
276      public void defineConfigArguments(final ArgumentParser parser)
277             throws ArgumentException
278      {
279        // No arguments will be allowed by default.
280      }
281    
282    
283    
284      /**
285       * Initializes this plugin.
286       *
287       * @param  serverContext  A handle to the server context for the server in
288       *                        which this extension is running.
289       * @param  config         The general configuration for this plugin.
290       * @param  parser         The argument parser which has been initialized from
291       *                        the configuration for this plugin.
292       *
293       * @throws  LDAPException  If a problem occurs while initializing this plugin.
294       */
295      public void initializePlugin(final DirectoryServerContext serverContext,
296                                   final PluginConfig config,
297                                   final ArgumentParser parser)
298             throws LDAPException
299      {
300        // No initialization will be performed by default.
301      }
302    
303    
304    
305      /**
306       * {@inheritDoc}
307       */
308      public boolean isConfigurationAcceptable(final PluginConfig config,
309                          final ArgumentParser parser,
310                          final List<String> unacceptableReasons)
311      {
312        // No extended validation will be performed by default.
313        return true;
314      }
315    
316    
317    
318      /**
319       * {@inheritDoc}
320       */
321      public ResultCode applyConfiguration(final PluginConfig config,
322                                           final ArgumentParser parser,
323                                           final List<String> adminActionsRequired,
324                                           final List<String> messages)
325      {
326        // By default, no configuration changes will be applied.  If there are any
327        // arguments, then add an admin action message indicating that the extension
328        // needs to be restarted for any changes to take effect.
329        if (! parser.getNamedArguments().isEmpty())
330        {
331          adminActionsRequired.add(
332               "No configuration change has actually been applied.  The new " +
333                    "configuration will not take effect until this plugin is " +
334                    "disabled and re-enabled or until the server is restarted.");
335        }
336    
337        return ResultCode.SUCCESS;
338      }
339    
340    
341    
342      /**
343       * Performs any cleanup which may be necessary when this plugin is to be taken
344       * out of service.
345       */
346      public void finalizePlugin()
347      {
348        // No implementation is required.
349      }
350    
351    
352    
353      /**
354       * Retrieves the set of startup dependencies which must be resolved in order
355       * for this plugin to be invoked at server startup.  This is only applicable
356       * for startup plugins, in which case it may be possible to have the plugin
357       * startup processing invoked as early as possible.  If it returns
358       * {@code null} then startup processing for this plugin will be performed at
359       * the default time during startup.
360       *
361       * @return  The set of startup dependencies for this plugin, or {@code null}
362       *          if it is not a startup plugin, or if startup processing should be
363       *          invoked at the default time during server startup.
364       */
365      public Set<StartupDependency> getStartupDependencies()
366      {
367        return null;
368      }
369    
370    
371    
372      /**
373       * Performs any processing which may be necessary when the server is starting.
374       *
375       * @return  Information about the result of the plugin processing.
376       */
377      public StartupPluginResult doStartup()
378      {
379        // No processing is performed by default.
380        return StartupPluginResult.SUCCESS;
381      }
382    
383    
384    
385      /**
386       * Performs any processing which may be necessary when the server is shutting
387       * down.
388       *
389       * @param  shutdownReason  A message which may provide information about the
390       *                         reason the server is shutting down.
391       */
392      public void doShutdown(final String shutdownReason)
393      {
394        // No processing is performed by default.
395      }
396    
397    
398    
399      /**
400       * Performs any processing which may be necessary for the provided entry to
401       * be imported into the server.
402       *
403       * @param  entry  The entry to be imported.  It may be altered if desired.
404       *
405       * @return  Information about the result of the plugin processing.
406       */
407      public LDIFPluginResult doLDIFImport(final UpdatableEntry entry)
408      {
409        // No processing is performed by default.
410        return LDIFPluginResult.SUCCESS;
411      }
412    
413    
414    
415      /**
416       * Performs any processing which may be necessary for the provided entry to
417       * be exported from the server.
418       *
419       * @param  entry  The entry to be exported.  It may be altered if desired.
420       *
421       * @return  Information about the result of the plugin processing.
422       */
423      public LDIFPluginResult doLDIFExport(final UpdatableEntry entry)
424      {
425        // No processing is performed by default.
426        return LDIFPluginResult.SUCCESS;
427      }
428    
429    
430    
431      /**
432       * Performs any processing which may be necessary when the server has accepted
433       * a new client connection.
434       *
435       * @param  clientContext  Information about the client connection that has
436       *                        been established.
437       *
438       * @return  Information about the result of the plugin processing.
439       */
440      public PostConnectPluginResult doPostConnect(
441                                          final ClientContext clientContext)
442      {
443        // No processing is performed by default.
444        return PostConnectPluginResult.SUCCESS;
445      }
446    
447    
448    
449      /**
450       * Performs any processing which may be necessary when the server has
451       * terminated a client connection.
452       *
453       * @param  clientContext     Information about the client connection that has
454       *                           been established.
455       * @param  disconnectReason  A general reason for the disconnect.
456       * @param  message           A message which may provide additional
457       *                           information about the disconnect.  It may be
458       *                           {@code null} if none is available.
459       *
460       * @return  Information about the result of the plugin processing.
461       */
462      public PostDisconnectPluginResult doPostDisconnect(
463                  final ClientContext clientContext,
464                  final DisconnectReason disconnectReason, final String message)
465      {
466        // No processing is performed by default.
467        return PostDisconnectPluginResult.SUCCESS;
468      }
469    
470    
471    
472      /**
473       * Performs any processing which may be necessary before the server starts
474       * processing for an abandon request.
475       *
476       * @param  operationContext  The context for the abandon operation.
477       * @param  request           The abandon request to be processed.  It may be
478       *                           altered if desired.
479       *
480       * @return  Information about the result of the plugin processing.
481       */
482      public PreParsePluginResult doPreParse(
483                  final ActiveOperationContext operationContext,
484                  final UpdatableAbandonRequest request)
485      {
486        // No processing is performed by default.
487        return PreParsePluginResult.SUCCESS;
488      }
489    
490    
491    
492      /**
493       * Performs any processing which may be necessary before the server starts
494       * processing for an add request.  This will be invoked only for add
495       * operations requested directly by clients, but not for add operations
496       * received from another server via replication.
497       *
498       * @param  operationContext  The context for the add operation.
499       * @param  request           The add request to be processed.  It may be
500       *                           altered if desired.
501       * @param  result            The result that will be returned to the client if
502       *                           the plugin result indicates that processing on
503       *                           the operation should be interrupted.  It may be
504       *                           altered if desired.
505       *
506       * @return  Information about the result of the plugin processing.
507       */
508      public PreParsePluginResult doPreParse(
509                  final ActiveOperationContext operationContext,
510                  final UpdatableAddRequest request,
511                  final UpdatableAddResult result)
512      {
513        // No processing is performed by default.
514        return PreParsePluginResult.SUCCESS;
515      }
516    
517    
518    
519      /**
520       * Performs any processing which may be necessary before the server actually
521       * attempts to add an entry to the appropriate backend.  This will be invoked
522       * only for add operations requested directly by clients, but not for add
523       * operations received from another server via replication.
524       *
525       * @param  operationContext  The context for the add operation.
526       * @param  request           The add request to be processed.
527       * @param  result            The result that will be returned to the client if
528       *                           the plugin result indicates that processing on
529       *                           the operation should be interrupted.  It may be
530       *                           altered if desired.
531       *
532       * @return  Information about the result of the plugin processing.
533       */
534      public PreOperationPluginResult doPreOperation(
535                  final ActiveOperationContext operationContext,
536                  final AddRequest request, final UpdatableAddResult result)
537      {
538        // No processing is performed by default.
539        return PreOperationPluginResult.SUCCESS;
540      }
541    
542    
543    
544      /**
545       * Performs any processing which may be necessary before the server sends a
546       * response for an add operation.  This will be invoked only for add
547       * operations requested directly by clients, but not for add operations
548       * received from another server via replication.
549       *
550       * @param  operationContext  The context for the add operation.
551       * @param  request           The add request that was processed.
552       * @param  result            The result to be returned to the client.  It may
553       *                           be altered if desired.
554       *
555       * @return  Information about the result of the plugin processing.
556       */
557      public PostOperationPluginResult doPostOperation(
558                  final ActiveOperationContext operationContext,
559                  final AddRequest request, final UpdatableAddResult result)
560      {
561        // No processing is performed by default.
562        return PostOperationPluginResult.SUCCESS;
563      }
564    
565    
566    
567      /**
568       * Performs any processing which may be necessary after all other processing
569       * has been completed for an add operation and the response has been sent to
570       * the client.  This will be invoked only for add operations requested
571       * directly by clients, but not for add operations received from another
572       * server via replication.
573       *
574       * @param  operationContext  The context for the add operation.
575       * @param  request           The add request that was processed.
576       * @param  result            The result that was returned to the client.
577       *
578       * @return  Information about the result of the plugin processing.
579       */
580      public PostResponsePluginResult doPostResponse(
581                  final CompletedOperationContext operationContext,
582                  final AddRequest request, final AddResult result)
583      {
584        // No processing is performed by default.
585        return PostResponsePluginResult.SUCCESS;
586      }
587    
588    
589    
590      /**
591       * Performs any processing which may be necessary after all other processing
592       * has been completed for an add operation which has been received from
593       * another server via replication.
594       *
595       * @param  operationContext  The context for the add operation.
596       * @param  request           The add request that was processed.
597       * @param  result            The result that was returned to the client.
598       */
599      public void doPostReplication(
600                       final CompletedOperationContext operationContext,
601                       final AddRequest request, final AddResult result)
602      {
603        // No processing is performed by default.
604      }
605    
606    
607    
608      /**
609       * Performs any processing which may be necessary before the server starts
610       * processing for a simple bind request.
611       *
612       * @param  operationContext  The context for the bind operation.
613       * @param  request           The bind request to be processed.  It may be
614       *                           altered if desired.
615       * @param  result            The result that will be returned to the client if
616       *                           the plugin result indicates that processing on
617       *                           the operation should be interrupted.  It may be
618       *                           altered if desired.
619       *
620       * @return  Information about the result of the plugin processing.
621       */
622      public PreParsePluginResult doPreParse(
623                  final ActiveOperationContext operationContext,
624                  final UpdatableSimpleBindRequest request,
625                  final UpdatableBindResult result)
626      {
627        // No processing is performed by default.
628        return PreParsePluginResult.SUCCESS;
629      }
630    
631    
632    
633      /**
634       * Performs any processing which may be necessary before the server actually
635       * attempts to perform the authentication for a simple bind request.
636       *
637       * @param  operationContext  The context for the bind operation.
638       * @param  request           The bind request to be processed.
639       * @param  result            The result that will be returned to the client if
640       *                           the plugin result indicates that processing on
641       *                           the operation should be interrupted.  It may be
642       *                           altered if desired.
643       *
644       * @return  Information about the result of the plugin processing.
645       */
646      public PreOperationPluginResult doPreOperation(
647                  final ActiveOperationContext operationContext,
648                  final SimpleBindRequest request,
649                  final UpdatableBindResult result)
650      {
651        // No processing is performed by default.
652        return PreOperationPluginResult.SUCCESS;
653      }
654    
655    
656    
657      /**
658       * Performs any processing which may be necessary before the server sends a
659       * response for a simple bind operation.
660       *
661       * @param  operationContext  The context for the bind operation.
662       * @param  request           The bind request that was processed.
663       * @param  result            The result to be returned to the client.  It may
664       *                           be altered if desired.
665       *
666       * @return  Information about the result of the plugin processing.
667       */
668      public PostOperationPluginResult doPostOperation(
669                  final ActiveOperationContext operationContext,
670                  final SimpleBindRequest request, final UpdatableBindResult result)
671      {
672        // No processing is performed by default.
673        return PostOperationPluginResult.SUCCESS;
674      }
675    
676    
677    
678      /**
679       * Performs any processing which may be necessary after all other processing
680       * has been completed for a simple bind operation and the response has been
681       * sent to the client.
682       *
683       * @param  operationContext  The context for the bind operation.
684       * @param  request           The bind request that was processed.
685       * @param  result            The result that was returned to the client.
686       *
687       * @return  Information about the result of the plugin processing.
688       */
689      public PostResponsePluginResult doPostResponse(
690                  final CompletedOperationContext operationContext,
691                  final SimpleBindRequest request, final BindResult result)
692      {
693        // No processing is performed by default.
694        return PostResponsePluginResult.SUCCESS;
695      }
696    
697    
698    
699      /**
700       * Performs any processing which may be necessary before the server starts
701       * processing for a SASL bind request.
702       *
703       * @param  operationContext  The context for the bind operation.
704       * @param  request           The bind request to be processed.  It may be
705       *                           altered if desired.
706       * @param  result            The result that will be returned to the client if
707       *                           the plugin result indicates that processing on
708       *                           the operation should be interrupted.  It may be
709       *                           altered if desired.
710       *
711       * @return  Information about the result of the plugin processing.
712       */
713      public PreParsePluginResult doPreParse(
714                  final ActiveOperationContext operationContext,
715                  final UpdatableSASLBindRequest request,
716                  final UpdatableBindResult result)
717      {
718        // No processing is performed by default.
719        return PreParsePluginResult.SUCCESS;
720      }
721    
722    
723    
724      /**
725       * Performs any processing which may be necessary before the server actually
726       * attempts to perform the authentication for a SASL bind request.
727       *
728       * @param  operationContext  The context for the bind operation.
729       * @param  request           The bind request to be processed.
730       * @param  result            The result that will be returned to the client if
731       *                           the plugin result indicates that processing on
732       *                           the operation should be interrupted.  It may be
733       *                           altered if desired.
734       *
735       * @return  Information about the result of the plugin processing.
736       */
737      public PreOperationPluginResult doPreOperation(
738                  final ActiveOperationContext operationContext,
739                  final SASLBindRequest request, final UpdatableBindResult result)
740      {
741        // No processing is performed by default.
742        return PreOperationPluginResult.SUCCESS;
743      }
744    
745    
746    
747      /**
748       * Performs any processing which may be necessary before the server sends a
749       * response for a SASL bind operation.
750       *
751       * @param  operationContext  The context for the bind operation.
752       * @param  request           The bind request that was processed.
753       * @param  result            The result to be returned to the client.  It may
754       *                           be altered if desired.
755       *
756       * @return  Information about the result of the plugin processing.
757       */
758      public PostOperationPluginResult doPostOperation(
759                  final ActiveOperationContext operationContext,
760                  final SASLBindRequest request, final UpdatableBindResult result)
761      {
762        // No processing is performed by default.
763        return PostOperationPluginResult.SUCCESS;
764      }
765    
766    
767    
768      /**
769       * Performs any processing which may be necessary after all other processing
770       * has been completed for a SASL bind operation and the response has been
771       * sent to the client.
772       *
773       * @param  operationContext  The context for the bind operation.
774       * @param  request           The bind request that was processed.
775       * @param  result            The result that was returned to the client.
776       *
777       * @return  Information about the result of the plugin processing.
778       */
779      public PostResponsePluginResult doPostResponse(
780                  final CompletedOperationContext operationContext,
781                  final SASLBindRequest request, final BindResult result)
782      {
783        // No processing is performed by default.
784        return PostResponsePluginResult.SUCCESS;
785      }
786    
787    
788    
789      /**
790       * Performs any processing which may be necessary before the server starts
791       * processing for a compare request.
792       *
793       * @param  operationContext  The context for the compare operation.
794       * @param  request           The compare request to be processed.  It may be
795       *                           altered if desired.
796       * @param  result            The result that will be returned to the client if
797       *                           the plugin result indicates that processing on
798       *                           the operation should be interrupted.  It may be
799       *                           altered if desired.
800       *
801       * @return  Information about the result of the plugin processing.
802       */
803      public PreParsePluginResult doPreParse(
804                  final ActiveOperationContext operationContext,
805                  final UpdatableCompareRequest request,
806                  final UpdatableCompareResult result)
807      {
808        // No processing is performed by default.
809        return PreParsePluginResult.SUCCESS;
810      }
811    
812    
813    
814      /**
815       * Performs any processing which may be necessary before the server actually
816       * attempts to perform the core processing for the compare.
817       *
818       * @param  operationContext  The context for the compare operation.
819       * @param  request           The compare request to be processed.
820       * @param  result            The result that will be returned to the client if
821       *                           the plugin result indicates that processing on
822       *                           the operation should be interrupted.  It may be
823       *                           altered if desired.
824       * @param  entry             The entry targeted by the compare operation.
825       *
826       * @return  Information about the result of the plugin processing.
827       */
828      public PreOperationPluginResult doPreOperation(
829                  final ActiveOperationContext operationContext,
830                  final CompareRequest request, final UpdatableCompareResult result,
831                  final Entry entry)
832      {
833        // No processing is performed by default.
834        return PreOperationPluginResult.SUCCESS;
835      }
836    
837    
838    
839      /**
840       * Performs any processing which may be necessary before the server sends a
841       * response for a compare operation.
842       *
843       * @param  operationContext  The context for the compare operation.
844       * @param  request           The compare request that was processed.
845       * @param  result            The result to be returned to the client.  It may
846       *                           be altered if desired.
847       * @param  entry             The entry targeted by the compare operation, if
848       *                           it exists.
849       *
850       * @return  Information about the result of the plugin processing.
851       */
852      public PostOperationPluginResult doPostOperation(
853                  final ActiveOperationContext operationContext,
854                  final CompareRequest request, final UpdatableCompareResult result,
855                  final Entry entry)
856      {
857        // No processing is performed by default.
858        return PostOperationPluginResult.SUCCESS;
859      }
860    
861    
862    
863      /**
864       * Performs any processing which may be necessary after all other processing
865       * has been completed for a compare operation and the response has been sent
866       * to the client.
867       *
868       * @param  operationContext  The context for the compare operation.
869       * @param  request           The compare request that was processed.
870       * @param  result            The result that was returned to the client.
871       *
872       * @return  Information about the result of the plugin processing.
873       */
874      public PostResponsePluginResult doPostResponse(
875                  final CompletedOperationContext operationContext,
876                  final CompareRequest request, final CompareResult result)
877      {
878        // No processing is performed by default.
879        return PostResponsePluginResult.SUCCESS;
880      }
881    
882    
883    
884      /**
885       * Performs any processing which may be necessary before the server starts
886       * processing for a delete request.  This will be invoked only for delete
887       * operations requested directly by clients, but not for delete operations
888       * received from another server via replication.
889       *
890       * @param  operationContext  The context for the delete operation.
891       * @param  request           The delete request to be processed.  It may be
892       *                           altered if desired.
893       * @param  result            The result that will be returned to the client if
894       *                           the plugin result indicates that processing on
895       *                           the operation should be interrupted.  It may be
896       *                           altered if desired.
897       *
898       * @return  Information about the result of the plugin processing.
899       */
900      public PreParsePluginResult doPreParse(
901                  final ActiveOperationContext operationContext,
902                  final UpdatableDeleteRequest request,
903                  final UpdatableDeleteResult result)
904      {
905        // No processing is performed by default.
906        return PreParsePluginResult.SUCCESS;
907      }
908    
909    
910    
911      /**
912       * Performs any processing which may be necessary before the server actually
913       * attempts to remove the entry from the server.  This will be invoked only
914       * for delete operations requested directly by clients, but not for delete
915       * operations received from another server via replication.
916    
917       *
918       * @param  operationContext  The context for the delete operation.
919       * @param  request           The delete request to be processed.
920       * @param  result            The result that will be returned to the client if
921       *                           the plugin result indicates that processing on
922       *                           the operation should be interrupted.  It may be
923       *                           altered if desired.
924       * @param  entry             The entry targeted by the delete operation.
925       *
926       * @return  Information about the result of the plugin processing.
927       */
928      public PreOperationPluginResult doPreOperation(
929                  final ActiveOperationContext operationContext,
930                  final DeleteRequest request, final UpdatableDeleteResult result,
931                  final Entry entry)
932      {
933        // No processing is performed by default.
934        return PreOperationPluginResult.SUCCESS;
935      }
936    
937    
938    
939      /**
940       * Performs any processing which may be necessary before the server sends a
941       * response for a delete operation.  This will be invoked only for delete
942       * operations requested directly by clients, but not for delete operations
943       * received from another server via replication.
944    
945       *
946       * @param  operationContext  The context for the delete operation.
947       * @param  request           The delete request that was processed.
948       * @param  result            The result to be returned to the client.  It may
949       *                           be altered if desired.
950       * @param  entry             The entry targeted by the delete operation, if
951       *                           it exists.
952       *
953       * @return  Information about the result of the plugin processing.
954       */
955      public PostOperationPluginResult doPostOperation(
956                  final ActiveOperationContext operationContext,
957                  final DeleteRequest request, final UpdatableDeleteResult result,
958                  final Entry entry)
959      {
960        // No processing is performed by default.
961        return PostOperationPluginResult.SUCCESS;
962      }
963    
964    
965    
966      /**
967       * Performs any processing which may be necessary after all other processing
968       * has been completed for a delete operation and the response has been sent
969       * to the client.  This will be invoked only for delete operations requested
970       * directly by clients, but not for delete operations received from another
971       * server via replication.
972    
973       *
974       * @param  operationContext  The context for the delete operation.
975       * @param  request           The delete request that was processed.
976       * @param  result            The result that was returned to the client.
977       *
978       * @return  Information about the result of the plugin processing.
979       */
980      public PostResponsePluginResult doPostResponse(
981                  final CompletedOperationContext operationContext,
982                  final DeleteRequest request, final DeleteResult result)
983      {
984        // No processing is performed by default.
985        return PostResponsePluginResult.SUCCESS;
986      }
987    
988    
989    
990      /**
991       * Performs any processing which may be necessary after all other processing
992       * has been completed for a delete operation which has been received from
993       * another server via replication.
994       *
995       * @param  operationContext  The context for the delete operation.
996       * @param  request           The delete request that was processed.
997       * @param  result            The result that was returned to the client.
998       */
999      public void doPostReplication(
1000                       final CompletedOperationContext operationContext,
1001                       final DeleteRequest request, final DeleteResult result)
1002      {
1003        // No processing is performed by default.
1004      }
1005    
1006    
1007    
1008      /**
1009       * Performs any processing which may be necessary before the server starts
1010       * processing for an extended request.
1011       *
1012       * @param  operationContext  The context for the extended operation.
1013       * @param  request           The extended request to be processed.  It may be
1014       *                           altered if desired.
1015       * @param  result            The result that will be returned to the client if
1016       *                           the plugin result indicates that processing on
1017       *                           the operation should be interrupted.  It may be
1018       *                           altered if desired.
1019       *
1020       * @return  Information about the result of the plugin processing.
1021       */
1022      public PreParsePluginResult doPreParse(
1023                  final ActiveOperationContext operationContext,
1024                  final UpdatableExtendedRequest request,
1025                  final UpdatableExtendedResult result)
1026      {
1027        // No processing is performed by default.
1028        return PreParsePluginResult.SUCCESS;
1029      }
1030    
1031    
1032    
1033      /**
1034       * Performs any processing which may be necessary before the server actually
1035       * attempts to perform the core processing for the extended operation.
1036       *
1037       * @param  operationContext  The context for the extended operation.
1038       * @param  request           The extended request to be processed.
1039       * @param  result            The result that will be returned to the client if
1040       *                           the plugin result indicates that processing on
1041       *                           the operation should be interrupted.  It may be
1042       *                           altered if desired.
1043       *
1044       * @return  Information about the result of the plugin processing.
1045       */
1046      public PreOperationPluginResult doPreOperation(
1047                  final ActiveOperationContext operationContext,
1048                  final ExtendedRequest request,
1049                  final UpdatableExtendedResult result)
1050      {
1051        // No processing is performed by default.
1052        return PreOperationPluginResult.SUCCESS;
1053      }
1054    
1055    
1056    
1057      /**
1058       * Performs any processing which may be necessary before the server sends a
1059       * response for an extended operation.
1060       *
1061       * @param  operationContext  The context for the extended operation.
1062       * @param  request           The extended request that was processed.
1063       * @param  result            The result to be returned to the client.  It may
1064       *                           be altered if desired.
1065       *
1066       * @return  Information about the result of the plugin processing.
1067       */
1068      public PostOperationPluginResult doPostOperation(
1069                  final ActiveOperationContext operationContext,
1070                  final ExtendedRequest request,
1071                  final UpdatableExtendedResult result)
1072      {
1073        // No processing is performed by default.
1074        return PostOperationPluginResult.SUCCESS;
1075      }
1076    
1077    
1078    
1079      /**
1080       * Performs any processing which may be necessary after all other processing
1081       * has been completed for an extended operation and the response has been sent
1082       * to the client.
1083       *
1084       * @param  operationContext  The context for the extended operation.
1085       * @param  request           The extended request that was processed.
1086       * @param  result            The result that was returned to the client.
1087       *
1088       * @return  Information about the result of the plugin processing.
1089       */
1090      public PostResponsePluginResult doPostResponse(
1091                  final CompletedOperationContext operationContext,
1092                  final ExtendedRequest request, final ExtendedResult result)
1093      {
1094        // No processing is performed by default.
1095        return PostResponsePluginResult.SUCCESS;
1096      }
1097    
1098    
1099    
1100      /**
1101       * Performs any processing which may be necessary before the server starts
1102       * processing for a modify request.  This will be invoked only for modify
1103       * operations requested directly by clients, but not for modify operations
1104       * received from another server via replication.
1105       *
1106       * @param  operationContext  The context for the modify operation.
1107       * @param  request           The modify request to be processed.  It may be
1108       *                           altered if desired.
1109       * @param  result            The result that will be returned to the client if
1110       *                           the plugin result indicates that processing on
1111       *                           the operation should be interrupted.  It may be
1112       *                           altered if desired.
1113       *
1114       * @return  Information about the result of the plugin processing.
1115       */
1116      public PreParsePluginResult doPreParse(
1117                  final ActiveOperationContext operationContext,
1118                  final UpdatableModifyRequest request,
1119                  final UpdatableModifyResult result)
1120      {
1121        // No processing is performed by default.
1122        return PreParsePluginResult.SUCCESS;
1123      }
1124    
1125    
1126    
1127      /**
1128       * Performs any processing which may be necessary before the server actually
1129       * attempts to update the entry in the backend.  This will be invoked only for
1130       * modify operations requested directly by clients, but not for modify
1131       * operations received from another server via replication.
1132       *
1133       * @param  operationContext  The context for the modify operation.
1134       * @param  request           The modify request to be processed.
1135       * @param  result            The result that will be returned to the client if
1136       *                           the plugin result indicates that processing on
1137       *                           the operation should be interrupted.  It may be
1138       *                           altered if desired.
1139       * @param  oldEntry          The entry as it appeared before the modifications
1140       *                           were applied.
1141       * @param  newEntry          The updated entry as it will appear after the
1142       *                           modifications have been applied.
1143       *
1144       * @return  Information about the result of the plugin processing.
1145       */
1146      public PreOperationPluginResult doPreOperation(
1147                  final ActiveOperationContext operationContext,
1148                  final ModifyRequest request, final UpdatableModifyResult result,
1149                  final Entry oldEntry, final Entry newEntry)
1150      {
1151        // No processing is performed by default.
1152        return PreOperationPluginResult.SUCCESS;
1153      }
1154    
1155    
1156    
1157      /**
1158       * Performs any processing which may be necessary before the server sends a
1159       * response for a modify operation.  This will be invoked only for modify
1160       * operations requested directly by clients, but not for modify operations
1161       * received from another server via replication.
1162       *
1163       * @param  operationContext  The context for the modify operation.
1164       * @param  request           The modify request that was processed.
1165       * @param  result            The result to be returned to the client.  It may
1166       *                           be altered if desired.
1167       * @param  oldEntry          The entry as it appeared before the modifications
1168       *                           were applied, if it exists. .
1169       * @param  newEntry          The entry as it appears after the modifications
1170       *                           have been applied, if it exists. .
1171       *
1172       * @return  Information about the result of the plugin processing.
1173       */
1174      public PostOperationPluginResult doPostOperation(
1175                  final ActiveOperationContext operationContext,
1176                  final ModifyRequest request, final UpdatableModifyResult result,
1177                  final Entry oldEntry, final Entry newEntry)
1178      {
1179        // No processing is performed by default.
1180        return PostOperationPluginResult.SUCCESS;
1181      }
1182    
1183    
1184    
1185      /**
1186       * Performs any processing which may be necessary after all other processing
1187       * has been completed for a modify operation and the response has been sent
1188       * to the client.  This will be invoked only for modify operations requested
1189       * directly by clients, but not for modify operations received from another
1190       * server via replication.
1191       *
1192       * @param  operationContext  The context for the modify operation.
1193       * @param  request           The modify request that was processed.
1194       * @param  result            The result that was returned to the client.
1195       *
1196       * @return  Information about the result of the plugin processing.
1197       */
1198      public PostResponsePluginResult doPostResponse(
1199                  final CompletedOperationContext operationContext,
1200                  final ModifyRequest request, final ModifyResult result)
1201      {
1202        // No processing is performed by default.
1203        return PostResponsePluginResult.SUCCESS;
1204      }
1205    
1206    
1207    
1208      /**
1209       * Performs any processing which may be necessary after all other processing
1210       * has been completed for a modify operation which has been received from
1211       * another server via replication.
1212       *
1213       * @param  operationContext  The context for the modify operation.
1214       * @param  request           The modify request that was processed.
1215       * @param  result            The result that was returned to the client.
1216       */
1217      public void doPostReplication(
1218                       final CompletedOperationContext operationContext,
1219                       final ModifyRequest request, final ModifyResult result)
1220      {
1221        // No processing is performed by default.
1222      }
1223    
1224    
1225    
1226      /**
1227       * Performs any processing which may be necessary before the server starts
1228       * processing for a modify DN request.  This will be invoked only for modify
1229       * DN operations requested directly by clients, but not for modify DN
1230       * operations received from another server via replication.
1231       *
1232       * @param  operationContext  The context for the modify DN operation.
1233       * @param  request           The modify DN request to be processed.  It may be
1234       *                           altered if desired.
1235       * @param  result            The result that will be returned to the client if
1236       *                           the plugin result indicates that processing on
1237       *                           the operation should be interrupted.  It may be
1238       *                           altered if desired.
1239       *
1240       * @return  Information about the result of the plugin processing.
1241       */
1242      public PreParsePluginResult doPreParse(
1243                  final ActiveOperationContext operationContext,
1244                  final UpdatableModifyDNRequest request,
1245                  final UpdatableModifyDNResult result)
1246      {
1247        // No processing is performed by default.
1248        return PreParsePluginResult.SUCCESS;
1249      }
1250    
1251    
1252    
1253      /**
1254       * Performs any processing which may be necessary before the server actually
1255       * attempts to update the entry in the backend.  This will be invoked only for
1256       * modify DN operations requested directly by clients, but not for modify DN
1257       * operations received from another server via replication.
1258       *
1259       * @param  operationContext  The context for the modify DN operation.
1260       * @param  request           The modify DN request to be processed.
1261       * @param  result            The result that will be returned to the client if
1262       *                           the plugin result indicates that processing on
1263       *                           the operation should be interrupted.  It may be
1264       *                           altered if desired.
1265       * @param  oldEntry          The entry as it appeared before being renamed.
1266       * @param  newEntry          The updated entry as it will appear after it has
1267       *                           been renamed.
1268       *
1269       * @return  Information about the result of the plugin processing.
1270       */
1271      public PreOperationPluginResult doPreOperation(
1272                  final ActiveOperationContext operationContext,
1273                  final ModifyDNRequest request,
1274                  final UpdatableModifyDNResult result, final Entry oldEntry,
1275                  final Entry newEntry)
1276      {
1277        // No processing is performed by default.
1278        return PreOperationPluginResult.SUCCESS;
1279      }
1280    
1281    
1282    
1283      /**
1284       * Performs any processing which may be necessary during the course of
1285       * renaming an entry which is subordinate to an entry targeted by a modify DN
1286       * operation.  This will be invoked only for both modify DN operations
1287       * requested by clients and for modify DN operations received from another
1288       * server via replication.
1289       *
1290       * @param  operationContext         The context for the modify DN operation.
1291       * @param  request                  The modify DN request being processed.
1292       * @param  result                   The result that will be returned to the
1293       *                                  client if the plugin result indicates that
1294       *                                  processing on the operation should be
1295       *                                  interrupted.  It may be altered if
1296       *                                  desired.
1297       * @param  oldSubordinateEntry      The subordinate entry as it appeared
1298       *                                  before being renamed.
1299       * @param  newSubordinateEntry      The subordinate entry as it will appear
1300       *                                  after being renamed.
1301       * @param  additionalModifications  A list of additional modifications that
1302       *                                  should be applied to the entry as it is
1303       *                                  renamed.  This list may be altered if
1304       *                                  desired.
1305       *
1306       * @return  Information about the result of the plugin processing.
1307       */
1308      public SubordinateModifyDNPluginResult doSubordinateModifyDN(
1309                  final ActiveOperationContext operationContext,
1310                  final ModifyDNRequest request,
1311                  final UpdatableModifyDNResult result,
1312                  final Entry oldSubordinateEntry,
1313                  final Entry newSubordinateEntry,
1314                  final List<Modification> additionalModifications)
1315      {
1316        // No processing is performed by default.
1317        return SubordinateModifyDNPluginResult.SUCCESS;
1318      }
1319    
1320    
1321    
1322      /**
1323       * Performs any processing which may be necessary before the server sends a
1324       * response for a modify DN operation.  This will be invoked only for modify
1325       * DN operations requested directly by clients, but not for modify DN
1326       * operations received from another server via replication.
1327       *
1328       * @param  operationContext  The context for the modify DN operation.
1329       * @param  request           The modify DN request that was processed.
1330       * @param  result            The result to be returned to the client.  It may
1331       *                           be altered if desired.
1332       * @param  oldEntry          The entry as it appeared before it was renamed,
1333       *                           if it exists.
1334       * @param  newEntry          The entry as it appears after it was renamed, if
1335       *                           it exists. .
1336       *
1337       * @return  Information about the result of the plugin processing.
1338       */
1339      public PostOperationPluginResult doPostOperation(
1340                  final ActiveOperationContext operationContext,
1341                  final ModifyDNRequest request,
1342                  final UpdatableModifyDNResult result, final Entry oldEntry,
1343                  final Entry newEntry)
1344      {
1345        // No processing is performed by default.
1346        return PostOperationPluginResult.SUCCESS;
1347      }
1348    
1349    
1350    
1351      /**
1352       * Performs any processing which may be necessary after all other processing
1353       * has been completed for a modify DN operation and the response has been
1354       * sent to the client.  This will be invoked only for modify DN operations
1355       * requested directly by clients, but not for modify DN operations received
1356       * from another server via replication.
1357       *
1358       * @param  operationContext  The context for the modify DN operation.
1359       * @param  request           The modify DN request that was processed.
1360       * @param  result            The result that was returned to the client.
1361       *
1362       * @return  Information about the result of the plugin processing.
1363       */
1364      public PostResponsePluginResult doPostResponse(
1365                  final CompletedOperationContext operationContext,
1366                  final ModifyDNRequest request, final ModifyDNResult result)
1367      {
1368        // No processing is performed by default.
1369        return PostResponsePluginResult.SUCCESS;
1370      }
1371    
1372    
1373    
1374      /**
1375       * Performs any processing which may be necessary after all other processing
1376       * has been completed for a modify DN operation which has been received from
1377       * another server via replication.
1378       *
1379       * @param  operationContext  The context for the modify DN operation.
1380       * @param  request           The modify DN request that was processed.
1381       * @param  result            The result that was returned to the client.
1382       */
1383      public void doPostReplication(
1384                       final CompletedOperationContext operationContext,
1385                       final ModifyDNRequest request, final ModifyDNResult result)
1386      {
1387        // No processing is performed by default.
1388      }
1389    
1390    
1391    
1392      /**
1393       * Performs any processing which may be necessary before the server starts
1394       * processing for a search request.
1395       *
1396       * @param  operationContext  The context for the search operation.
1397       * @param  request           The search request to be processed.  It may be
1398       *                           altered if desired.
1399       * @param  result            The result that will be returned to the client if
1400       *                           the plugin result indicates that processing on
1401       *                           the operation should be interrupted.  It may be
1402       *                           altered if desired.
1403       *
1404       * @return  Information about the result of the plugin processing.
1405       */
1406      public PreParsePluginResult doPreParse(
1407                  final ActiveSearchOperationContext operationContext,
1408                  final UpdatableSearchRequest request,
1409                  final UpdatableSearchResult result)
1410      {
1411        // No processing is performed by default.
1412        return PreParsePluginResult.SUCCESS;
1413      }
1414    
1415    
1416    
1417      /**
1418       * Performs any processing which may be necessary before the server actually
1419       * attempts to process the search in the backend.
1420       *
1421       * @param  operationContext  The context for the search operation.
1422       * @param  request           The search request to be processed.
1423       * @param  result            The result that will be returned to the client if
1424       *                           the plugin result indicates that processing on
1425       *                           the operation should be interrupted.  It may be
1426       *                           altered if desired.
1427       *
1428       * @return  Information about the result of the plugin processing.
1429       */
1430      public PreOperationPluginResult doPreOperation(
1431                  final ActiveSearchOperationContext operationContext,
1432                  final SearchRequest request, final UpdatableSearchResult result)
1433      {
1434        // No processing is performed by default.
1435        return PreOperationPluginResult.SUCCESS;
1436      }
1437    
1438    
1439    
1440      /**
1441       * Performs any processing which may be necessary before the server sends a
1442       * search result entry to the client.
1443       *
1444       * @param  operationContext  The context for the search operation.
1445       * @param  request           The search request being processed.
1446       * @param  result            The result that will be returned to the client if
1447       *                           the plugin result indicates that processing on
1448       *                           the operation should be interrupted.  It may be
1449       *                           altered if desired.
1450       * @param  entry             The entry to be returned to the client.  It may
1451       *                           be altered if desired.
1452       * @param  controls          The set of controls to be included with the
1453       *                           entry.  It may be altered if desired.
1454       *
1455       * @return  Information about the result of the plugin processing.
1456       */
1457      public SearchEntryPluginResult doSearchEntry(
1458                  final ActiveSearchOperationContext operationContext,
1459                  final SearchRequest request, final UpdatableSearchResult result,
1460                  final UpdatableEntry entry, final List<Control> controls)
1461      {
1462        // No processing is performed by default.
1463        return SearchEntryPluginResult.SUCCESS;
1464      }
1465    
1466    
1467    
1468      /**
1469       * Performs any processing which may be necessary before the server sends a
1470       * search result reference to the client.
1471       *
1472       * @param  operationContext  The context for the search operation.
1473       * @param  request           The search request being processed.
1474       * @param  result            The result that will be returned to the client if
1475       *                           the plugin result indicates that processing on
1476       *                           the operation should be interrupted.  It may be
1477       *                           altered if desired.
1478       * @param  referralURLs      The set of referral URLs to be returned to the
1479       *                           client.  It may be altered if desired.
1480       * @param  controls          The set of controls to be included with the
1481       *                           reference.  It may be altered if desired.
1482       *
1483       * @return  Information about the result of the plugin processing.
1484       */
1485      public SearchReferencePluginResult doSearchReference(
1486                  final ActiveSearchOperationContext operationContext,
1487                  final SearchRequest request, final UpdatableSearchResult result,
1488                  final List<String> referralURLs, final List<Control> controls)
1489      {
1490        // No processing is performed by default.
1491        return SearchReferencePluginResult.SUCCESS;
1492      }
1493    
1494    
1495    
1496      /**
1497       * Performs any processing which may be necessary before the server sends a
1498       * response for a search operation.
1499       *
1500       * @param  operationContext  The context for the search operation.
1501       * @param  request           The search request that was processed.
1502       * @param  result            The result to be returned to the client.  It may
1503       *                           be altered if desired.
1504       *
1505       * @return  Information about the result of the plugin processing.
1506       */
1507      public PostOperationPluginResult doPostOperation(
1508                  final ActiveSearchOperationContext operationContext,
1509                  final SearchRequest request, final UpdatableSearchResult result)
1510      {
1511        // No processing is performed by default.
1512        return PostOperationPluginResult.SUCCESS;
1513      }
1514    
1515    
1516    
1517      /**
1518       * Performs any processing which may be necessary after all other processing
1519       * has been completed for a search operation and the response has been sent to
1520       * the client.
1521       *
1522       * @param  operationContext  The context for the search operation.
1523       * @param  request           The search request that was processed.
1524       * @param  result            The result that was returned to the client.
1525       *
1526       * @return  Information about the result of the plugin processing.
1527       */
1528      public PostResponsePluginResult doPostResponse(
1529                  final CompletedSearchOperationContext operationContext,
1530                  final SearchRequest request, final SearchResult result)
1531      {
1532        // No processing is performed by default.
1533        return PostResponsePluginResult.SUCCESS;
1534      }
1535    
1536    
1537    
1538      /**
1539       * Performs any processing which may be necessary before the server starts
1540       * processing for an unbind request.
1541       *
1542       * @param  operationContext  The context for the unbind operation.
1543       * @param  request           The unbind request to be processed.  It may be
1544       *                           altered if desired.
1545       *
1546       * @return  Information about the result of the plugin processing.
1547       */
1548      public PreParsePluginResult doPreParse(
1549                  final ActiveOperationContext operationContext,
1550                  final UpdatableUnbindRequest request)
1551      {
1552        // No processing is performed by default.
1553        return PreParsePluginResult.SUCCESS;
1554      }
1555    
1556    
1557    
1558      /**
1559       * Performs any processing which may be necessary before the server sends an
1560       * intermediate response to the client.
1561       *
1562       * @param  operationContext      The context for the associated operation.
1563       * @param  result                The result that will be returned to the
1564       *                               client if the plugin result indicates that
1565       *                               processing on the operation should be
1566       *                               interrupted.  It may be altered if desired.
1567       * @param  intermediateResponse  The intermediate response to be returned to
1568       *                               the client.  It may be altered if desired.
1569       *
1570       * @return  Information about the result of the plugin processing.
1571       */
1572      public IntermediateResponsePluginResult doIntermediateResponse(
1573                  final ActiveOperationContext operationContext,
1574                  final UpdatableGenericResult result,
1575                  final IntermediateResponse intermediateResponse)
1576      {
1577        // No processing is performed by default.
1578        return IntermediateResponsePluginResult.SUCCESS;
1579      }
1580    
1581    
1582    
1583      /**
1584       * {@inheritDoc}
1585       */
1586      public Map<List<String>,String> getExamplesArgumentSets()
1587      {
1588        return Collections.emptyMap();
1589      }
1590    }