001/*
002 * Copyright 2010-2024 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright 2010-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) 2010-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 general information about
058 * the state of an index in a Directory Server backend.  Note that the term
059 * "index" may refer to a number of different things, including attribute
060 * indexes (in which each individual index type will be considered a separate
061 * index, so if "cn" has equality and substring index types then that will be
062 * considered two separate indexes), VLV indexes, and system indexes (for
063 * databases that are maintained internally, like id2entry, dn2id, id2children,
064 * and id2subtree).
065 * <BR>
066 * <BLOCKQUOTE>
067 *   <B>NOTE:</B>  This class, and other classes within the
068 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
069 *   supported for use against Ping Identity, UnboundID, and
070 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
071 *   for proprietary functionality or for external specifications that are not
072 *   considered stable or mature enough to be guaranteed to work in an
073 *   interoperable way with other types of LDAP servers.
074 * </BLOCKQUOTE>
075 * <BR>
076 * The set of index monitor entries published by the directory server can be
077 * obtained using the {@link MonitorManager#getIndexMonitorEntries} method.
078 * Specific methods are available for accessing the associated monitor data
079 * (e.g., {@link IndexMonitorEntry#getBackendID} to retrieve the backend ID),
080 * and there are also methods for accessing this information in a generic manner
081 * (e.g., {@link IndexMonitorEntry#getMonitorAttributes} to retrieve all of
082 * the monitor attributes).  See the {@link MonitorManager} class documentation
083 * for an example that demonstrates the use of the generic API for accessing
084 * monitor data.
085 */
086@NotMutable()
087@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
088public final class IndexMonitorEntry
089       extends MonitorEntry
090{
091  /**
092   * The structural object class used in index monitor entries.
093   */
094  @NotNull static final String INDEX_MONITOR_OC = "ds-index-monitor-entry";
095
096
097
098  /**
099   * The name of the attribute that contains the index name.
100   */
101  @NotNull private static final String ATTR_INDEX_NAME = "ds-index-name";
102
103
104
105  /**
106   * The name of the attribute that contains the backend ID.
107   */
108  @NotNull private static final String ATTR_BACKEND_ID = "ds-index-backend-id";
109
110
111
112  /**
113   * The name of the attribute that contains the backend base DN.
114   */
115  @NotNull private static final String ATTR_BASE_DN =
116       "ds-index-backend-base-dn";
117
118
119
120  /**
121   * The name of the attribute that contains the name of the associated
122   * attribute type.
123   */
124  @NotNull private static final String ATTR_INDEX_ATTR =
125       "ds-index-attribute-type";
126
127
128
129  /**
130   * The name of the attribute that contains the name of the associated
131   * attribute index type.
132   */
133  @NotNull private static final String ATTR_INDEX_TYPE = "ds-index-type";
134
135
136
137  /**
138   * The name of the attribute that contains the string representation of a
139   * filter used for the index.
140   */
141  @NotNull private static final String ATTR_INDEX_FILTER = "ds-index-filter";
142
143
144
145  /**
146   * The name of the attribute that indicates whether the index is trusted.
147   */
148  @NotNull private static final String ATTR_INDEX_TRUSTED = "ds-index-trusted";
149
150
151
152  /**
153   * The name of the attribute that contains the index entry limit.
154   */
155  @NotNull private static final String ATTR_ENTRY_LIMIT =
156       "ds-index-entry-limit";
157
158
159
160  /**
161   * The name of the attribute that contains the number of index keys for which
162   * the entry count has exceeded the limit since the index DB was opened.
163   */
164  @NotNull private static final String ATTR_EXCEEDED_COUNT =
165       "ds-index-exceeded-entry-limit-count-since-db-open";
166
167
168
169  /**
170   * The name of the attribute that contains the number of unique index keys
171   * accessed by search operations that are near (typically, within 80% of) the
172   * index entry limit since the index DB was opened.
173   */
174  @NotNull private static final String ATTR_SEARCH_KEYS_NEAR_LIMIT =
175       "ds-index-unique-keys-near-entry-limit-accessed-by-search-since-db-open";
176
177
178
179  /**
180   * The name of the attribute that contains the number of unique index keys
181   * accessed by search operations that are over the index entry limit since the
182   * index DB was opened.
183   */
184  @NotNull private static final String ATTR_SEARCH_KEYS_OVER_LIMIT =
185       "ds-index-unique-keys-exceeding-entry-limit-accessed-by-search-since-" +
186            "db-open";
187
188
189
190  /**
191   * The name of the attribute that contains the number of unique index keys
192   * accessed by write operations that are near (typically, within 80% of) the
193   * index entry limit since the index DB was opened.
194   */
195  @NotNull private static final String ATTR_WRITE_KEYS_NEAR_LIMIT =
196       "ds-index-unique-keys-near-entry-limit-accessed-by-write-since-db-open";
197
198
199
200  /**
201   * The name of the attribute that contains the number of unique index keys
202   * accessed by write operations that are over the index entry limit since the
203   * index DB was opened.
204   */
205  @NotNull private static final String ATTR_WRITE_KEYS_OVER_LIMIT =
206       "ds-index-unique-keys-exceeding-entry-limit-accessed-by-write-since-" +
207            "db-open";
208
209
210
211  /**
212   * The name of the attribute that indicates whether a matching count should be
213   * maintained for a key that has exceeded the entry limit.
214   */
215  @NotNull private static final String ATTR_MAINTAIN_COUNT =
216       "ds-index-maintain-count";
217
218
219
220  /**
221   * The name of the attribute that indicates whether the index was fully
222   * primed.
223   */
224  @NotNull private static final String ATTR_FULLY_PRIMED =
225       "ds-index-fully-primed-at-backend-open";
226
227
228
229  /**
230   * The name of the attribute that contains a reason explaining why the prime
231   * was not completed.
232   */
233  @NotNull private static final String ATTR_PRIME_INCOMPLETE_REASON =
234       "ds-index-prime-incomplete-reason";
235
236
237
238  /**
239   * The name of the attribute that contains information about an exception that
240   * was encountered while performing the prime.
241   */
242  @NotNull private static final String ATTR_PRIME_EXCEPTION =
243       "ds-index-prime-exception";
244
245
246
247  /**
248   * The name of the attribute that contains the number of keys that were
249   * primed when the backend was opened.
250   */
251  @NotNull private static final String ATTR_PRIMED_KEYS =
252       "ds-index-num-primed-keys-at-backend-open";
253
254
255
256  /**
257   * The name of the attribute that contains the number of times the index has
258   * been updated since the database was opened.
259   */
260  @NotNull private static final String ATTR_WRITE_COUNT =
261       "ds-index-write-count-since-db-open";
262
263
264
265  /**
266   * The name of the attribute that contains the number of keys deleted from the
267   * index since the database was opened.
268   */
269  @NotNull private static final String ATTR_DELETE_COUNT =
270       "ds-index-remove-count-since-db-open";
271
272
273
274  /**
275   * The name of the attribute that contains the number of read operations
276   * against the index since the database was opened.
277   */
278  @NotNull private static final String ATTR_READ_COUNT =
279       "ds-index-read-count-since-db-open";
280
281
282
283  /**
284   * The name of the attribute that contains the number of read operations
285   * performed during search filter evaluation since the database was opened.
286   */
287  @NotNull private static final String ATTR_READ_FOR_SEARCH_COUNT =
288       "ds-index-read-for-search-count-since-db-open";
289
290
291
292  /**
293   * The name of the attribute that contains the number of cursors created for
294   * the index.
295   */
296  @NotNull private static final String ATTR_CURSOR_COUNT =
297       "ds-index-open-cursor-count-since-db-open";
298
299
300
301  /**
302   * The serial version UID for this serializable class.
303   */
304  private static final long serialVersionUID = 9182830448328951893L;
305
306
307
308  // Indicates whether the index was fully primed when the backend came online.
309  @Nullable private final Boolean fullyPrimed;
310
311  // Indicates whether the index should be considered trusted.
312  @Nullable private final Boolean indexTrusted;
313
314  // Indicates whether to maintain a count of matching entries even when the ID
315  // list is not maintained.
316  @Nullable private final Boolean maintainCount;
317
318  // The index entry limit for the index.
319  @Nullable private final Long entryLimit;
320
321  // The number of keys that have exceeded the entry limit since coming online.
322  @Nullable private final Long exceededCount;
323
324  // The number of cursors created in the index since coming online.
325  @Nullable private final Long numCursors;
326
327  // The number of index keys deleted from the index since coming online.
328  @Nullable private final Long numDeletes;
329
330  // The number of reads from the index since coming online.
331  @Nullable private final Long numReads;
332
333  // The number of reads as a result of filter processing from the index since
334  // coming online.
335  @Nullable private final Long numReadsForSearch;
336
337  // The number of writes to the index since coming online.
338  @Nullable private final Long numWrites;
339
340  // The number of keys that were primed when the backend came online.
341  @Nullable private final Long primedKeys;
342
343  // The number of keys near the index entry limit that have been accessed by
344  // search operations since the index came online.
345  @Nullable private final Long searchKeysNearLimit;
346
347  // The number of keys over the index entry limit that have been accessed by
348  // search operations since the index came online.
349  @Nullable private final Long searchKeysOverLimit;
350
351  // The number of keys near the index entry limit that have been accessed by
352  // write operations since the index came online.
353  @Nullable private final Long writeKeysNearLimit;
354
355  // The number of keys over the index entry limit that have been accessed by
356  // write operations since the index came online.
357  @Nullable private final Long writeKeysOverLimit;
358
359  // The name of the associated attribute type.
360  @Nullable private final String attributeType;
361
362  // The name of the associated backend ID.
363  @Nullable private final String backendID;
364
365  // The base DN for the associated backend.
366  @Nullable private final String baseDN;
367
368  // The filter for the associated index.
369  @Nullable private final String indexFilter;
370
371  // The index name for the associated index.
372  @Nullable private final String indexName;
373
374  // The index name of the index type for the index.
375  @Nullable private final String indexType;
376
377  // Information about an exception caught during prime processing.
378  @Nullable private final String primeException;
379
380  // Information about the reason the prime was not completed.
381  @Nullable private final String primeIncompleteReason;
382
383
384
385  /**
386   * Creates a new index monitor entry from the provided entry.
387   *
388   * @param  entry  The entry to be parsed as an index monitor entry.  It must
389   *                not be {@code null}.
390   */
391  public IndexMonitorEntry(@NotNull final Entry entry)
392  {
393    super(entry);
394
395    fullyPrimed           = getBoolean(ATTR_FULLY_PRIMED);
396    indexTrusted          = getBoolean(ATTR_INDEX_TRUSTED);
397    maintainCount         = getBoolean(ATTR_MAINTAIN_COUNT);
398    entryLimit            = getLong(ATTR_ENTRY_LIMIT);
399    exceededCount         = getLong(ATTR_EXCEEDED_COUNT);
400    numCursors            = getLong(ATTR_CURSOR_COUNT);
401    numDeletes            = getLong(ATTR_DELETE_COUNT);
402    numReads              = getLong(ATTR_READ_COUNT);
403    numReadsForSearch     = getLong(ATTR_READ_FOR_SEARCH_COUNT);
404    numWrites             = getLong(ATTR_WRITE_COUNT);
405    primedKeys            = getLong(ATTR_PRIMED_KEYS);
406    searchKeysNearLimit   = getLong(ATTR_SEARCH_KEYS_NEAR_LIMIT);
407    searchKeysOverLimit   = getLong(ATTR_SEARCH_KEYS_OVER_LIMIT);
408    writeKeysNearLimit    = getLong(ATTR_WRITE_KEYS_NEAR_LIMIT);
409    writeKeysOverLimit    = getLong(ATTR_WRITE_KEYS_OVER_LIMIT);
410    attributeType         = getString(ATTR_INDEX_ATTR);
411    backendID             = getString(ATTR_BACKEND_ID);
412    baseDN                = getString(ATTR_BASE_DN);
413    indexFilter           = getString(ATTR_INDEX_FILTER);
414    indexName             = getString(ATTR_INDEX_NAME);
415    indexType             = getString(ATTR_INDEX_TYPE);
416    primeException        = getString(ATTR_PRIME_EXCEPTION);
417    primeIncompleteReason = getString(ATTR_PRIME_INCOMPLETE_REASON);
418  }
419
420
421
422  /**
423   * Retrieves the name of the index database.
424   *
425   * @return  The name of the index database, or {@code null} if it was not
426   *          included in the monitor entry.
427   */
428  @Nullable()
429  public String getIndexName()
430  {
431    return indexName;
432  }
433
434
435
436  /**
437   * Retrieves the backend ID for the associated backend.
438   *
439   * @return  The backend ID for the associated backend, or {@code null} if it
440   *          was not included in the monitor entry.
441   */
442  @Nullable()
443  public String getBackendID()
444  {
445    return backendID;
446  }
447
448
449
450  /**
451   * Retrieves the base DN for the data with which the index is associated.
452   *
453   * @return  The base DN for the data with which the index is associated, or
454   *          {@code null} if it was not included in the monitor entry.
455   */
456  @Nullable()
457  public String getBaseDN()
458  {
459    return baseDN;
460  }
461
462
463
464  /**
465   * Retrieves the name of the attribute type with which the index is
466   * associated.  It will only be available for attribute indexes.
467   *
468   * @return  The name of the attribute type with which the index is associated,
469   *          or {@code null} if it was not included in the monitor entry.
470   */
471  @Nullable()
472  public String getAttributeType()
473  {
474    return attributeType;
475  }
476
477
478
479  /**
480   * Retrieves the name of the attribute index type.  It will only be available
481   * for attribute indexes.
482   *
483   * @return  The name of the attribute index type, or {@code null} if it was
484   *          not included in the monitor entry.
485   */
486  @Nullable()
487  public String getAttributeIndexType()
488  {
489    return indexType;
490  }
491
492
493
494  /**
495   * Retrieves the filter used for the index.  It will only be available for
496   * filter indexes.
497   *
498   * @return  The filter used for the index, or {@code null} if it was not
499   *          included in the monitor entry.
500   */
501  @Nullable()
502  public String getIndexFilter()
503  {
504    return indexFilter;
505  }
506
507
508
509  /**
510   * Indicates whether the index may be considered trusted.  It will only be
511   * available for attribute indexes.
512   *
513   * @return  {@code true} if the index may be considered trusted,
514   *          {@code false} if it is not trusted, or {@code null} if it was not
515   *          included in the monitor entry.
516   */
517  @Nullable()
518  public Boolean isIndexTrusted()
519  {
520    return indexTrusted;
521  }
522
523
524
525  /**
526   * Retrieves the index entry limit, which is the maximum number of entries
527   * that will be allowed to match a key before the ID list for that key will
528   * stop being maintained.
529   *
530   * @return  The index entry limit, or {@code null} if was not included in the
531   *          monitor entry.
532   */
533  @Nullable()
534  public Long getIndexEntryLimit()
535  {
536    return entryLimit;
537  }
538
539
540
541  /**
542   * Retrieves the number of index keys which have stopped being maintained
543   * because the number of matching entries has exceeded the entry limit since
544   * the index was brought online.
545   *
546   * @return  The number of index keys which have exceeded the entry limit since
547   *          the index was brought online, or {@code null} if it was not
548   *          included in the monitor entry.
549   */
550  @Nullable()
551  public Long getEntryLimitExceededCountSinceComingOnline()
552  {
553    return exceededCount;
554  }
555
556
557
558  /**
559   * Retrieves the number of unique index keys near (typically, within 80% of)
560   * the index entry limit that have been accessed by search operations since
561   * the index was brought online.
562   *
563   * @return  The number of unique index keys near the index entry limit that
564   *          have been accessed by search operations since the index was
565   *          brought online, or {@code null} if it was not included in the
566   *          entry.
567   */
568  @Nullable()
569  public Long getUniqueKeysNearEntryLimitAccessedBySearchSinceComingOnline()
570  {
571    return searchKeysNearLimit;
572  }
573
574
575
576  /**
577   * Retrieves the number of unique index keys over the index entry limit that
578   * have been accessed by search operations since the index was brought online.
579   *
580   * @return  The number of unique index keys over the index entry limit that
581   *          have been accessed by search operations since the index was
582   *          brought online, or {@code null} if it was not included in the
583   *          entry.
584   */
585  @Nullable()
586  public Long getUniqueKeysOverEntryLimitAccessedBySearchSinceComingOnline()
587  {
588    return searchKeysOverLimit;
589  }
590
591
592
593  /**
594   * Retrieves the number of unique index keys near (typically, within 80% of)
595   * the index entry limit that have been accessed by add, delete, modify, or
596   * modify DN operations since the index was brought online.
597   *
598   * @return  The number of unique index keys near the index entry limit that
599   *          have been accessed by write operations since the index was
600   *          brought online, or {@code null} if it was not included in the
601   *          entry.
602   */
603  @Nullable()
604  public Long getUniqueKeysNearEntryLimitAccessedByWriteSinceComingOnline()
605  {
606    return writeKeysNearLimit;
607  }
608
609
610
611  /**
612   * Retrieves the number of unique index keys over the index entry limit that
613   * have been accessed by add, delete, modify, or modify DN operations since
614   * the index was brought online.
615   *
616   * @return  The number of unique index keys over the index entry limit that
617   *          have been accessed by write operations since the index was
618   *          brought online, or {@code null} if it was not included in the
619   *          entry.
620   */
621  @Nullable()
622  public Long getUniqueKeysOverEntryLimitAccessedByWriteSinceComingOnline()
623  {
624    return writeKeysOverLimit;
625  }
626
627
628
629  /**
630   * Indicates whether the count of matching entries will be maintained for
631   * index keys that have exceeded the entry limit.  In that case, the entry IDs
632   * for the matching entries will not be available, but the number of matching
633   * entries will be.
634   *
635   * @return  {@code true} if the count of matching entries will be maintained
636   *          for index keys that have exceeded the entry limit, {@code false}
637   *          if not, or {@code null} if it was not included in the monitor
638   *          entry.
639   */
640  @Nullable()
641  public Boolean maintainCountForExceededKeys()
642  {
643    return maintainCount;
644  }
645
646
647
648  /**
649   * Indicates whether this index was fully primed when it was brought online.
650   *
651   * @return  {@code true} if the index was fully primed when it was brought
652   *          online, {@code false} if not, or {@code null} if it was not
653   *          included in the monitor entry.
654   */
655  @Nullable()
656  public Boolean fullyPrimedWhenBroughtOnline()
657  {
658    return fullyPrimed;
659  }
660
661
662
663  /**
664   * Retrieves information about the reason that the index was not fully primed
665   * when the backend was brought online (e.g., the database cache became full,
666   * the prime took too long to complete, or an exception was caught during
667   * processing).
668   *
669   * @return  Information about the reason that the index was not fully primed
670   *          when the backend was brought online, or {@code null} if it was not
671   *          included in the monitor entry.
672   */
673  @Nullable()
674  public String getPrimeIncompleteReason()
675  {
676    return primeIncompleteReason;
677  }
678
679
680
681  /**
682   * Retrieves information about any exception caught during prime processing.
683   *
684   * @return  Information about any exception caught during prime processing, or
685   *          {@code null} if it was not included in the monitor entry.
686   */
687  @Nullable()
688  public String getPrimeException()
689  {
690    return primeException;
691  }
692
693
694
695  /**
696   * Retrieves the number of index keys that were primed when the index was
697   * brought online.
698   *
699   * @return  The number of index keys that were primed when the backend was
700   *          brought online, or {@code null} if it was not included in the
701   *          monitor entry.
702   */
703  @Nullable()
704  public Long getKeysPrimedWhenBroughtOnline()
705  {
706    return primedKeys;
707  }
708
709
710
711  /**
712   * Retrieves the number of index keys that have been inserted or replaced
713   * since the index was brought online.
714   *
715   * @return  The number of index keys that have been inserted or replaced since
716   *          the index was brought online, or {@code null} if it was not
717   *          included in the monitor entry.
718   */
719  @Nullable()
720  public Long getKeysWrittenSinceComingOnline()
721  {
722    return numWrites;
723  }
724
725
726
727  /**
728   * Retrieves the number of index keys that have been deleted since the index
729   * was brought online.
730   *
731   * @return  The number of index keys that have been deleted since the index
732   *          was brought online, or {@code null} if it was not included in the
733   *          monitor entry.
734   */
735  @Nullable()
736  public Long getKeysDeletedSinceComingOnline()
737  {
738    return numDeletes;
739  }
740
741
742
743  /**
744   * Retrieves the number of index keys that have been read since the index was
745   * brought online.
746   *
747   * @return  The number of index keys that have been read since the index was
748   *          brought online, or {@code null} if it was not included in the
749   *          monitor entry.
750   */
751  @Nullable()
752  public Long getKeysReadSinceComingOnline()
753  {
754    return numReads;
755  }
756
757
758
759  /**
760   * Retrieves the number of index reads that have been initiated because the
761   * associated attribute type was included in the filter for a search operation
762   * with a non-base scope since the index was brought online.
763   *
764   * @return  The number of index reads that have been initiated as a result of
765   *          filter processing, or {@code null} if it was not included in the
766   *          monitor entry.
767   */
768  @Nullable()
769  public Long getFilterInitiatedReadsSinceComingOnline()
770  {
771    return numReadsForSearch;
772  }
773
774
775
776  /**
777   * Retrieves the number of cursors created in the index for reading ranges of
778   * keys.  Cursors may be used for processing in a variety of contexts,
779   * including processing for substring or range searches, subtree deletes,
780   * stream values operations, etc.
781   *
782   * @return  The number of cursors created in the index for reading ranges of
783   *          keys, or {@code null} if it was not included in the monitor entry.
784   */
785  @Nullable()
786  public Long getCursorsCreatedSinceComingOnline()
787  {
788    return numCursors;
789  }
790
791
792
793  /**
794   * {@inheritDoc}
795   */
796  @Override()
797  @NotNull()
798  public String getMonitorDisplayName()
799  {
800    return INFO_INDEX_MONITOR_DISPNAME.get();
801  }
802
803
804
805  /**
806   * {@inheritDoc}
807   */
808  @Override()
809  @NotNull()
810  public String getMonitorDescription()
811  {
812    return INFO_INDEX_MONITOR_DESC.get();
813  }
814
815
816
817  /**
818   * {@inheritDoc}
819   */
820  @Override()
821  @NotNull()
822  public Map<String,MonitorAttribute> getMonitorAttributes()
823  {
824    final LinkedHashMap<String,MonitorAttribute> attrs =
825         new LinkedHashMap<>(StaticUtils.computeMapCapacity(19));
826
827    if (indexName != null)
828    {
829      addMonitorAttribute(attrs,
830           ATTR_INDEX_NAME,
831           INFO_INDEX_DISPNAME_INDEX_NAME.get(),
832           INFO_INDEX_DESC_INDEX_NAME.get(),
833           indexName);
834    }
835
836    if (backendID != null)
837    {
838      addMonitorAttribute(attrs,
839           ATTR_BACKEND_ID,
840           INFO_INDEX_DISPNAME_BACKEND_ID.get(),
841           INFO_INDEX_DESC_BACKEND_ID.get(),
842           backendID);
843    }
844
845    if (baseDN != null)
846    {
847      addMonitorAttribute(attrs,
848           ATTR_BASE_DN,
849           INFO_INDEX_DISPNAME_BASE_DN.get(),
850           INFO_INDEX_DESC_BASE_DN.get(),
851           baseDN);
852    }
853
854    if (attributeType != null)
855    {
856      addMonitorAttribute(attrs,
857           ATTR_INDEX_ATTR,
858           INFO_INDEX_DISPNAME_ATTR_TYPE.get(),
859           INFO_INDEX_DESC_ATTR_TYPE.get(),
860           attributeType);
861    }
862
863    if (indexType != null)
864    {
865      addMonitorAttribute(attrs,
866           ATTR_INDEX_TYPE,
867           INFO_INDEX_DISPNAME_INDEX_TYPE.get(),
868           INFO_INDEX_DESC_INDEX_TYPE.get(),
869           indexType);
870    }
871
872    if (indexFilter != null)
873    {
874      addMonitorAttribute(attrs,
875           ATTR_INDEX_FILTER,
876           INFO_INDEX_DISPNAME_FILTER.get(),
877           INFO_INDEX_DESC_FILTER.get(),
878           indexFilter);
879    }
880
881    if (indexTrusted != null)
882    {
883      addMonitorAttribute(attrs,
884           ATTR_INDEX_TRUSTED,
885           INFO_INDEX_DISPNAME_TRUSTED.get(),
886           INFO_INDEX_DESC_TRUSTED.get(),
887           indexTrusted);
888    }
889
890    if (entryLimit != null)
891    {
892      addMonitorAttribute(attrs,
893           ATTR_ENTRY_LIMIT,
894           INFO_INDEX_DISPNAME_ENTRY_LIMIT.get(),
895           INFO_INDEX_DESC_ENTRY_LIMIT.get(),
896           entryLimit);
897    }
898
899    if (exceededCount != null)
900    {
901      addMonitorAttribute(attrs,
902           ATTR_EXCEEDED_COUNT,
903           INFO_INDEX_DISPNAME_EXCEEDED_COUNT.get(),
904           INFO_INDEX_DESC_EXCEEDED_COUNT.get(),
905           exceededCount);
906    }
907
908    if (searchKeysNearLimit != null)
909    {
910      addMonitorAttribute(attrs,
911           ATTR_SEARCH_KEYS_NEAR_LIMIT,
912           INFO_INDEX_DISPNAME_SEARCH_KEYS_NEAR_LIMIT.get(),
913           INFO_INDEX_DESC_SEARCH_KEYS_NEAR_LIMIT.get(),
914           searchKeysNearLimit);
915    }
916
917    if (searchKeysOverLimit != null)
918    {
919      addMonitorAttribute(attrs,
920           ATTR_SEARCH_KEYS_OVER_LIMIT,
921           INFO_INDEX_DISPNAME_SEARCH_KEYS_OVER_LIMIT.get(),
922           INFO_INDEX_DESC_SEARCH_KEYS_OVER_LIMIT.get(),
923           searchKeysOverLimit);
924    }
925
926    if (writeKeysNearLimit != null)
927    {
928      addMonitorAttribute(attrs,
929           ATTR_WRITE_KEYS_NEAR_LIMIT,
930           INFO_INDEX_DISPNAME_WRITE_KEYS_NEAR_LIMIT.get(),
931           INFO_INDEX_DESC_WRITE_KEYS_NEAR_LIMIT.get(),
932           writeKeysNearLimit);
933    }
934
935    if (writeKeysOverLimit != null)
936    {
937      addMonitorAttribute(attrs,
938           ATTR_WRITE_KEYS_OVER_LIMIT,
939           INFO_INDEX_DISPNAME_WRITE_KEYS_OVER_LIMIT.get(),
940           INFO_INDEX_DESC_WRITE_KEYS_OVER_LIMIT.get(),
941           writeKeysOverLimit);
942    }
943
944    if (maintainCount != null)
945    {
946      addMonitorAttribute(attrs,
947           ATTR_MAINTAIN_COUNT,
948           INFO_INDEX_DISPNAME_MAINTAIN_COUNT.get(),
949           INFO_INDEX_DESC_MAINTAIN_COUNT.get(),
950           maintainCount);
951    }
952
953    if (fullyPrimed != null)
954    {
955      addMonitorAttribute(attrs,
956           ATTR_FULLY_PRIMED,
957           INFO_INDEX_DISPNAME_FULLY_PRIMED.get(),
958           INFO_INDEX_DESC_FULLY_PRIMED.get(),
959           fullyPrimed);
960    }
961
962    if (primeIncompleteReason != null)
963    {
964      addMonitorAttribute(attrs,
965           ATTR_PRIME_INCOMPLETE_REASON,
966           INFO_INDEX_DISPNAME_PRIME_INCOMPLETE_REASON.get(),
967           INFO_INDEX_DESC_PRIME_INCOMPLETE_REASON.get(),
968           primeIncompleteReason);
969    }
970
971    if (primeException != null)
972    {
973      addMonitorAttribute(attrs,
974           ATTR_PRIME_EXCEPTION,
975           INFO_INDEX_DISPNAME_PRIME_EXCEPTION.get(),
976           INFO_INDEX_DESC_PRIME_EXCEPTION.get(),
977           primeException);
978    }
979
980    if (primedKeys != null)
981    {
982      addMonitorAttribute(attrs,
983           ATTR_PRIMED_KEYS,
984           INFO_INDEX_DISPNAME_PRIMED_KEYS.get(),
985           INFO_INDEX_DESC_PRIMED_KEYS.get(),
986           primedKeys);
987    }
988
989    if (numWrites != null)
990    {
991      addMonitorAttribute(attrs,
992           ATTR_WRITE_COUNT,
993           INFO_INDEX_DISPNAME_WRITE_COUNT.get(),
994           INFO_INDEX_DESC_WRITE_COUNT.get(),
995           numWrites);
996    }
997
998    if (numDeletes != null)
999    {
1000      addMonitorAttribute(attrs,
1001           ATTR_DELETE_COUNT,
1002           INFO_INDEX_DISPNAME_DELETE_COUNT.get(),
1003           INFO_INDEX_DESC_DELETE_COUNT.get(),
1004           numDeletes);
1005    }
1006
1007    if (numReads != null)
1008    {
1009      addMonitorAttribute(attrs,
1010           ATTR_READ_COUNT,
1011           INFO_INDEX_DISPNAME_READ_COUNT.get(),
1012           INFO_INDEX_DESC_READ_COUNT.get(),
1013           numReads);
1014    }
1015
1016    if (numReadsForSearch != null)
1017    {
1018      addMonitorAttribute(attrs,
1019           ATTR_READ_FOR_SEARCH_COUNT,
1020           INFO_INDEX_DISPNAME_FILTER_INITIATED_READ_COUNT.get(),
1021           INFO_INDEX_DESC_FILTER_INITIATED_READ_COUNT.get(),
1022           numReadsForSearch);
1023    }
1024
1025    if (numCursors != null)
1026    {
1027      addMonitorAttribute(attrs,
1028           ATTR_CURSOR_COUNT,
1029           INFO_INDEX_DISPNAME_CURSOR_COUNT.get(),
1030           INFO_INDEX_DESC_CURSOR_COUNT.get(),
1031           numCursors);
1032    }
1033
1034    return Collections.unmodifiableMap(attrs);
1035  }
1036}