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