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