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