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