001 /*
002 * Copyright 2008-2015 UnboundID Corp.
003 * All Rights Reserved.
004 */
005 /*
006 * Copyright (C) 2015 UnboundID Corp.
007 *
008 * This program is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU General Public License (GPLv2 only)
010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011 * as published by the Free Software Foundation.
012 *
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program; if not, see <http://www.gnu.org/licenses>.
020 */
021 package com.unboundid.ldap.sdk.unboundidds.monitors;
022
023
024
025 import java.util.Collections;
026 import java.util.LinkedHashMap;
027 import java.util.Map;
028
029 import com.unboundid.ldap.sdk.Entry;
030 import com.unboundid.util.NotMutable;
031 import com.unboundid.util.ThreadSafety;
032 import com.unboundid.util.ThreadSafetyLevel;
033
034 import static com.unboundid.ldap.sdk.unboundidds.monitors.MonitorMessages.*;
035
036
037
038 /**
039 * <BLOCKQUOTE>
040 * <B>NOTE:</B> This class is part of the Commercial Edition of the UnboundID
041 * LDAP SDK for Java. It is not available for use in applications that
042 * include only the Standard Edition of the LDAP SDK, and is not supported for
043 * use in conjunction with non-UnboundID products.
044 * </BLOCKQUOTE>
045 * This class defines a monitor entry that provides information about the types
046 * of LDAP operations processed through an LDAP connection handler. Information
047 * available through this monitor entry includes:
048 * <UL>
049 * <LI>The total number of requests for each type of operation received by the
050 * connection handler.</LI>
051 * <LI>The total number of responses of each type of operation returned by the
052 * connection handler.</LI>
053 * <LI>The total number of search result entries returned by the connection
054 * handler.</LI>
055 * <LI>The total number of search result references returned by the connection
056 * handler.</LI>
057 * <LI>The total number of LDAP messages read from clients.</LI>
058 * <LI>The total number of LDAP messages written to clients.</LI>
059 * <LI>The total number of request bytes read from clients.</LI>
060 * <LI>The total number of response bytes written to clients.</LI>
061 * <LI>The number of connections accepted by the connection handler.</LI>
062 * <LI>The number of connections closed by the connection handler.</LI>
063 * <LI>The number of operations initiated by the connection handler.</LI>
064 * <LI>The number of operations completed by the connection handler.</LI>
065 * <LI>The number of operations abandoned by the connection handler.</LI>
066 * </UL>
067 * The LDAP statistics monitor entries provided by the server can be retrieved
068 * using the {@link MonitorManager#getLDAPStatisticsMonitorEntries} method.
069 * These entries provide specific methods for accessing information about the
070 * LDAP connection handler (e.g., the
071 * {@link LDAPStatisticsMonitorEntry#getAbandonRequests} method can be used to
072 * retrieve the number of abandon requests received). Alternately, this
073 * information may be accessed using the generic API. See the
074 * {@link MonitorManager} class documentation for an example that demonstrates
075 * the use of the generic API for accessing monitor data.
076 */
077 @NotMutable()
078 @ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
079 public final class LDAPStatisticsMonitorEntry
080 extends MonitorEntry
081 {
082 /**
083 * The structural object class used in LDAP statistics monitor entries.
084 */
085 static final String LDAP_STATISTICS_MONITOR_OC =
086 "ds-ldap-statistics-monitor-entry";
087
088
089
090 /**
091 * The name of the attribute that contains the number of abandon requests.
092 */
093 private static final String ATTR_ABANDON_REQUESTS = "abandonRequests";
094
095
096
097 /**
098 * The name of the attribute that contains the number of add requests.
099 */
100 private static final String ATTR_ADD_REQUESTS = "addRequests";
101
102
103
104 /**
105 * The name of the attribute that contains the number of add responses.
106 */
107 private static final String ATTR_ADD_RESPONSES = "addResponses";
108
109
110
111 /**
112 * The name of the attribute that contains the number of bind requests.
113 */
114 private static final String ATTR_BIND_REQUESTS = "bindRequests";
115
116
117
118 /**
119 * The name of the attribute that contains the number of bind responses.
120 */
121 private static final String ATTR_BIND_RESPONSES = "bindResponses";
122
123
124
125 /**
126 * The name of the attribute that contains the number of bytes read.
127 */
128 private static final String ATTR_BYTES_READ = "bytesRead";
129
130
131
132 /**
133 * The name of the attribute that contains the number of bytes written.
134 */
135 private static final String ATTR_BYTES_WRITTEN = "bytesWritten";
136
137
138
139 /**
140 * The name of the attribute that contains the number of compare requests.
141 */
142 private static final String ATTR_COMPARE_REQUESTS = "compareRequests";
143
144
145
146 /**
147 * The name of the attribute that contains the number of compare responses.
148 */
149 private static final String ATTR_COMPARE_RESPONSES = "compareResponses";
150
151
152
153 /**
154 * The name of the attribute that contains the number of connections
155 * closed.
156 */
157 private static final String ATTR_CONNECTIONS_CLOSED = "connectionsClosed";
158
159
160
161 /**
162 * The name of the attribute that contains the number of connections
163 * established.
164 */
165 private static final String ATTR_CONNECTIONS_ESTABLISHED =
166 "connectionsEstablished";
167
168
169
170 /**
171 * The name of the attribute that contains the number of delete requests.
172 */
173 private static final String ATTR_DELETE_REQUESTS = "deleteRequests";
174
175
176
177 /**
178 * The name of the attribute that contains the number of delete responses.
179 */
180 private static final String ATTR_DELETE_RESPONSES = "deleteResponses";
181
182
183
184 /**
185 * The name of the attribute that contains the number of extended requests.
186 */
187 private static final String ATTR_EXTENDED_REQUESTS = "extendedRequests";
188
189
190
191 /**
192 * The name of the attribute that contains the number of extended responses.
193 */
194 private static final String ATTR_EXTENDED_RESPONSES = "extendedResponses";
195
196
197
198 /**
199 * The name of the attribute that contains the number of LDAP messages read.
200 */
201 private static final String ATTR_LDAP_MESSAGES_READ = "ldapMessagesRead";
202
203
204
205 /**
206 * The name of the attribute that contains the number of LDAP messages
207 * written.
208 */
209 private static final String ATTR_LDAP_MESSAGES_WRITTEN =
210 "ldapMessagesWritten";
211
212
213
214 /**
215 * The name of the attribute that contains the number of modify requests.
216 */
217 private static final String ATTR_MODIFY_REQUESTS = "modifyRequests";
218
219
220
221 /**
222 * The name of the attribute that contains the number of modify responses.
223 */
224 private static final String ATTR_MODIFY_RESPONSES = "modifyResponses";
225
226
227
228 /**
229 * The name of the attribute that contains the number of modify DN requests.
230 */
231 private static final String ATTR_MODIFY_DN_REQUESTS = "modifyDNRequests";
232
233
234
235 /**
236 * The name of the attribute that contains the number of modify DN responses.
237 */
238 private static final String ATTR_MODIFY_DN_RESPONSES = "modifyDNResponses";
239
240
241
242 /**
243 * The name of the attribute that contains the number of operations abandoned.
244 */
245 private static final String ATTR_OPS_ABANDONED = "operationsAbandoned";
246
247
248
249 /**
250 * The name of the attribute that contains the number of operations completed.
251 */
252 private static final String ATTR_OPS_COMPLETED = "operationsCompleted";
253
254
255
256 /**
257 * The name of the attribute that contains the number of operations initiated.
258 */
259 private static final String ATTR_OPS_INITIATED = "operationsInitiated";
260
261
262
263 /**
264 * The name of the attribute that contains the number of search requests.
265 */
266 private static final String ATTR_SEARCH_REQUESTS = "searchRequests";
267
268
269
270 /**
271 * The name of the attribute that contains the number of search result done
272 * responses.
273 */
274 private static final String ATTR_SEARCH_RESULT_DONE_RESPONSES =
275 "searchResultsDone";
276
277
278
279 /**
280 * The name of the attribute that contains the number of search result entry
281 * responses.
282 */
283 private static final String ATTR_SEARCH_RESULT_ENTRY_RESPONSES =
284 "searchResultEntries";
285
286
287
288 /**
289 * The name of the attribute that contains the number of search result
290 * reference responses.
291 */
292 private static final String ATTR_SEARCH_RESULT_REFERENCE_RESPONSES =
293 "searchResultReferences";
294
295
296
297 /**
298 * The name of the attribute that contains the number of unbind requests.
299 */
300 private static final String ATTR_UNBIND_REQUESTS = "unbindRequests";
301
302
303
304 /**
305 * The serial version UID for this serializable class.
306 */
307 private static final long serialVersionUID = 4869341619766489249L;
308
309
310
311 // The number of abandon requests.
312 private final Long abandonRequests;
313
314 // The number of add requests.
315 private final Long addRequests;
316
317 // The number of add responses.
318 private final Long addResponses;
319
320 // The number of bind requests.
321 private final Long bindRequests;
322
323 // The number of bind responses.
324 private final Long bindResponses;
325
326 // The number of bytes read.
327 private final Long bytesRead;
328
329 // The number of bytes written.
330 private final Long bytesWritten;
331
332 // The number of compare requests.
333 private final Long compareRequests;
334
335 // The number of compare responses.
336 private final Long compareResponses;
337
338 // The number of connections that have been closed.
339 private final Long connectionsClosed;
340
341 // The number of connections that have been established.
342 private final Long connectionsEstablished;
343
344 // The number of delete requests.
345 private final Long deleteRequests;
346
347 // The number of delete responses.
348 private final Long deleteResponses;
349
350 // The number of extended requests.
351 private final Long extendedRequests;
352
353 // The number of extended responses.
354 private final Long extendedResponses;
355
356 // The number of LDAP messages read.
357 private final Long ldapMessagesRead;
358
359 // The number of LDAP messages written.
360 private final Long ldapMessagesWritten;
361
362 // The number of modify requests.
363 private final Long modifyRequests;
364
365 // The number of modify responses.
366 private final Long modifyResponses;
367
368 // The number of modify DN requests.
369 private final Long modifyDNRequests;
370
371 // The number of modify DN responses.
372 private final Long modifyDNResponses;
373
374 // The number of operations abandoned.
375 private final Long opsAbandoned;
376
377 // The number of operations completed.
378 private final Long opsCompleted;
379
380 // The number of operations initiated.
381 private final Long opsInitiated;
382
383 // The number of search requests.
384 private final Long searchRequests;
385
386 // The number of search result done responses.
387 private final Long searchDoneResponses;
388
389 // The number of search result entry responses.
390 private final Long searchEntryResponses;
391
392 // The number of search result reference responses.
393 private final Long searchReferenceResponses;
394
395 // The number of unbind requests.
396 private final Long unbindRequests;
397
398
399
400 /**
401 * Creates a new LDAP statistics monitor entry from the provided entry.
402 *
403 * @param entry The entry to be parsed as an LDAP statistics monitor entry.
404 * It must not be {@code null}.
405 */
406 public LDAPStatisticsMonitorEntry(final Entry entry)
407 {
408 super(entry);
409
410 abandonRequests = getLong(ATTR_ABANDON_REQUESTS);
411 addRequests = getLong(ATTR_ADD_REQUESTS);
412 addResponses = getLong(ATTR_ADD_RESPONSES);
413 bindRequests = getLong(ATTR_BIND_REQUESTS);
414 bindResponses = getLong(ATTR_BIND_RESPONSES);
415 bytesRead = getLong(ATTR_BYTES_READ);
416 bytesWritten = getLong(ATTR_BYTES_WRITTEN);
417 compareRequests = getLong(ATTR_COMPARE_REQUESTS);
418 compareResponses = getLong(ATTR_COMPARE_RESPONSES);
419 connectionsClosed = getLong(ATTR_CONNECTIONS_CLOSED);
420 connectionsEstablished = getLong(ATTR_CONNECTIONS_ESTABLISHED);
421 deleteRequests = getLong(ATTR_DELETE_REQUESTS);
422 deleteResponses = getLong(ATTR_DELETE_RESPONSES);
423 extendedRequests = getLong(ATTR_EXTENDED_REQUESTS);
424 extendedResponses = getLong(ATTR_EXTENDED_RESPONSES);
425 ldapMessagesRead = getLong(ATTR_LDAP_MESSAGES_READ);
426 ldapMessagesWritten = getLong(ATTR_LDAP_MESSAGES_WRITTEN);
427 modifyRequests = getLong(ATTR_MODIFY_REQUESTS);
428 modifyResponses = getLong(ATTR_MODIFY_RESPONSES);
429 modifyDNRequests = getLong(ATTR_MODIFY_DN_REQUESTS);
430 modifyDNResponses = getLong(ATTR_MODIFY_DN_RESPONSES);
431 opsAbandoned = getLong(ATTR_OPS_ABANDONED);
432 opsCompleted = getLong(ATTR_OPS_COMPLETED);
433 opsInitiated = getLong(ATTR_OPS_INITIATED);
434 searchRequests = getLong(ATTR_SEARCH_REQUESTS);
435 searchDoneResponses = getLong(ATTR_SEARCH_RESULT_DONE_RESPONSES);
436 searchEntryResponses = getLong(ATTR_SEARCH_RESULT_ENTRY_RESPONSES);
437 searchReferenceResponses = getLong(ATTR_SEARCH_RESULT_REFERENCE_RESPONSES);
438 unbindRequests = getLong(ATTR_UNBIND_REQUESTS);
439 }
440
441
442
443 /**
444 * Retrieves the number of connections established since the associated
445 * connection handler was started.
446 *
447 * @return The number of connections established since the associated
448 * connection handler was started, or {@code null} if it was not
449 * included in the monitor entry.
450 */
451 public Long getConnectionsEstablished()
452 {
453 return connectionsEstablished;
454 }
455
456
457
458 /**
459 * Retrieves the number of connections closed since the associated connection
460 * handler was started.
461 *
462 * @return The number of connections closed since the associated connection
463 * handler was started, or {@code null} if it was not included in the
464 * monitor entry.
465 */
466 public Long getConnectionsClosed()
467 {
468 return connectionsClosed;
469 }
470
471
472
473 /**
474 * Retrieves the number of operations initiated since the associated
475 * connection handler was started.
476 *
477 * @return The number of operations initiated since the associated
478 * connection handler was started, or {@code null} if it was not
479 * included in the monitor entry.
480 */
481 public Long getOperationsInitiated()
482 {
483 return opsInitiated;
484 }
485
486
487
488 /**
489 * Retrieves the number of operations completed since the associated
490 * connection handler was started.
491 *
492 * @return The number of operations completed since the associated
493 * connection handler was started, or {@code null} if it was not
494 * included in the monitor entry.
495 */
496 public Long getOperationsCompleted()
497 {
498 return opsCompleted;
499 }
500
501
502
503 /**
504 * Retrieves the number of operations abandoned since the associated
505 * connection handler was started.
506 *
507 * @return The number of operations abandoned since the associated
508 * connection handler was started, or {@code null} if it was not
509 * included in the monitor entry.
510 */
511 public Long getOperationsAbandoned()
512 {
513 return opsAbandoned;
514 }
515
516
517
518 /**
519 * Retrieves the number of bytes read from clients since the associated
520 * connection handler was started.
521 *
522 * @return The number of bytes read from clients since the associated
523 * connection handler was started, or {@code null} if it was not
524 * included in the monitor entry.
525 */
526 public Long getBytesRead()
527 {
528 return bytesRead;
529 }
530
531
532
533 /**
534 * Retrieves the number of bytes written to clients since the associated
535 * connection handler was started.
536 *
537 * @return The number of bytes written to clients since the associated
538 * connection handler was started, or {@code null} if it was not
539 * included in the monitor entry.
540 */
541 public Long getBytesWritten()
542 {
543 return bytesWritten;
544 }
545
546
547
548 /**
549 * Retrieves the number of LDAP messages read from clients since the
550 * associated connection handler was started.
551 *
552 * @return The number of LDAP messages read from clients since the associated
553 * connection handler was started, or {@code null} if it was not
554 * included in the monitor entry.
555 */
556 public Long getLDAPMessagesRead()
557 {
558 return ldapMessagesRead;
559 }
560
561
562
563 /**
564 * Retrieves the number of LDAP messages written to clients since the
565 * associated connection handler was started.
566 *
567 * @return The number of LDAP messages written to clients since the
568 * associated connection handler was started, or {@code null} if it
569 * was not included in the monitor entry.
570 */
571 public Long getLDAPMessagesWritten()
572 {
573 return ldapMessagesWritten;
574 }
575
576
577
578 /**
579 * Retrieves the number of abandon requests from clients since the associated
580 * connection handler was started.
581 *
582 * @return The number of abandon requests from clients since the associated
583 * connection handler was started, or {@code null} if it was not
584 * included in the monitor entry.
585 */
586 public Long getAbandonRequests()
587 {
588 return abandonRequests;
589 }
590
591
592
593 /**
594 * Retrieves the number of add requests from clients since the associated
595 * connection handler was started.
596 *
597 * @return The number of add requests from clients since the associated
598 * connection handler was started, or {@code null} if it was not
599 * included in the monitor entry.
600 */
601 public Long getAddRequests()
602 {
603 return addRequests;
604 }
605
606
607
608 /**
609 * Retrieves the number of add responses to clients since the associated
610 * connection handler was started.
611 *
612 * @return The number of add responses to clients since the associated
613 * connection handler was started, or {@code null} if it was not
614 * included in the monitor entry.
615 */
616 public Long getAddResponses()
617 {
618 return addResponses;
619 }
620
621
622
623 /**
624 * Retrieves the number of bind requests from clients since the associated
625 * connection handler was started.
626 *
627 * @return The number of bind requests from clients since the associated
628 * connection handler was started, or {@code null} if it was not
629 * included in the monitor entry.
630 */
631 public Long getBindRequests()
632 {
633 return bindRequests;
634 }
635
636
637
638 /**
639 * Retrieves the number of bind responses to clients since the associated
640 * connection handler was started.
641 *
642 * @return The number of bind responses to clients since the associated
643 * connection handler was started, or {@code null} if it was not
644 * included in the monitor entry.
645 */
646 public Long getBindResponses()
647 {
648 return bindResponses;
649 }
650
651
652
653 /**
654 * Retrieves the number of compare requests from clients since the associated
655 * connection handler was started.
656 *
657 * @return The number of compare requests from clients since the associated
658 * connection handler was started, or {@code null} if it was not
659 * included in the monitor entry.
660 */
661 public Long getCompareRequests()
662 {
663 return compareRequests;
664 }
665
666
667
668 /**
669 * Retrieves the number of compare responses to clients since the associated
670 * connection handler was started.
671 *
672 * @return The number of compare responses to clients since the associated
673 * connection handler was started, or {@code null} if it was not
674 * included in the monitor entry.
675 */
676 public Long getCompareResponses()
677 {
678 return compareResponses;
679 }
680
681
682
683 /**
684 * Retrieves the number of delete requests from clients since the associated
685 * connection handler was started.
686 *
687 * @return The number of delete requests from clients since the associated
688 * connection handler was started, or {@code null} if it was not
689 * included in the monitor entry.
690 */
691 public Long getDeleteRequests()
692 {
693 return deleteRequests;
694 }
695
696
697
698 /**
699 * Retrieves the number of delete responses to clients since the associated
700 * connection handler was started.
701 *
702 * @return The number of delete responses to clients since the associated
703 * connection handler was started, or {@code null} if it was not
704 * included in the monitor entry.
705 */
706 public Long getDeleteResponses()
707 {
708 return deleteResponses;
709 }
710
711
712
713 /**
714 * Retrieves the number of extended requests from clients since the associated
715 * connection handler was started.
716 *
717 * @return The number of extended requests from clients since the associated
718 * connection handler was started, or {@code null} if it was not
719 * included in the monitor entry.
720 */
721 public Long getExtendedRequests()
722 {
723 return extendedRequests;
724 }
725
726
727
728 /**
729 * Retrieves the number of extended responses to clients since the associated
730 * connection handler was started.
731 *
732 * @return The number of extended responses to clients since the associated
733 * connection handler was started, or {@code null} if it was not
734 * included in the monitor entry.
735 */
736 public Long getExtendedResponses()
737 {
738 return extendedResponses;
739 }
740
741
742
743 /**
744 * Retrieves the number of modify requests from clients since the associated
745 * connection handler was started.
746 *
747 * @return The number of modify requests from clients since the associated
748 * connection handler was started, or {@code null} if it was not
749 * included in the monitor entry.
750 */
751 public Long getModifyRequests()
752 {
753 return modifyRequests;
754 }
755
756
757
758 /**
759 * Retrieves the number of modify responses to clients since the associated
760 * connection handler was started.
761 *
762 * @return The number of modify responses to clients since the associated
763 * connection handler was started, or {@code null} if it was not
764 * included in the monitor entry.
765 */
766 public Long getModifyResponses()
767 {
768 return modifyResponses;
769 }
770
771
772
773 /**
774 * Retrieves the number of modify DN requests from clients since the
775 * associated connection handler was started.
776 *
777 * @return The number of modify DN requests from clients since the associated
778 * connection handler was started, or {@code null} if it was not
779 * included in the monitor entry.
780 */
781 public Long getModifyDNRequests()
782 {
783 return modifyDNRequests;
784 }
785
786
787
788 /**
789 * Retrieves the number of modify DN responses to clients since the associated
790 * connection handler was started.
791 *
792 * @return The number of modify DN responses to clients since the associated
793 * connection handler was started, or {@code null} if it was not
794 * included in the monitor entry.
795 */
796 public Long getModifyDNResponses()
797 {
798 return modifyDNResponses;
799 }
800
801
802
803 /**
804 * Retrieves the number of search requests from clients since the associated
805 * connection handler was started.
806 *
807 * @return The number of search requests from clients since the associated
808 * connection handler was started, or {@code null} if it was not
809 * included in the monitor entry.
810 */
811 public Long getSearchRequests()
812 {
813 return searchRequests;
814 }
815
816
817
818 /**
819 * Retrieves the number of search result entries sent to clients since the
820 * associated connection handler was started.
821 *
822 * @return The number of search result entries sent to clients since the
823 * associated connection handler was started, or {@code null} if it
824 * was not included in the monitor entry.
825 */
826 public Long getSearchResultEntries()
827 {
828 return searchEntryResponses;
829 }
830
831
832
833 /**
834 * Retrieves the number of search result references sent to clients since the
835 * associated connection handler was started.
836 *
837 * @return The number of search result references sent to clients since the
838 * associated connection handler was started, or {@code null} if it
839 * was not included in the monitor entry.
840 */
841 public Long getSearchResultReferences()
842 {
843 return searchReferenceResponses;
844 }
845
846
847
848 /**
849 * Retrieves the number of search result done responses to clients since the
850 * associated connection handler was started.
851 *
852 * @return The number of search result done responses to clients since the
853 * associated connection handler was started, or {@code null} if it
854 * was not included in the monitor entry.
855 */
856 public Long getSearchDoneResponses()
857 {
858 return searchDoneResponses;
859 }
860
861
862
863 /**
864 * Retrieves the number of unbind requests from clients since the associated
865 * connection handler was started.
866 *
867 * @return The number of unbind requests from clients since the associated
868 * connection handler was started, or {@code null} if it was not
869 * included in the monitor entry.
870 */
871 public Long getUnbindRequests()
872 {
873 return unbindRequests;
874 }
875
876
877
878 /**
879 * {@inheritDoc}
880 */
881 @Override()
882 public String getMonitorDisplayName()
883 {
884 return INFO_LDAP_STATS_MONITOR_DISPNAME.get();
885 }
886
887
888
889 /**
890 * {@inheritDoc}
891 */
892 @Override()
893 public String getMonitorDescription()
894 {
895 return INFO_LDAP_STATS_MONITOR_DESC.get();
896 }
897
898
899
900 /**
901 * {@inheritDoc}
902 */
903 @Override()
904 public Map<String,MonitorAttribute> getMonitorAttributes()
905 {
906 final LinkedHashMap<String,MonitorAttribute> attrs =
907 new LinkedHashMap<String,MonitorAttribute>();
908
909 if (connectionsEstablished != null)
910 {
911 addMonitorAttribute(attrs,
912 ATTR_CONNECTIONS_ESTABLISHED,
913 INFO_LDAP_STATS_DISPNAME_CONNECTIONS_ESTABLISHED.get(),
914 INFO_LDAP_STATS_DESC_CONNECTIONS_ESTABLISHED.get(),
915 connectionsEstablished);
916 }
917
918 if (connectionsClosed != null)
919 {
920 addMonitorAttribute(attrs,
921 ATTR_CONNECTIONS_CLOSED,
922 INFO_LDAP_STATS_DISPNAME_CONNECTIONS_CLOSED.get(),
923 INFO_LDAP_STATS_DESC_CONNECTIONS_CLOSED.get(),
924 connectionsClosed);
925 }
926
927 if (bytesRead != null)
928 {
929 addMonitorAttribute(attrs,
930 ATTR_BYTES_READ,
931 INFO_LDAP_STATS_DISPNAME_BYTES_READ.get(),
932 INFO_LDAP_STATS_DESC_BYTES_READ.get(),
933 bytesRead);
934 }
935
936 if (bytesWritten != null)
937 {
938 addMonitorAttribute(attrs,
939 ATTR_BYTES_WRITTEN,
940 INFO_LDAP_STATS_DISPNAME_BYTES_WRITTEN.get(),
941 INFO_LDAP_STATS_DESC_BYTES_WRITTEN.get(),
942 bytesWritten);
943 }
944
945 if (ldapMessagesRead != null)
946 {
947 addMonitorAttribute(attrs,
948 ATTR_LDAP_MESSAGES_READ,
949 INFO_LDAP_STATS_DISPNAME_LDAP_MESSAGES_READ.get(),
950 INFO_LDAP_STATS_DESC_LDAP_MESSAGES_READ.get(),
951 ldapMessagesRead);
952 }
953
954 if (ldapMessagesWritten != null)
955 {
956 addMonitorAttribute(attrs,
957 ATTR_LDAP_MESSAGES_WRITTEN,
958 INFO_LDAP_STATS_DISPNAME_LDAP_MESSAGES_WRITTEN.get(),
959 INFO_LDAP_STATS_DESC_LDAP_MESSAGES_WRITTEN.get(),
960 ldapMessagesWritten);
961 }
962
963 if (opsInitiated != null)
964 {
965 addMonitorAttribute(attrs,
966 ATTR_OPS_INITIATED,
967 INFO_LDAP_STATS_DISPNAME_OPS_INITIATED.get(),
968 INFO_LDAP_STATS_DESC_OPS_INITIATED.get(),
969 opsInitiated);
970 }
971
972 if (opsCompleted != null)
973 {
974 addMonitorAttribute(attrs,
975 ATTR_OPS_COMPLETED,
976 INFO_LDAP_STATS_DISPNAME_OPS_COMPLETED.get(),
977 INFO_LDAP_STATS_DESC_OPS_COMPLETED.get(),
978 opsCompleted);
979 }
980
981 if (opsAbandoned != null)
982 {
983 addMonitorAttribute(attrs,
984 ATTR_OPS_ABANDONED,
985 INFO_LDAP_STATS_DISPNAME_OPS_ABANDONED.get(),
986 INFO_LDAP_STATS_DESC_OPS_ABANDONED.get(),
987 opsAbandoned);
988 }
989
990 if (abandonRequests != null)
991 {
992 addMonitorAttribute(attrs,
993 ATTR_ABANDON_REQUESTS,
994 INFO_LDAP_STATS_DISPNAME_ABANDON_REQUESTS.get(),
995 INFO_LDAP_STATS_DESC_ABANDON_REQUESTS.get(),
996 abandonRequests);
997 }
998
999 if (addRequests != null)
1000 {
1001 addMonitorAttribute(attrs,
1002 ATTR_ADD_REQUESTS,
1003 INFO_LDAP_STATS_DISPNAME_ADD_REQUESTS.get(),
1004 INFO_LDAP_STATS_DESC_ADD_REQUESTS.get(),
1005 addRequests);
1006 }
1007
1008 if (addResponses != null)
1009 {
1010 addMonitorAttribute(attrs,
1011 ATTR_ADD_RESPONSES,
1012 INFO_LDAP_STATS_DISPNAME_ADD_RESPONSES.get(),
1013 INFO_LDAP_STATS_DESC_ADD_RESPONSES.get(),
1014 addResponses);
1015 }
1016
1017 if (bindRequests != null)
1018 {
1019 addMonitorAttribute(attrs,
1020 ATTR_BIND_REQUESTS,
1021 INFO_LDAP_STATS_DISPNAME_BIND_REQUESTS.get(),
1022 INFO_LDAP_STATS_DESC_BIND_REQUESTS.get(),
1023 bindRequests);
1024 }
1025
1026 if (bindResponses != null)
1027 {
1028 addMonitorAttribute(attrs,
1029 ATTR_BIND_RESPONSES,
1030 INFO_LDAP_STATS_DISPNAME_BIND_RESPONSES.get(),
1031 INFO_LDAP_STATS_DESC_BIND_RESPONSES.get(),
1032 bindResponses);
1033 }
1034
1035 if (compareRequests != null)
1036 {
1037 addMonitorAttribute(attrs,
1038 ATTR_COMPARE_REQUESTS,
1039 INFO_LDAP_STATS_DISPNAME_COMPARE_REQUESTS.get(),
1040 INFO_LDAP_STATS_DESC_COMPARE_REQUESTS.get(),
1041 compareRequests);
1042 }
1043
1044 if (compareResponses != null)
1045 {
1046 addMonitorAttribute(attrs,
1047 ATTR_COMPARE_RESPONSES,
1048 INFO_LDAP_STATS_DISPNAME_COMPARE_RESPONSES.get(),
1049 INFO_LDAP_STATS_DESC_COMPARE_RESPONSES.get(),
1050 compareResponses);
1051 }
1052
1053 if (deleteRequests != null)
1054 {
1055 addMonitorAttribute(attrs,
1056 ATTR_DELETE_REQUESTS,
1057 INFO_LDAP_STATS_DISPNAME_DELETE_REQUESTS.get(),
1058 INFO_LDAP_STATS_DESC_DELETE_REQUESTS.get(),
1059 deleteRequests);
1060 }
1061
1062 if (deleteResponses != null)
1063 {
1064 addMonitorAttribute(attrs,
1065 ATTR_DELETE_RESPONSES,
1066 INFO_LDAP_STATS_DISPNAME_DELETE_RESPONSES.get(),
1067 INFO_LDAP_STATS_DESC_DELETE_RESPONSES.get(),
1068 deleteResponses);
1069 }
1070
1071 if (extendedRequests != null)
1072 {
1073 addMonitorAttribute(attrs,
1074 ATTR_EXTENDED_REQUESTS,
1075 INFO_LDAP_STATS_DISPNAME_EXTENDED_REQUESTS.get(),
1076 INFO_LDAP_STATS_DESC_EXTENDED_REQUESTS.get(),
1077 extendedRequests);
1078 }
1079
1080 if (extendedResponses != null)
1081 {
1082 addMonitorAttribute(attrs,
1083 ATTR_EXTENDED_RESPONSES,
1084 INFO_LDAP_STATS_DISPNAME_EXTENDED_RESPONSES.get(),
1085 INFO_LDAP_STATS_DESC_EXTENDED_RESPONSES.get(),
1086 extendedResponses);
1087 }
1088
1089 if (modifyRequests != null)
1090 {
1091 addMonitorAttribute(attrs,
1092 ATTR_MODIFY_REQUESTS,
1093 INFO_LDAP_STATS_DISPNAME_MODIFY_REQUESTS.get(),
1094 INFO_LDAP_STATS_DESC_MODIFY_REQUESTS.get(),
1095 modifyRequests);
1096 }
1097
1098 if (modifyResponses != null)
1099 {
1100 addMonitorAttribute(attrs,
1101 ATTR_MODIFY_RESPONSES,
1102 INFO_LDAP_STATS_DISPNAME_MODIFY_RESPONSES.get(),
1103 INFO_LDAP_STATS_DESC_MODIFY_RESPONSES.get(),
1104 modifyResponses);
1105 }
1106
1107 if (modifyDNRequests != null)
1108 {
1109 addMonitorAttribute(attrs,
1110 ATTR_MODIFY_DN_REQUESTS,
1111 INFO_LDAP_STATS_DISPNAME_MODIFY_DN_REQUESTS.get(),
1112 INFO_LDAP_STATS_DESC_MODIFY_DN_REQUESTS.get(),
1113 modifyDNRequests);
1114 }
1115
1116 if (modifyDNResponses != null)
1117 {
1118 addMonitorAttribute(attrs,
1119 ATTR_MODIFY_DN_RESPONSES,
1120 INFO_LDAP_STATS_DISPNAME_MODIFY_DN_RESPONSES.get(),
1121 INFO_LDAP_STATS_DESC_MODIFY_DN_RESPONSES.get(),
1122 modifyDNResponses);
1123 }
1124
1125 if (searchRequests != null)
1126 {
1127 addMonitorAttribute(attrs,
1128 ATTR_SEARCH_REQUESTS,
1129 INFO_LDAP_STATS_DISPNAME_SEARCH_REQUESTS.get(),
1130 INFO_LDAP_STATS_DESC_SEARCH_REQUESTS.get(),
1131 searchRequests);
1132 }
1133
1134 if (searchEntryResponses != null)
1135 {
1136 addMonitorAttribute(attrs,
1137 ATTR_SEARCH_RESULT_ENTRY_RESPONSES,
1138 INFO_LDAP_STATS_DISPNAME_SEARCH_ENTRY_RESPONSES.get(),
1139 INFO_LDAP_STATS_DESC_SEARCH_ENTRY_RESPONSES.get(),
1140 searchEntryResponses);
1141 }
1142
1143 if (searchReferenceResponses != null)
1144 {
1145 addMonitorAttribute(attrs,
1146 ATTR_SEARCH_RESULT_REFERENCE_RESPONSES,
1147 INFO_LDAP_STATS_DISPNAME_SEARCH_REFERENCE_RESPONSES.get(),
1148 INFO_LDAP_STATS_DESC_SEARCH_REFERENCE_RESPONSES.get(),
1149 searchReferenceResponses);
1150 }
1151
1152 if (searchDoneResponses != null)
1153 {
1154 addMonitorAttribute(attrs,
1155 ATTR_SEARCH_RESULT_DONE_RESPONSES,
1156 INFO_LDAP_STATS_DISPNAME_SEARCH_DONE_RESPONSES.get(),
1157 INFO_LDAP_STATS_DESC_SEARCH_DONE_RESPONSES.get(),
1158 searchDoneResponses);
1159 }
1160
1161 if (unbindRequests != null)
1162 {
1163 addMonitorAttribute(attrs,
1164 ATTR_UNBIND_REQUESTS,
1165 INFO_LDAP_STATS_DISPNAME_UNBIND_REQUESTS.get(),
1166 INFO_LDAP_STATS_DESC_UNBIND_REQUESTS.get(),
1167 unbindRequests);
1168 }
1169
1170 return Collections.unmodifiableMap(attrs);
1171 }
1172 }