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