001    /*
002     * CDDL HEADER START
003     *
004     * The contents of this file are subject to the terms of the
005     * Common Development and Distribution License, Version 1.0 only
006     * (the "License").  You may not use this file except in compliance
007     * with the License.
008     *
009     * You can obtain a copy of the license at
010     * docs/licenses/cddl.txt
011     * or http://www.opensource.org/licenses/cddl1.php.
012     * See the License for the specific language governing permissions
013     * and limitations under the License.
014     *
015     * When distributing Covered Code, include this CDDL HEADER in each
016     * file and include the License file at
017     * docs/licenses/cddl.txt.  If applicable,
018     * add the following below this CDDL HEADER, with the fields enclosed
019     * by brackets "[]" replaced with your own identifying information:
020     *      Portions Copyright [yyyy] [name of copyright owner]
021     *
022     * CDDL HEADER END
023     *
024     *
025     *      Copyright 2010-2013 UnboundID Corp.
026     */
027    package com.unboundid.directory.sdk.common.scripting;
028    
029    
030    
031    import java.security.cert.Certificate;
032    import java.util.List;
033    
034    import com.unboundid.directory.sdk.common.config.AccessLoggerConfig;
035    import com.unboundid.directory.sdk.common.internal.Reconfigurable;
036    import com.unboundid.directory.sdk.common.operation.AbandonRequest;
037    import com.unboundid.directory.sdk.common.operation.AddRequest;
038    import com.unboundid.directory.sdk.common.operation.AddResult;
039    import com.unboundid.directory.sdk.common.operation.BindResult;
040    import com.unboundid.directory.sdk.common.operation.CompareRequest;
041    import com.unboundid.directory.sdk.common.operation.CompareResult;
042    import com.unboundid.directory.sdk.common.operation.DeleteRequest;
043    import com.unboundid.directory.sdk.common.operation.DeleteResult;
044    import com.unboundid.directory.sdk.common.operation.ExtendedRequest;
045    import com.unboundid.directory.sdk.common.operation.ExtendedResult;
046    import com.unboundid.directory.sdk.common.operation.GenericResult;
047    import com.unboundid.directory.sdk.common.operation.ModifyRequest;
048    import com.unboundid.directory.sdk.common.operation.ModifyResult;
049    import com.unboundid.directory.sdk.common.operation.ModifyDNRequest;
050    import com.unboundid.directory.sdk.common.operation.ModifyDNResult;
051    import com.unboundid.directory.sdk.common.operation.SASLBindRequest;
052    import com.unboundid.directory.sdk.common.operation.SearchRequest;
053    import com.unboundid.directory.sdk.common.operation.SearchResult;
054    import com.unboundid.directory.sdk.common.operation.SimpleBindRequest;
055    import com.unboundid.directory.sdk.common.operation.UnbindRequest;
056    import com.unboundid.directory.sdk.common.types.ClientContext;
057    import com.unboundid.directory.sdk.common.types.CompletedOperationContext;
058    import com.unboundid.directory.sdk.common.types.CompletedSearchOperationContext;
059    import com.unboundid.directory.sdk.common.types.DisconnectReason;
060    import com.unboundid.directory.sdk.common.types.Entry;
061    import com.unboundid.directory.sdk.common.types.ForwardTarget;
062    import com.unboundid.directory.sdk.common.types.OperationContext;
063    import com.unboundid.directory.sdk.common.types.ServerContext;
064    import com.unboundid.directory.sdk.ds.internal.DirectoryServerExtension;
065    import com.unboundid.directory.sdk.metrics.internal.MetricsEngineExtension;
066    import com.unboundid.directory.sdk.proxy.internal.DirectoryProxyServerExtension;
067    import com.unboundid.directory.sdk.sync.internal.SynchronizationServerExtension;
068    import com.unboundid.ldap.sdk.Control;
069    import com.unboundid.ldap.sdk.IntermediateResponse;
070    import com.unboundid.ldap.sdk.LDAPException;
071    import com.unboundid.ldap.sdk.ResultCode;
072    import com.unboundid.util.Extensible;
073    import com.unboundid.util.ThreadSafety;
074    import com.unboundid.util.ThreadSafetyLevel;
075    import com.unboundid.util.args.ArgumentException;
076    import com.unboundid.util.args.ArgumentParser;
077    
078    
079    
080    /**
081     * This class defines an API that must be implemented by scripted extensions
082     * which record information about interaction with clients, including
083     * connections established and received and operations requested and completed.
084     * <BR><BR>
085     * Access loggers will be invoked for the following events:
086     * <UL>
087     *   <LI>Whenever a new connection is established.</LI>
088     *   <LI>Whenever an existing connection is closed or terminated.</LI>
089     *   <LI>Whenever an abandon, add, bind, compare, delete, extended, modify,
090     *       modify DN, search, or unbind request is received.</LI>
091     *   <LI>Whenever an abandon, add, bind, compare, delete, extended, modify,
092     *       modify DN, or search request is forwarded to another server for
093     *       processing.</LI>
094     *   <LI>If a forwarded add, bind, compare, delete, extended, modify, modify DN,
095     *       or search operation fails.</LI>
096     *   <LI>After sending the result for an add, bind, compare, delete, extended,
097     *       modify, modify DN, or search operation.</LI>
098     *   <LI>After completing processing for an abandon operation.</LI>
099     *   <LI>After sending a search result entry, search result reference, or
100     *       intermediate response message to the client.</LI>
101     * </UL>
102     * <BR><BR>
103     * Each access logger may configured to indicate whether to include or exclude
104     * internal and/or replicated operations, and criteria may be used to provide
105     * filtered logging.  This is handled automatically by the server, so individual
106     * access logger implementations do not need to attempt to perform that
107     * filtering on their own.  However, they may perform additional processing if
108     * desired to further narrow the set of messages that should be logged.
109     * <BR>
110     * <H2>Configuring Groovy-Scripted Access Loggers</H2>
111     * In order to configure a scripted access logger based on this API and written
112     * in the Groovy scripting language, use a command
113     * like:
114     * <PRE>
115     *      dsconfig create-log-publisher \
116     *           --publisher-name "<I>{logger-name}</I>" \
117     *           --type groovy-scripted-access \
118     *           --set enabled:true \
119     *           --set "script-class:<I>{class-name}</I>" \
120     *           --set "script-argument:<I>{name=value}</I>"
121     * </PRE>
122     * where "<I>{logger-name}</I>" is the name to use for the access logger
123     * instance, "<I>{class-name}</I>" is the fully-qualified name of the Groovy
124     * class written using this API, and "<I>{name=value}</I>" represents name-value
125     * pairs for any arguments to provide to the logger.  If multiple arguments
126     * should be provided to the logger, then the
127     * "<CODE>--set script-argument:<I>{name=value}</I></CODE>" option should be
128     * provided multiple times.
129     *
130     * @see  com.unboundid.directory.sdk.common.api.AccessLogger
131     * @see  com.unboundid.directory.sdk.common.api.FileBasedAccessLogger
132     * @see  ScriptedFileBasedAccessLogger
133     */
134    @Extensible()
135    @DirectoryServerExtension()
136    @DirectoryProxyServerExtension(appliesToLocalContent=true,
137         appliesToRemoteContent=false)
138    @SynchronizationServerExtension(appliesToLocalContent=true,
139         appliesToSynchronizedContent=false)
140    @MetricsEngineExtension()
141    @ThreadSafety(level=ThreadSafetyLevel.INTERFACE_THREADSAFE)
142    public abstract class ScriptedAccessLogger
143           implements Reconfigurable<AccessLoggerConfig>
144    {
145      /**
146       * Creates a new instance of this access logger.  All access logger
147       * implementations must include a default constructor, but any initialization
148       * should generally be done in the {@code initializeAccessLogger} method.
149       */
150      public ScriptedAccessLogger()
151      {
152        // No implementation is required.
153      }
154    
155    
156    
157      /**
158       * {@inheritDoc}
159       */
160      public void defineConfigArguments(final ArgumentParser parser)
161             throws ArgumentException
162      {
163        // No arguments will be allowed by default.
164      }
165    
166    
167    
168      /**
169       * Initializes this access logger.
170       *
171       * @param  serverContext  A handle to the server context for the server in
172       *                        which this extension is running.
173       * @param  config         The general configuration for this access logger.
174       * @param  parser         The argument parser which has been initialized from
175       *                        the configuration for this access logger.
176       *
177       * @throws  LDAPException  If a problem occurs while initializing this
178       *                         access logger.
179       */
180      public void initializeAccessLogger(final ServerContext serverContext,
181                                         final AccessLoggerConfig config,
182                                         final ArgumentParser parser)
183             throws LDAPException
184      {
185        // No initialization will be performed by default.
186      }
187    
188    
189    
190      /**
191       * Performs any cleanup which may be necessary when this access logger is to
192       * be taken out of service.
193       */
194      public void finalizeAccessLogger()
195      {
196        // No implementation is required.
197      }
198    
199    
200    
201      /**
202       * {@inheritDoc}
203       */
204      public boolean isConfigurationAcceptable(final AccessLoggerConfig config,
205                          final ArgumentParser parser,
206                          final List<String> unacceptableReasons)
207      {
208        // No extended validation will be performed.
209        return true;
210      }
211    
212    
213    
214      /**
215       * {@inheritDoc}
216       */
217      public ResultCode applyConfiguration(final AccessLoggerConfig config,
218                                           final ArgumentParser parser,
219                                           final List<String> adminActionsRequired,
220                                           final List<String> messages)
221      {
222        // By default, no configuration changes will be applied.  If there are any
223        // arguments, then add an admin action message indicating that the extension
224        // needs to be restarted for any changes to take effect.
225        if (! parser.getNamedArguments().isEmpty())
226        {
227          adminActionsRequired.add(
228               "No configuration change has actually been applied.  The new " +
229                    "configuration will not take effect until this access logger " +
230                    "is disabled and re-enabled or until the server is restarted.");
231        }
232    
233        return ResultCode.SUCCESS;
234      }
235    
236    
237    
238      /**
239       * Logs a message indicating that a new connection has been established.
240       *
241       * @param  clientContext  Information about the client connection that has
242       *                        been accepted.
243       */
244      public void logConnect(final ClientContext clientContext)
245      {
246        // No action will be taken by default.
247      }
248    
249    
250    
251      /**
252       * Logs a message indicating that a connection has been closed.
253       *
254       * @param  clientContext     Information about the client connection that has
255       *                           been closed.
256       * @param  disconnectReason  A general reason that the connection has been
257       *                           closed.
258       * @param  message           A message with additional information about the
259       *                           closure.  It may be {@code null} if none is
260       *                           available.
261       */
262      public void logDisconnect(final ClientContext clientContext,
263                                final DisconnectReason disconnectReason,
264                                final String message)
265      {
266        // No action will be taken by default.
267      }
268    
269    
270    
271      /**
272       * Logs a message about a certificate chain presented by a client.
273       *
274       * @param  clientContext  Information about the client that presented the
275       *                        certificate chain.
276       * @param  certChain      The certificate chain presented by the client.
277       * @param  authDN         The DN of the user as whom the client was
278       *                        automatically authenticated, or {@code null} if the
279       *                        client was not automatically authenticated.
280       */
281      public void logClientCertificateChain(final ClientContext clientContext,
282                                            final Certificate[] certChain,
283                                            final String authDN)
284      {
285        // No action will be taken by default.
286      }
287    
288    
289    
290      /**
291       * Logs a message about an abandon request received from a client.
292       *
293       * @param  opContext  The operation context for the abandon operation.
294       * @param  request    The abandon request that was received.
295       */
296      public void logAbandonRequest(final OperationContext opContext,
297                                    final AbandonRequest request)
298      {
299        // No action will be taken by default.
300      }
301    
302    
303    
304      /**
305       * Logs a message about an abandon request that will be forwarded to another
306       * server.
307       *
308       * @param  opContext  The operation context for the abandon operation.
309       * @param  request    The abandon request that was received.
310       * @param  target     Information about the server to which the request will
311       *                    be forwarded.
312       */
313      public void logAbandonForward(final OperationContext opContext,
314                                    final AbandonRequest request,
315                                    final ForwardTarget target)
316      {
317        // No action will be taken by default.
318      }
319    
320    
321    
322      /**
323       * Logs a message about the result of processing an abandon request.
324       *
325       * @param  opContext  The operation context for the abandon operation.
326       * @param  request    The abandon request that was received.
327       * @param  result     The result of processing the abandon request.
328       */
329      public void logAbandonResult(final CompletedOperationContext opContext,
330                                   final AbandonRequest request,
331                                   final GenericResult result)
332      {
333        // No action will be taken by default.
334      }
335    
336    
337    
338      /**
339       * Logs a message about an add request received from a client.
340       *
341       * @param  opContext  The operation context for the add operation.
342       * @param  request    The add request that was received.
343       */
344      public void logAddRequest(final OperationContext opContext,
345                                final AddRequest request)
346      {
347        // No action will be taken by default.
348      }
349    
350    
351    
352      /**
353       * Logs a message about an add request that will be forwarded to another
354       * server.
355       *
356       * @param  opContext  The operation context for the add operation.
357       * @param  request    The add request that was received.
358       * @param  target     Information about the server to which the request will
359       *                    be forwarded.
360       */
361      public void logAddForward(final OperationContext opContext,
362                                final AddRequest request,
363                                final ForwardTarget target)
364      {
365        // No action will be taken by default.
366      }
367    
368    
369    
370      /**
371       * Logs a message about a failure encountered while attempting to forward an
372       * add request to another server.
373       *
374       * @param  opContext  The operation context for the add operation.
375       * @param  request    The add request that was received.
376       * @param  target     Information about the server to which the request was
377       *                    forwarded.
378       * @param  failure    The exception that was received when attempting to
379       *                    forward the request.
380       */
381      public void logAddForwardFailure(final OperationContext opContext,
382                                       final AddRequest request,
383                                       final ForwardTarget target,
384                                       final LDAPException failure)
385      {
386        // No action will be taken by default.
387      }
388    
389    
390    
391      /**
392       * Logs a message about the result of processing an add request.
393       *
394       * @param  opContext  The operation context for the add operation.
395       * @param  request    The add request that was received.
396       * @param  result     The result of processing the add request.
397       */
398      public void logAddResponse(final CompletedOperationContext opContext,
399                                 final AddRequest request,
400                                 final AddResult result)
401      {
402        // No action will be taken by default.
403      }
404    
405    
406    
407      /**
408       * Logs a message about a simple bind request received from a client.
409       *
410       * @param  opContext  The operation context for the bind operation.
411       * @param  request    The bind request that was received.
412       */
413      public void logBindRequest(final OperationContext opContext,
414                                 final SimpleBindRequest request)
415      {
416        // No action will be taken by default.
417      }
418    
419    
420    
421      /**
422       * Logs a message about a simple bind request that will be forwarded to
423       * another server.
424       *
425       * @param  opContext  The operation context for the bind operation.
426       * @param  request    The bind request that was received.
427       * @param  target     Information about the server to which the request will
428       *                    be forwarded.
429       */
430      public void logBindForward(final OperationContext opContext,
431                                    final SimpleBindRequest request,
432                                    final ForwardTarget target)
433      {
434        // No action will be taken by default.
435      }
436    
437    
438    
439      /**
440       * Logs a message about a failure encountered while attempting to forward a
441       * simple bind request to another server.
442       *
443       * @param  opContext  The operation context for the bind operation.
444       * @param  request    The bind request that was received.
445       * @param  target     Information about the server to which the request was
446       *                    forwarded.
447       * @param  failure    The exception that was received when attempting to
448       *                    forward the request.
449       */
450      public void logBindForwardFailure(final OperationContext opContext,
451                                        final SimpleBindRequest request,
452                                        final ForwardTarget target,
453                                        final LDAPException failure)
454      {
455        // No action will be taken by default.
456      }
457    
458    
459    
460      /**
461       * Logs a message about the result of processing a simple bind request.
462       *
463       * @param  opContext  The operation context for the bind operation.
464       * @param  request    The bind request that was received.
465       * @param  result     The result of processing the bind request.
466       */
467      public void logBindResponse(final CompletedOperationContext opContext,
468                                  final SimpleBindRequest request,
469                                  final BindResult result)
470      {
471        // No action will be taken by default.
472      }
473    
474    
475    
476      /**
477       * Logs a message about a SASL bind request received from a client.
478       *
479       * @param  opContext  The operation context for the bind operation.
480       * @param  request    The bind request that was received.
481       */
482      public void logBindRequest(final OperationContext opContext,
483                                 final SASLBindRequest request)
484      {
485        // No action will be taken by default.
486      }
487    
488    
489    
490      /**
491       * Logs a message about a SASL bind request that will be forwarded to
492       * another server.
493       *
494       * @param  opContext  The operation context for the bind operation.
495       * @param  request    The bind request that was received.
496       * @param  target     Information about the server to which the request will
497       *                    be forwarded.
498       */
499      public void logBindForward(final OperationContext opContext,
500                                    final SASLBindRequest request,
501                                    final ForwardTarget target)
502      {
503        // No action will be taken by default.
504      }
505    
506    
507    
508      /**
509       * Logs a message about a failure encountered while attempting to forward a
510       * SASL bind request to another server.
511       *
512       * @param  opContext  The operation context for the bind operation.
513       * @param  request    The bind request that was received.
514       * @param  target     Information about the server to which the request was
515       *                    forwarded.
516       * @param  failure    The exception that was received when attempting to
517       *                    forward the request.
518       */
519      public void logBindForwardFailure(final OperationContext opContext,
520                                        final SASLBindRequest request,
521                                        final ForwardTarget target,
522                                        final LDAPException failure)
523      {
524        // No action will be taken by default.
525      }
526    
527    
528    
529      /**
530       * Logs a message about the result of processing a SASL bind request.
531       *
532       * @param  opContext  The operation context for the bind operation.
533       * @param  request    The bind request that was received.
534       * @param  result     The result of processing the bind request.
535       */
536      public void logBindResponse(final CompletedOperationContext opContext,
537                                  final SASLBindRequest request,
538                                  final BindResult result)
539      {
540        // No action will be taken by default.
541      }
542    
543    
544    
545      /**
546       * Logs a message about a compare request received from a client.
547       *
548       * @param  opContext  The operation context for the compare operation.
549       * @param  request    The compare request that was received.
550       */
551      public void logCompareRequest(final OperationContext opContext,
552                                    final CompareRequest request)
553      {
554        // No action will be taken by default.
555      }
556    
557    
558    
559      /**
560       * Logs a message about a compare request that will be forwarded to another
561       * server.
562       *
563       * @param  opContext  The operation context for the compare operation.
564       * @param  request    The compare request that was received.
565       * @param  target     Information about the server to which the request will
566       *                    be forwarded.
567       */
568      public void logCompareForward(final OperationContext opContext,
569                                    final CompareRequest request,
570                                    final ForwardTarget target)
571      {
572        // No action will be taken by default.
573      }
574    
575    
576    
577      /**
578       * Logs a message about a failure encountered while attempting to forward a
579       * compare request to another server.
580       *
581       * @param  opContext  The operation context for the compare operation.
582       * @param  request    The compare request that was received.
583       * @param  target     Information about the server to which the request was
584       *                    forwarded.
585       * @param  failure    The exception that was received when attempting to
586       *                    forward the request.
587       */
588      public void logCompareForwardFailure(final OperationContext opContext,
589                                           final CompareRequest request,
590                                           final ForwardTarget target,
591                                           final LDAPException failure)
592      {
593        // No action will be taken by default.
594      }
595    
596    
597    
598      /**
599       * Logs a message about the result of processing a compare request.
600       *
601       * @param  opContext  The operation context for the compare operation.
602       * @param  request    The compare request that was received.
603       * @param  result     The result of processing the compare request.
604       */
605      public void logCompareResponse(final CompletedOperationContext opContext,
606                                     final CompareRequest request,
607                                     final CompareResult result)
608      {
609        // No action will be taken by default.
610      }
611    
612    
613    
614      /**
615       * Logs a message about a delete request received from a client.
616       *
617       * @param  opContext  The operation context for the delete operation.
618       * @param  request    The delete request that was received.
619       */
620      public void logDeleteRequest(final OperationContext opContext,
621                                   final DeleteRequest request)
622      {
623        // No action will be taken by default.
624      }
625    
626    
627    
628      /**
629       * Logs a message about a delete request that will be forwarded to another
630       * server.
631       *
632       * @param  opContext  The operation context for the delete operation.
633       * @param  request    The delete request that was received.
634       * @param  target     Information about the server to which the request will
635       *                    be forwarded.
636       */
637      public void logDeleteForward(final OperationContext opContext,
638                                   final DeleteRequest request,
639                                   final ForwardTarget target)
640      {
641        // No action will be taken by default.
642      }
643    
644    
645    
646      /**
647       * Logs a message about a failure encountered while attempting to forward a
648       * delete request to another server.
649       *
650       * @param  opContext  The operation context for the delete operation.
651       * @param  request    The delete request that was received.
652       * @param  target     Information about the server to which the request was
653       *                    forwarded.
654       * @param  failure    The exception that was received when attempting to
655       *                    forward the request.
656       */
657      public void logDeleteForwardFailure(final OperationContext opContext,
658                                          final DeleteRequest request,
659                                          final ForwardTarget target,
660                                          final LDAPException failure)
661      {
662        // No action will be taken by default.
663      }
664    
665    
666    
667      /**
668       * Logs a message about the result of processing a delete request.
669       *
670       * @param  opContext  The operation context for the delete operation.
671       * @param  request    The delete request that was received.
672       * @param  result     The result of processing the delete request.
673       */
674      public void logDeleteResponse(final CompletedOperationContext opContext,
675                                    final DeleteRequest request,
676                                    final DeleteResult result)
677      {
678        // No action will be taken by default.
679      }
680    
681    
682    
683      /**
684       * Logs a message about an extended request received from a client.
685       *
686       * @param  opContext  The operation context for the extended operation.
687       * @param  request    The extended request that was received.
688       */
689      public void logExtendedRequest(final OperationContext opContext,
690                                     final ExtendedRequest request)
691      {
692        // No action will be taken by default.
693      }
694    
695    
696    
697      /**
698       * Logs a message about an extended request that will be forwarded to another
699       * server.
700       *
701       * @param  opContext  The operation context for the extended operation.
702       * @param  request    The extended request that was received.
703       * @param  target     Information about the server to which the request will
704       *                    be forwarded.
705       */
706      public void logExtendedForward(final OperationContext opContext,
707                                     final ExtendedRequest request,
708                                     final ForwardTarget target)
709      {
710        // No action will be taken by default.
711      }
712    
713    
714    
715      /**
716       * Logs a message about a failure encountered while attempting to forward an
717       * extended request to another server.
718       *
719       * @param  opContext  The operation context for the extended operation.
720       * @param  request    The extended request that was received.
721       * @param  target     Information about the server to which the request was
722       *                    forwarded.
723       * @param  failure    The exception that was received when attempting to
724       *                    forward the request.
725       */
726      public void logExtendedForwardFailure(final OperationContext opContext,
727                                            final ExtendedRequest request,
728                                            final ForwardTarget target,
729                                            final LDAPException failure)
730      {
731        // No action will be taken by default.
732      }
733    
734    
735    
736      /**
737       * Logs a message about the result of processing an extended request.
738       *
739       * @param  opContext  The operation context for the extended operation.
740       * @param  request    The extended request that was received.
741       * @param  result     The result of processing the extended request.
742       */
743      public void logExtendedResponse(final CompletedOperationContext opContext,
744                                      final ExtendedRequest request,
745                                      final ExtendedResult result)
746      {
747        // No action will be taken by default.
748      }
749    
750    
751    
752      /**
753       * Logs a message about a modify request received from a client.
754       *
755       * @param  opContext  The operation context for the modify operation.
756       * @param  request    The modify request that was received.
757       */
758      public void logModifyRequest(final OperationContext opContext,
759                                   final ModifyRequest request)
760      {
761        // No action will be taken by default.
762      }
763    
764    
765    
766      /**
767       * Logs a message about a modify request that will be forwarded to another
768       * server.
769       *
770       * @param  opContext  The operation context for the modify operation.
771       * @param  request    The modify request that was received.
772       * @param  target     Information about the server to which the request will
773       *                    be forwarded.
774       */
775      public void logModifyForward(final OperationContext opContext,
776                                   final ModifyRequest request,
777                                   final ForwardTarget target)
778      {
779        // No action will be taken by default.
780      }
781    
782    
783    
784      /**
785       * Logs a message about a failure encountered while attempting to forward a
786       * modify request to another server.
787       *
788       * @param  opContext  The operation context for the modify operation.
789       * @param  request    The modify request that was received.
790       * @param  target     Information about the server to which the request was
791       *                    forwarded.
792       * @param  failure    The exception that was received when attempting to
793       *                    forward the request.
794       */
795      public void logModifyForwardFailure(final OperationContext opContext,
796                                          final ModifyRequest request,
797                                          final ForwardTarget target,
798                                          final LDAPException failure)
799      {
800        // No action will be taken by default.
801      }
802    
803    
804    
805      /**
806       * Logs a message about the result of processing a modify request.
807       *
808       * @param  opContext  The operation context for the modify operation.
809       * @param  request    The modify request that was received.
810       * @param  result     The result of processing the modify request.
811       */
812      public void logModifyResponse(final CompletedOperationContext opContext,
813                                    final ModifyRequest request,
814                                    final ModifyResult result)
815      {
816        // No action will be taken by default.
817      }
818    
819    
820    
821      /**
822       * Logs a message about a modify DN request received from a client.
823       *
824       * @param  opContext  The operation context for the modify DN operation.
825       * @param  request    The modify DN request that was received.
826       */
827      public void logModifyDNRequest(final OperationContext opContext,
828                                     final ModifyDNRequest request)
829      {
830        // No action will be taken by default.
831      }
832    
833    
834    
835      /**
836       * Logs a message about a modify DN request that will be forwarded to another
837       * server.
838       *
839       * @param  opContext  The operation context for the modify DN operation.
840       * @param  request    The modify DN request that was received.
841       * @param  target     Information about the server to which the request will
842       *                    be forwarded.
843       */
844      public void logModifyDNForward(final OperationContext opContext,
845                                     final ModifyDNRequest request,
846                                     final ForwardTarget target)
847      {
848        // No action will be taken by default.
849      }
850    
851    
852    
853      /**
854       * Logs a message about a failure encountered while attempting to forward a
855       * modify DN request to another server.
856       *
857       * @param  opContext  The operation context for the modify DN operation.
858       * @param  request    The modify DN request that was received.
859       * @param  target     Information about the server to which the request was
860       *                    forwarded.
861       * @param  failure    The exception that was received when attempting to
862       *                    forward the request.
863       */
864      public void logModifyDNForwardFailure(final OperationContext opContext,
865                                            final ModifyDNRequest request,
866                                            final ForwardTarget target,
867                                            final LDAPException failure)
868      {
869        // No action will be taken by default.
870      }
871    
872    
873    
874      /**
875       * Logs a message about the result of processing a modify DN request.
876       *
877       * @param  opContext  The operation context for the modify DN operation.
878       * @param  request    The modify DN request that was received.
879       * @param  result     The result of processing the modify DN request.
880       */
881      public void logModifyDNResponse(final CompletedOperationContext opContext,
882                                      final ModifyDNRequest request,
883                                      final ModifyDNResult result)
884      {
885        // No action will be taken by default.
886      }
887    
888    
889    
890      /**
891       * Logs a message about a search request received from a client.
892       *
893       * @param  opContext  The operation context for the search operation.
894       * @param  request    The search request that was received.
895       */
896      public void logSearchRequest(final OperationContext opContext,
897                                   final SearchRequest request)
898      {
899        // No action will be taken by default.
900      }
901    
902    
903    
904      /**
905       * Logs a message about a search request that will be forwarded to another
906       * server.
907       *
908       * @param  opContext  The operation context for the search operation.
909       * @param  request    The search request that was received.
910       * @param  target     Information about the server to which the request will
911       *                    be forwarded.
912       */
913      public void logSearchForward(final OperationContext opContext,
914                                   final SearchRequest request,
915                                   final ForwardTarget target)
916      {
917        // No action will be taken by default.
918      }
919    
920    
921    
922      /**
923       * Logs a message about a failure encountered while attempting to forward a
924       * search request to another server.
925       *
926       * @param  opContext  The operation context for the search operation.
927       * @param  request    The search request that was received.
928       * @param  target     Information about the server to which the request was
929       *                    forwarded.
930       * @param  failure    The exception that was received when attempting to
931       *                    forward the request.
932       */
933      public void logSearchForwardFailure(final OperationContext opContext,
934                                          final SearchRequest request,
935                                          final ForwardTarget target,
936                                          final LDAPException failure)
937      {
938        // No action will be taken by default.
939      }
940    
941    
942    
943      /**
944       * Logs a message about a search result entry that was returned to the client.
945       *
946       * @param  opContext  The operation context for the search operation.
947       * @param  request    The search request that was received.
948       * @param  entry      The entry that was returned.
949       * @param  controls   The set of controls included with the entry, or an empty
950       *                    list if there were none.
951       */
952      public void logSearchResultEntry(final OperationContext opContext,
953                                       final SearchRequest request,
954                                       final Entry entry,
955                                       final List<Control> controls)
956      {
957        // No action will be taken by default.
958      }
959    
960    
961    
962      /**
963       * Logs a message about a search result reference that was returned to the
964       * client.
965       *
966       * @param  opContext     The operation context for the search operation.
967       * @param  request       The search request that was received.
968       * @param  referralURLs  The referral URLs for the reference that was
969       *                       returned.
970       * @param  controls      The set of controls included with the reference, or
971       *                       an empty list if there were none.
972       */
973      public void logSearchResultReference(final OperationContext opContext,
974                                           final SearchRequest request,
975                                           final List<String> referralURLs,
976                                           final List<Control> controls)
977      {
978        // No action will be taken by default.
979      }
980    
981    
982    
983      /**
984       * Logs a message about the result of processing a search request.
985       *
986       * @param  opContext  The operation context for the search operation.
987       * @param  request    The search request that was received.
988       * @param  result     The result of processing the search request.
989       */
990      public void logSearchResultDone(
991                       final CompletedSearchOperationContext opContext,
992                       final SearchRequest request, final SearchResult result)
993      {
994        // No action will be taken by default.
995      }
996    
997    
998    
999      /**
1000       * Logs a message about an unbind request received from a client.
1001       *
1002       * @param  opContext  The operation context for the unbind operation.
1003       * @param  request    The unbind request that was received.
1004       */
1005      public void logUnbindRequest(final OperationContext opContext,
1006                                   final UnbindRequest request)
1007      {
1008        // No action will be taken by default.
1009      }
1010    
1011    
1012    
1013      /**
1014       * Logs a message about an intermediate response that was returned to the
1015       * client.
1016       *
1017       * @param  opContext             The operation context for the associated
1018       *                               operation.
1019       * @param  intermediateResponse  The intermediate response that was returned.
1020       */
1021      public void logIntermediateResponse(final OperationContext opContext,
1022                       final IntermediateResponse intermediateResponse)
1023      {
1024        // No action will be taken by default.
1025      }
1026    }