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