001/*
002 * Copyright 2009-2024 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright 2009-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) 2009-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.Date;
042import java.util.LinkedHashMap;
043import java.util.Map;
044
045import com.unboundid.ldap.sdk.Entry;
046import com.unboundid.util.Debug;
047import com.unboundid.util.NotMutable;
048import com.unboundid.util.NotNull;
049import com.unboundid.util.Nullable;
050import com.unboundid.util.StaticUtils;
051import com.unboundid.util.ThreadSafety;
052import com.unboundid.util.ThreadSafetyLevel;
053
054import static com.unboundid.ldap.sdk.unboundidds.monitors.MonitorMessages.*;
055
056
057
058/**
059 * This class defines a monitor entry that provides information about the state
060 * of a replica, including the base DN, replica ID, and generation ID, as well
061 * as information about its communication with the replication server
062 * <BR>
063 * <BLOCKQUOTE>
064 *   <B>NOTE:</B>  This class, and other classes within the
065 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
066 *   supported for use against Ping Identity, UnboundID, and
067 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
068 *   for proprietary functionality or for external specifications that are not
069 *   considered stable or mature enough to be guaranteed to work in an
070 *   interoperable way with other types of LDAP servers.
071 * </BLOCKQUOTE>
072 * <BR>
073 * The server should present a replica monitor entry for each replicated base
074 * DN.  They can be retrieved using the
075 * {@link MonitorManager#getReplicaMonitorEntries} method.  These entries
076 * provide specific methods for accessing information about the replica.
077 * Alternately, this information may be accessed using the generic API.  See the
078 * {@link MonitorManager} class documentation for an example that demonstrates
079 * the use of the generic API for accessing monitor data.
080 */
081@NotMutable()
082@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
083public final class ReplicaMonitorEntry
084       extends MonitorEntry
085{
086  /**
087   * The structural object class used in replica monitor entries.
088   */
089  @NotNull static final String REPLICA_MONITOR_OC =
090       "ds-replica-monitor-entry";
091
092
093
094  /**
095   * The name of the attribute that holds the age, in milliseconds, of the
096   * oldest operation in the pending changes queue.
097   */
098  @NotNull private static final String
099       ATTR_AGE_OF_OLDEST_PENDING_UPDATE_MILLIS =
100            "age-of-oldest-pending-update";
101
102
103
104  /**
105   * The name of the attribute that contains the base DN for the replicated
106   * data.
107   */
108  @NotNull private static final String ATTR_BASE_DN = "base-dn";
109
110
111
112  /**
113   * The name of the attribute that contains the number of conflict entries
114   * that currently exist in the associated backend.
115   */
116  @NotNull private static final String ATTR_CONFLICT_ENTRY_COUNT =
117       "conflict-entry-count";
118
119
120
121  /**
122   * The name of the attribute that contains the address and port of the
123   * replication server to which the replica is connected.
124   */
125  @NotNull private static final String ATTR_CONNECTED_TO =
126       "connected-to";
127
128
129
130  /**
131   * The name of the attribute that provides information about the current
132   * receive window size.
133   */
134  @NotNull private static final String ATTR_CURRENT_RECEIVE_WINDOW_SIZE =
135       "current-rcv-window";
136
137
138
139  /**
140   * The name of the attribute that provides information about the current send
141   * window size.
142   */
143  @NotNull private static final String ATTR_CURRENT_SEND_WINDOW_SIZE =
144       "current-send-window";
145
146
147
148  /**
149   * The name of the attribute that contains the number of failures that
150   * occurred while attempting to replay changes.
151   */
152  @NotNull private static final String ATTR_FAILED_REPLAYED =
153       "replayed-updates-failed";
154
155
156
157  /**
158   * The name of the attribute that provides the generation ID for the replica.
159   */
160  @NotNull private static final String ATTR_GENERATION_ID = "generation-id";
161
162
163
164  /**
165   * The name of the attribute that holds the latency, in milliseconds, of the
166   * last update that was successfully replayed.
167   */
168  @NotNull private static final String ATTR_LAST_UPDATE_LATENCY_MILLIS =
169       "last-update-latency-millis";
170
171
172
173  /**
174   * The name of the attribute that provides information about the number of
175   * times the connection to the replication server has been lost.
176   */
177  @NotNull private static final String ATTR_LOST_CONNECTIONS =
178       "lost-connections";
179
180
181
182  /**
183   * The name of the attribute that provides information about the maximum
184   * receive window size.
185   */
186  @NotNull private static final String ATTR_MAX_RECEIVE_WINDOW_SIZE =
187       "max-rcv-window";
188
189
190
191  /**
192   * The name of the attribute that provides information about the maximum send
193   * window size.
194   */
195  @NotNull private static final String ATTR_MAX_SEND_WINDOW_SIZE =
196       "max-send-window";
197
198
199
200  /**
201   * The name of the attribute that holds a generalized time representation of
202   * the time that the oldest change was applied in another server but has not
203   * yet replicated to the local server.
204   */
205  @NotNull private static final String ATTR_OLDEST_BACKLOG_CHANGE_TIME =
206       "age-of-oldest-backlog-change";
207
208
209
210  /**
211   * The name of the attribute that contains the number of changes in the
212   * pending change queue that have not yet been committed to the database.
213   */
214  @NotNull private static final String
215       ATTR_PENDING_CHANGES_CURRENT_UNCOMMITTED_SIZE =
216            "pending-changes-current-uncommitted-size";
217
218
219
220  /**
221   * The name of the attribute that contains the maximum number of changes that
222   * have been in the pending changes queue at any time.
223   */
224  @NotNull private static final String
225       ATTR_PENDING_CHANGES_LARGEST_SIZE_REACHED =
226            "pending-changes-largest-size-reached";
227
228
229
230  /**
231   * The name of the attribute that contains the maximum allowed size of the
232   * pending changes queue.
233   */
234  @NotNull private static final String ATTR_PENDING_CHANGES_MAX_CAPACITY =
235       "pending-changes-max-capacity";
236
237
238
239  /**
240   * The name of the attribute that contains the number of times that the server
241   * has attempted to add a change to the pending changes queue when it was
242   * already full.
243   */
244  @NotNull private static final String
245       ATTR_PENDING_CHANGES_NUM_TIMES_ADDED_TO_FULL_QUEUE =
246            "pending-changes-num-times-added-to-full-queue";
247
248
249
250  /**
251   * The name of the attribute that contains the number of times that the server
252   * has logged that an operation in the pending changes queue has stalled.
253   */
254  @NotNull private static final String
255       ATTR_PENDING_CHANGES_NUM_TIMES_STALL_LOGGED =
256            "pending-changes-num-times-stall-logged";
257
258
259
260  /**
261   * The name of the attribute that contains the number of pending updates which
262   * are currently being processed by the Directory Server and have not yet been
263   * sent to the replication server.
264   */
265  @NotNull private static final String ATTR_PENDING_UPDATES = "pending-updates";
266
267
268
269  /**
270   * The name of the attribute that contains the number of acknowledgements
271   * received from the replication server for this replica.
272   */
273  @NotNull private static final String ATTR_RECEIVED_ACKS = "received-acks";
274
275
276
277  /**
278   * The name of the attribute that contains the number of updates received from
279   * the replication server for this replica.
280   */
281  @NotNull private static final String ATTR_RECEIVED_UPDATES =
282       "received-updates";
283
284
285
286  /**
287   * The name of the attribute that contains the average replication latency, in
288   * milliseconds, for operations processed over a recent interval.
289   */
290  @NotNull private static final String ATTR_RECENT_AVERAGE_LATENCY_MILLIS =
291       "recent-average-latency-millis";
292
293
294
295  /**
296   * The name of the attribute that contains the maximum replication latency, in
297   * milliseconds, for any operation processed over a recent interval.
298   */
299  @NotNull private static final String ATTR_RECENT_MAXIMUM_LATENCY_MILLIS =
300       "recent-maximum-latency-millis";
301
302
303
304  /**
305   * The name of the attribute that contains the minimum replication latency, in
306   * milliseconds, for any operation processed over a recent interval.
307   */
308  @NotNull private static final String ATTR_RECENT_MINIMUM_LATENCY_MILLIS =
309       "recent-minimum-latency-millis";
310
311
312
313  /**
314   * The name of the attribute that contains the number of negative replication
315   * latencies encountered over a recent interval.
316   */
317  @NotNull private static final String
318       ATTR_RECENT_NEGATIVE_LATENCY_UPDATE_COUNT =
319            "recent-negative-latency-update-count";
320
321
322
323  /**
324   * The name of the attribute that contains the sum of the replication
325   * latencies, in milliseconds, for operations processed over a recent
326   * interval.
327   */
328  @NotNull private static final String ATTR_RECENT_SUM_LATENCY_MILLIS =
329       "recent-sum-latency-millis";
330
331
332
333  /**
334   * The name of the attribute that contains the number of operations processed
335   * over a recent interval.
336   */
337  @NotNull private static final String ATTR_RECENT_UPDATE_COUNT =
338       "recent-update-count";
339
340
341
342  /**
343   * The name of the attribute that provides the replica ID for this replica.
344   */
345  @NotNull private static final String ATTR_REPLICA_ID = "replica-id";
346
347
348
349  /**
350   * The name of the attribute that contains the number of changes that were
351   * processed with replication assurance but for which assurance could not be
352   * guaranteed for some reason.
353   */
354  @NotNull private static final String
355       ATTR_REPLICATION_ASSURANCE_COMPLETED_ABNORMALLY =
356       "replication-assurance-completed-abnormally";
357
358
359
360  /**
361   * The name of the attribute that contains the number of changes that were
362   * processed with replication assurance and completed successfully within the
363   * assurance constraints.
364   */
365  @NotNull private static final String
366       ATTR_REPLICATION_ASSURANCE_COMPLETED_NORMALLY =
367       "replication-assurance-completed-normally";
368
369
370
371  /**
372   * The name of the attribute that contains the number of changes that were
373   * processed with replication assurance, but one of the target servers was
374   * shut down before assurance could be guaranteed.
375   */
376  @NotNull private static final String
377       ATTR_REPLICATION_ASSURANCE_COMPLETED_WITH_SHUTDOWN =
378       "replication-assurance-completed-with-shutdown";
379
380
381
382  /**
383   * The name of the attribute that contains the number of changes that were
384   * processed with replication assurance, but a timeout was encountered before
385   * assurance could be guaranteed.
386   */
387  @NotNull private static final String
388       ATTR_REPLICATION_ASSURANCE_COMPLETED_WITH_TIMEOUT =
389       "replication-assurance-completed-with-timeout";
390
391
392
393  /**
394   * The name of the attribute that contains the number of changes that have
395   * begun processing with replication assurance enabled.
396   */
397  @NotNull private static final String
398       ATTR_REPLICATION_ASSURANCE_SUBMITTED_OPERATIONS =
399       "replication-assurance-submitted-operations";
400
401
402
403  /**
404   * The name of the attribute that contains the number of changes that have
405   * been applied in other servers but have not yet been replicated to the
406   * local server.
407   */
408  @NotNull private static final String ATTR_REPLICATION_BACKLOG =
409       "replication-backlog";
410
411
412
413  /**
414   * The name of the attribute that contains number of requeued add operations
415   * that failed on a retry attempt.
416   */
417  @NotNull private static final String ATTR_REQUEUE_RETRY_ADD_FAILED_COUNT =
418       "requeue-retry-add-failed-count";
419
420
421
422  /**
423   * The name of the attribute that contains number of requeued add operations
424   * that succeeded on a retry attempt.
425   */
426  @NotNull private static final String ATTR_REQUEUE_RETRY_ADD_SUCCESS_COUNT =
427       "requeue-retry-add-success-count";
428
429
430
431  /**
432   * The name of the attribute that contains number of requeued delete
433   * operations that failed on a retry attempt.
434   */
435  @NotNull private static final String ATTR_REQUEUE_RETRY_DELETE_FAILED_COUNT =
436       "requeue-retry-delete-failed-count";
437
438
439
440  /**
441   * The name of the attribute that contains number of requeued delete
442   * operations that succeeded on a retry attempt.
443   */
444  @NotNull private static final String ATTR_REQUEUE_RETRY_DELETE_SUCCESS_COUNT =
445       "requeue-retry-delete-success-count";
446
447
448
449  /**
450   * The name of the attribute that contains number of requeued modify DN
451   * operations that failed on a retry attempt.
452   */
453  @NotNull private static final String
454       ATTR_REQUEUE_RETRY_MODIFY_DN_FAILED_COUNT =
455            "requeue-retry-modify-dn-failed-count";
456
457
458
459  /**
460   * The name of the attribute that contains number of requeued modify DN
461   * operations that succeeded on a retry attempt.
462   */
463  @NotNull private static final String
464       ATTR_REQUEUE_RETRY_MODIFY_DN_SUCCESS_COUNT =
465            "requeue-retry-modify-dn-success-count";
466
467
468
469  /**
470   * The name of the attribute that contains number of requeued modify
471   * operations that failed on a retry attempt.
472   */
473  @NotNull private static final String ATTR_REQUEUE_RETRY_MODIFY_FAILED_COUNT =
474       "requeue-retry-modify-failed-count";
475
476
477
478  /**
479   * The name of the attribute that contains number of requeued modify
480   * operations that succeeded on a retry attempt.
481   */
482  @NotNull private static final String ATTR_REQUEUE_RETRY_MODIFY_SUCCESS_COUNT =
483       "requeue-retry-modify-success-count";
484
485
486
487  /**
488   * The name of the attribute that contains number of requeued operations that
489   * failed on a retry attempt.
490   */
491  @NotNull private static final String ATTR_REQUEUE_RETRY_OP_FAILED_COUNT =
492       "requeue-retry-op-failed-count";
493
494
495
496  /**
497   * The name of the attribute that contains number of requeued operations that
498   * succeeded on a retry attempt.
499   */
500  @NotNull private static final String ATTR_REQUEUE_RETRY_OP_SUCCESS_COUNT =
501       "requeue-retry-op-success-count";
502
503
504
505  /**
506   * The name of the attribute that contains average length of time in
507   * milliseconds required to successfully retry operations that had been
508   * requeued.
509   */
510  @NotNull private static final String
511       ATTR_REQUEUE_RETRY_OP_SUCCESS_AVERAGE_DURATION_MILLIS =
512            "requeue-retry-op-success-average-duration-millis";
513
514
515
516  /**
517   * The name of the attribute that contains maximum length of time in
518   * milliseconds required to successfully retry any operation that had been
519   * requeued.
520   */
521  @NotNull private static final String
522       ATTR_REQUEUE_RETRY_OP_SUCCESS_MAXIMUM_DURATION_MILLIS =
523            "requeue-retry-op-success-maximum-duration-millis";
524
525
526
527  /**
528   * The name of the attribute that contains total length of time in
529   * milliseconds required to successfully retry operations that had been
530   * requeued.
531   */
532  @NotNull private static final String
533       ATTR_REQUEUE_RETRY_OP_SUCCESS_TOTAL_DURATION_MILLIS =
534            "requeue-retry-op-success-total-millis";
535
536
537
538  /**
539   * The name of the attribute that provides information about the number of
540   * updates that were replayed after resolving a modify conflict.
541   */
542  @NotNull private static final String ATTR_RESOLVED_MODIFY_CONFLICTS =
543       "resolved-modify-conflicts";
544
545
546
547  /**
548   * The name of the attribute that provides information about the number of
549   * updates that were replayed after resolving a naming conflict.
550   */
551  @NotNull private static final String ATTR_RESOLVED_NAMING_CONFLICTS =
552       "resolved-naming-conflicts";
553
554
555
556  /**
557   * The name of the attribute that contains the number of acknowledgements sent
558   * from the replication server from this replica.
559   */
560  @NotNull private static final String ATTR_SENT_ACKS = "sent-acks";
561
562
563
564  /**
565   * The name of the attribute that provides information about the number of
566   * updates sent to the replication server from this replica.
567   */
568  @NotNull private static final String ATTR_SENT_UPDATES = "sent-updates";
569
570
571
572  /**
573   * The name of the attribute that indicates whether SSL is used when
574   * communicating with the replication server.
575   */
576  @NotNull private static final String ATTR_SSL_ENCRYPTION = "ssl-encryption";
577
578
579
580  /**
581   * The name of the attribute that provides information about the number of
582   * updates that have been successfully replayed with no problems.
583   */
584  @NotNull private static final String ATTR_SUCCESSFUL_REPLAYED =
585       "replayed-updates-ok";
586
587
588
589  /**
590   * The name of the attribute that contains the average replication latency, in
591   * milliseconds, for operations processed since the server started.
592   */
593  @NotNull private static final String ATTR_TOTAL_AVERAGE_LATENCY_MILLIS =
594       "total-average-latency-millis";
595
596
597
598  /**
599   * The name of the attribute that contains the maximum replication latency, in
600   * milliseconds, for any operation since the server started.
601   */
602  @NotNull private static final String ATTR_TOTAL_MAXIMUM_LATENCY_MILLIS =
603       "total-maximum-latency-millis";
604
605
606
607  /**
608   * The name of the attribute that contains the minimum replication latency, in
609   * milliseconds, for any operation since the server started.
610   */
611  @NotNull private static final String ATTR_TOTAL_MINIMUM_LATENCY_MILLIS =
612       "total-minimum-latency-millis";
613
614
615
616  /**
617   * The name of the attribute that contains the number of negative replication
618   * latencies encountered since the server stared.
619   */
620  @NotNull private static final String
621       ATTR_TOTAL_NEGATIVE_LATENCY_UPDATE_COUNT =
622            "total-negative-latency-update-count";
623
624
625
626  /**
627   * The name of the attribute that provides information about the total number
628   * of updates that have been replayed in some form.
629   */
630  @NotNull private static final String ATTR_TOTAL_REPLAYED = "replayed-updates";
631
632
633
634  /**
635   * The name of the attribute that contains the sum of replication latencies,
636   * in milliseconds, for operations processed since the server started.
637   */
638  @NotNull private static final String ATTR_TOTAL_SUM_LATENCY_MILLIS =
639       "total-sum-latency-millis";
640
641
642
643  /**
644   * The name of the attribute that contains the total number of replicated
645   * operations processed since the server stared.
646   */
647  @NotNull private static final String ATTR_TOTAL_UPDATE_COUNT =
648       "total-update-count";
649
650
651
652  /**
653   * The name of the attribute that provides information about the number of
654   * updates that could not be replayed because of an unresolved naming
655   * conflict.
656   */
657  @NotNull private static final String ATTR_UNRESOLVED_NAMING_CONFLICTS =
658       "unresolved-naming-conflicts";
659
660
661
662  /**
663   * The serial version UID for this serializable class.
664   */
665  private static final long serialVersionUID = -2327746532075017532L;
666
667
668
669  // Indicates whether the replica uses SSL when communicating with the
670  // replication server.
671  @Nullable private final Boolean useSSL;
672
673  // The time that the oldest backlog change was originally processed.
674  @Nullable private final Date oldestBacklogChangeTime;
675
676  // The average duration, in milliseconds, required to process an operation on
677  // a successful retry attempt.
678  @Nullable private final Double requeueRetrySuccessAverageDurationMillis;
679
680  // The maximum duration, in milliseconds, required to process an operation on
681  // a successful retry attempt.
682  @Nullable private final Double requeueRetrySuccessMaximumDurationMillis;
683
684  // The age of the oldest pending update, in milliseconds.
685  @Nullable private final Long ageOfOldestPendingUpdateMillis;
686
687  // The number of conflict entries currently in the associated backend.
688  @Nullable private final Long conflictEntryCount;
689
690  // The current receive window size.
691  @Nullable private final Long currentReceiveWindowSize;
692
693  // The current send window size.
694  @Nullable private final Long currentSendWindowSize;
695
696  // The number of updates that could not be replayed successfully.
697  @Nullable private final Long failedReplayed;
698
699  // The last update latency, in milliseconds.
700  @Nullable private final Long lastUpdateLatencyMillis;
701
702  // The number of lost connections.
703  @Nullable private final Long lostConnections;
704
705  // The maximum receive window size.
706  @Nullable private final Long maxReceiveWindowSize;
707
708  // The maximum send window size.
709  @Nullable private final Long maxSendWindowSize;
710
711  // The number of pending changes that have not yet been committed.
712  @Nullable private final Long pendingChangesCurrentUncommittedSize;
713
714  // The largest size of the pending changes queue.
715  @Nullable private final Long pendingChangesLargestSizeReached;
716
717  // The maximum capacity of the pending changes queue.
718  @Nullable private final Long pendingChangesMaxCapacity;
719
720  // The number of attempts to add to a full pending changes queue.
721  @Nullable private final Long pendingChangesNumTimesAddedToFullQueue;
722
723  // The number of times the server logged that an operation in the pending
724  // changes queue has stalled.
725  @Nullable private final Long pendingChangesNumTimesStallLogged;
726
727  // The number of pending updates that haven't been sent to the replication
728  // server.
729  @Nullable private final Long pendingUpdates;
730
731  // The number of acknowledgements received from the replication server.
732  @Nullable private final Long receivedAcks;
733
734  // The number of updates received from the replication server.
735  @Nullable private final Long receivedUpdates;
736
737  // The recent average replication latency, in milliseconds.
738  @Nullable private final Long recentAverageLatencyMillis;
739
740  // The recent maximum replication latency, in milliseconds.
741  @Nullable private final Long recentMaximumLatencyMillis;
742
743  // The recent minimum replication latency, in milliseconds.
744  @Nullable private final Long recentMinimumLatencyMillis;
745
746  // The recent negative replication latency count.
747  @Nullable private final Long recentNegativeLatencyUpdateCount;
748
749  // The sum of replication latencies for recent updates applied.
750  @Nullable private final Long recentSumLatencyMillis;
751
752  // The number of replication updates applied over a recent interval.
753  @Nullable private final Long recentUpdateCount;
754
755  // The number of updates replayed after resolving a modify conflict.
756  @Nullable private final Long replayedAfterModifyConflict;
757
758  // The number of updates replayed after resolving a naming conflict.
759  @Nullable private final Long replayedAfterNamingConflict;
760
761  // The number of changes for which requested replication assurance could not
762  // be guaranteed.
763  @Nullable private final Long replicationAssuranceCompletedAbnormally;
764
765  // The number of changes for which requested replication assurance was
766  // achieved.
767  @Nullable private final Long replicationAssuranceCompletedNormally;
768
769  // The number of changes for which requested replication assurance could not
770  // be guarnateed because it was interrupted by a server shutdown.
771  @Nullable private final Long replicationAssuranceCompletedWithShutdown;
772
773  // The number of changes for which requested replication assurance could not
774  // be guarnateed because a timeout was encountered.
775  @Nullable private final Long replicationAssuranceCompletedWithTimeout;
776
777  // The number of changes for which requested replication assurance has been
778  // requested.
779  @Nullable private final Long replicationAssuranceSubmittedOperations;
780
781  // The number of changes that have been applied in other servers but have not
782  // yet been replicated to the local server.
783  @Nullable private final Long replicationBacklog;
784
785  // The port number of the replication server.
786  @Nullable private final Long replicationServerPort;
787
788  // The number of add operations that failed after being retried.
789  @Nullable private final Long requeueRetryAddFailedCount;
790
791  // The number of add operations that succeeded after being retried.
792  @Nullable private final Long requeueRetryAddSuccessCount;
793
794  // The number of delete operations that failed after being retried.
795  @Nullable private final Long requeueRetryDeleteFailedCount;
796
797  // The number of delete operations that succeeded after being retried.
798  @Nullable private final Long requeueRetryDeleteSuccessCount;
799
800  // The number of modify DN operations that failed after being retried.
801  @Nullable private final Long requeueRetryModifyDNFailedCount;
802
803  // The number of modify DN operations that succeeded after being retried.
804  @Nullable private final Long requeueRetryModifyDNSuccessCount;
805
806  // The number of modify operations that failed after being retried.
807  @Nullable private final Long requeueRetryModifyFailedCount;
808
809  // The number of modify operations that succeeded after being retried.
810  @Nullable private final Long requeueRetryModifySuccessCount;
811
812  // The total number of operations that failed after being retried.
813  @Nullable private final Long requeueRetryOpFailedCount;
814
815  // The total number of operations that succeeded after being retried.
816  @Nullable private final Long requeueRetryOpSuccessCount;
817
818  // The total length of time in milliseconds required to successfully process
819  // retried operations.
820  @Nullable private final Long requeueRetrySuccessTotalDurationMillis;
821
822  // The number of acknowledgements sent to the replication server.
823  @Nullable private final Long sentAcks;
824
825  // The number of updates sent to the replication server.
826  @Nullable private final Long sentUpdates;
827
828  // The number of updates replayed successfully.
829  @Nullable private final Long successfullyReplayed;
830
831  // The overall average latency for replicated operations.
832  @Nullable private final Long totalAverageLatencyMillis;
833
834  // The maximum latency for any replicated operations.
835  @Nullable private final Long totalMaximumLatencyMillis;
836
837  // The minimum latency for any replicated operations.
838  @Nullable private final Long totalMinimumLatencyMillis;
839
840  // The total number of negative replication latencies encountered.
841  @Nullable private final Long totalNegativeLatencyUpdateCount;
842
843  // The total number of updates replayed.
844  @Nullable private final Long totalReplayed;
845
846  // The total duration of all replication latencies, in milliseconds.
847  @Nullable private final Long totalSumLatencyMillis;
848
849  // The total number of updates applied via replication.
850  @Nullable private final Long totalUpdateCount;
851
852  // The number of unresolved naming conflicts that could not be successfully
853  // replayed.
854  @Nullable private final Long unresolvedNamingConflicts;
855
856  // The base DN for the replicated data.
857  @Nullable private final String baseDN;
858
859  // The generation ID for the replicated data.
860  @Nullable private final String generationID;
861
862  // The replica ID for the replica.
863  @Nullable private final String replicaID;
864
865  // The address of the replication server.
866  @Nullable private final String replicationServerAddress;
867
868
869
870  /**
871   * Creates a new replica monitor entry from the provided entry.
872   *
873   * @param  entry  The entry to be parsed as a replica monitor entry.  It must
874   *                not be {@code null}.
875   */
876  public ReplicaMonitorEntry(@NotNull final Entry entry)
877  {
878    super(entry);
879
880    useSSL = getBoolean(ATTR_SSL_ENCRYPTION);
881    oldestBacklogChangeTime = getDate(ATTR_OLDEST_BACKLOG_CHANGE_TIME);
882    requeueRetrySuccessAverageDurationMillis =
883         getDouble(ATTR_REQUEUE_RETRY_OP_SUCCESS_AVERAGE_DURATION_MILLIS);
884    requeueRetrySuccessMaximumDurationMillis =
885         getDouble(ATTR_REQUEUE_RETRY_OP_SUCCESS_MAXIMUM_DURATION_MILLIS);
886    ageOfOldestPendingUpdateMillis =
887         getLong(ATTR_AGE_OF_OLDEST_PENDING_UPDATE_MILLIS);
888    conflictEntryCount = getLong(ATTR_CONFLICT_ENTRY_COUNT);
889    currentReceiveWindowSize = getLong(ATTR_CURRENT_RECEIVE_WINDOW_SIZE);
890    currentSendWindowSize = getLong(ATTR_CURRENT_SEND_WINDOW_SIZE);
891    failedReplayed = getLong(ATTR_FAILED_REPLAYED);
892    lastUpdateLatencyMillis = getLong(ATTR_LAST_UPDATE_LATENCY_MILLIS);
893    lostConnections = getLong(ATTR_LOST_CONNECTIONS);
894    maxReceiveWindowSize = getLong(ATTR_MAX_RECEIVE_WINDOW_SIZE);
895    maxSendWindowSize = getLong(ATTR_MAX_SEND_WINDOW_SIZE);
896    pendingChangesCurrentUncommittedSize =
897         getLong(ATTR_PENDING_CHANGES_CURRENT_UNCOMMITTED_SIZE);
898    pendingChangesLargestSizeReached =
899         getLong(ATTR_PENDING_CHANGES_LARGEST_SIZE_REACHED);
900    pendingChangesMaxCapacity = getLong(ATTR_PENDING_CHANGES_MAX_CAPACITY);
901    pendingChangesNumTimesAddedToFullQueue =
902         getLong(ATTR_PENDING_CHANGES_NUM_TIMES_ADDED_TO_FULL_QUEUE);
903    pendingChangesNumTimesStallLogged =
904         getLong(ATTR_PENDING_CHANGES_NUM_TIMES_STALL_LOGGED);
905    pendingUpdates = getLong(ATTR_PENDING_UPDATES);
906    receivedAcks = getLong(ATTR_RECEIVED_ACKS);
907    receivedUpdates = getLong(ATTR_RECEIVED_UPDATES);
908    recentAverageLatencyMillis = getLong(ATTR_RECENT_AVERAGE_LATENCY_MILLIS);
909    recentMaximumLatencyMillis = getLong(ATTR_RECENT_MAXIMUM_LATENCY_MILLIS);
910    recentMinimumLatencyMillis = getLong(ATTR_RECENT_MINIMUM_LATENCY_MILLIS);
911    recentNegativeLatencyUpdateCount =
912         getLong(ATTR_RECENT_NEGATIVE_LATENCY_UPDATE_COUNT);
913    recentSumLatencyMillis = getLong(ATTR_RECENT_SUM_LATENCY_MILLIS);
914    recentUpdateCount = getLong(ATTR_RECENT_UPDATE_COUNT);
915    replayedAfterModifyConflict = getLong(ATTR_RESOLVED_MODIFY_CONFLICTS);
916    replayedAfterNamingConflict = getLong(ATTR_RESOLVED_NAMING_CONFLICTS);
917    replicationAssuranceCompletedAbnormally =
918         getLong(ATTR_REPLICATION_ASSURANCE_COMPLETED_ABNORMALLY);
919    replicationAssuranceCompletedNormally =
920         getLong(ATTR_REPLICATION_ASSURANCE_COMPLETED_NORMALLY);
921    replicationAssuranceCompletedWithShutdown =
922         getLong(ATTR_REPLICATION_ASSURANCE_COMPLETED_WITH_SHUTDOWN);
923    replicationAssuranceCompletedWithTimeout =
924         getLong(ATTR_REPLICATION_ASSURANCE_COMPLETED_WITH_TIMEOUT);
925    replicationAssuranceSubmittedOperations =
926         getLong(ATTR_REPLICATION_ASSURANCE_SUBMITTED_OPERATIONS);
927    replicationBacklog = getLong(ATTR_REPLICATION_BACKLOG);
928    requeueRetryAddFailedCount = getLong(ATTR_REQUEUE_RETRY_ADD_FAILED_COUNT);
929    requeueRetryAddSuccessCount = getLong(ATTR_REQUEUE_RETRY_ADD_SUCCESS_COUNT);
930    requeueRetryDeleteFailedCount =
931         getLong(ATTR_REQUEUE_RETRY_DELETE_FAILED_COUNT);
932    requeueRetryDeleteSuccessCount =
933         getLong(ATTR_REQUEUE_RETRY_DELETE_SUCCESS_COUNT);
934    requeueRetryModifyFailedCount =
935         getLong(ATTR_REQUEUE_RETRY_MODIFY_FAILED_COUNT);
936    requeueRetryModifySuccessCount =
937         getLong(ATTR_REQUEUE_RETRY_MODIFY_SUCCESS_COUNT);
938    requeueRetryModifyDNFailedCount =
939         getLong(ATTR_REQUEUE_RETRY_MODIFY_DN_FAILED_COUNT);
940    requeueRetryModifyDNSuccessCount =
941         getLong(ATTR_REQUEUE_RETRY_MODIFY_DN_SUCCESS_COUNT);
942    requeueRetryOpFailedCount = getLong(ATTR_REQUEUE_RETRY_OP_FAILED_COUNT);
943    requeueRetryOpSuccessCount = getLong(ATTR_REQUEUE_RETRY_OP_SUCCESS_COUNT);
944    requeueRetrySuccessTotalDurationMillis =
945         getLong(ATTR_REQUEUE_RETRY_OP_SUCCESS_TOTAL_DURATION_MILLIS);
946    sentAcks = getLong(ATTR_SENT_ACKS);
947    sentUpdates = getLong(ATTR_SENT_UPDATES);
948    successfullyReplayed = getLong(ATTR_SUCCESSFUL_REPLAYED);
949    totalAverageLatencyMillis = getLong(ATTR_TOTAL_AVERAGE_LATENCY_MILLIS);
950    totalMaximumLatencyMillis = getLong(ATTR_TOTAL_MAXIMUM_LATENCY_MILLIS);
951    totalMinimumLatencyMillis = getLong(ATTR_TOTAL_MINIMUM_LATENCY_MILLIS);
952    totalNegativeLatencyUpdateCount =
953         getLong(ATTR_TOTAL_NEGATIVE_LATENCY_UPDATE_COUNT);
954    totalReplayed = getLong(ATTR_TOTAL_REPLAYED);
955    totalSumLatencyMillis =  getLong(ATTR_TOTAL_SUM_LATENCY_MILLIS);
956    totalUpdateCount = getLong(ATTR_TOTAL_UPDATE_COUNT);
957    unresolvedNamingConflicts = getLong(ATTR_UNRESOLVED_NAMING_CONFLICTS);
958    baseDN = getString(ATTR_BASE_DN);
959    generationID = getString(ATTR_GENERATION_ID);
960    replicaID = getString(ATTR_REPLICA_ID);
961
962    String addr = null;
963    Long   port = null;
964    final String connectedTo = getString(ATTR_CONNECTED_TO);
965    if (connectedTo != null)
966    {
967      try
968      {
969        final int colonPos = connectedTo.indexOf(':');
970        if (colonPos > 0)
971        {
972          addr = connectedTo.substring(0, colonPos);
973          port = Long.parseLong(connectedTo.substring(colonPos+1));
974        }
975      }
976      catch (final Exception e)
977      {
978        Debug.debugException(e);
979        addr = null;
980        port = null;
981      }
982    }
983
984    replicationServerAddress = addr;
985    replicationServerPort    = port;
986  }
987
988
989
990  /**
991   * Retrieves the base DN for this replica.
992   *
993   * @return  The base DN for this replica, or {@code null} if it was not
994   *          included in the monitor entry.
995   */
996  @Nullable()
997  public String getBaseDN()
998  {
999    return baseDN;
1000  }
1001
1002
1003
1004  /**
1005   * Retrieves the replica ID for this replica.
1006   *
1007   * @return  The replica ID for this replica, or {@code null} if it was not
1008   *          included in the monitor entry.
1009   */
1010  @Nullable()
1011  public String getReplicaID()
1012  {
1013    return replicaID;
1014  }
1015
1016
1017
1018  /**
1019   * Retrieves the generation ID for this replica.
1020   *
1021   * @return  The generation ID for this replica, or {@code null} if it was not
1022   *          included in the monitor entry.
1023   */
1024  @Nullable()
1025  public String getGenerationID()
1026  {
1027    return generationID;
1028  }
1029
1030
1031
1032  /**
1033   * Retrieves the address of the replication server to which this replica is
1034   * connected.
1035   *
1036   * @return  The address of the replication server to which this replica is
1037   *          connected, or {@code null} if it was not included in the monitor
1038   *          entry.
1039   */
1040  @Nullable()
1041  public String getReplicationServerAddress()
1042  {
1043    return replicationServerAddress;
1044  }
1045
1046
1047
1048  /**
1049   * Retrieves the port number of the replication server to which this replica
1050   * is connected.
1051   *
1052   * @return  The port number of the replication server to which this replica is
1053   *          connected, or {@code null} if it was not included in the monitor
1054   *          entry.
1055   */
1056  @Nullable()
1057  public Long getReplicationServerPort()
1058  {
1059    return replicationServerPort;
1060  }
1061
1062
1063
1064  /**
1065   * Indicates whether this replica uses SSL when communicating with the
1066   * replication server.
1067   *
1068   * @return  {@code Boolean.TRUE} if this replica uses SSL when communicating
1069   *          with the replication server, {@code Boolean.FALSE} if it does not
1070   *          use SSL, or {@code null} if it was not included in the monitor
1071   *          entry.
1072   */
1073  @Nullable()
1074  public Boolean useSSL()
1075  {
1076    return useSSL;
1077  }
1078
1079
1080
1081  /**
1082   * Retrieves the number of times this replica has lost the connection to a
1083   * replication server.
1084   *
1085   * @return  The number of times this replica has lost the connection to a
1086   *          replication server, or {@code null} if it was not included in the
1087   *          monitor entry.
1088   */
1089  @Nullable()
1090  public Long getLostConnections()
1091  {
1092    return lostConnections;
1093  }
1094
1095
1096
1097  /**
1098   * Retrieves the total number of replicated operations processed since the
1099   * server started.
1100   *
1101   * @return  The total number of replicated operations processed since the
1102   *          server started, or {@code null} if it was not included in the
1103   *          monitor entry.
1104   */
1105  @Nullable()
1106  public Long getTotalUpdateCount()
1107  {
1108    return totalUpdateCount;
1109  }
1110
1111
1112
1113  /**
1114   * Retrieves the number of updates that this replica has received from the
1115   * replication server.
1116   *
1117   * @return  The number of updates that this replica has received from the
1118   *          replication server, or {@code null} if it was not included in the
1119   *          monitor entry.
1120   */
1121  @Nullable()
1122  public Long getReceivedUpdates()
1123  {
1124    return receivedUpdates;
1125  }
1126
1127
1128
1129  /**
1130   * Retrieves the number of updates that this replica has sent to the
1131   * replication server.
1132   *
1133   * @return  The number of updates that this replica has sent to the
1134   *          replication server, or {@code null} if it was not included in the
1135   *          monitor entry.
1136   */
1137  @Nullable()
1138  public Long getSentUpdates()
1139  {
1140    return sentUpdates;
1141  }
1142
1143
1144
1145  /**
1146   * Retrieves the number of acknowledgements that this replica has received
1147   * from other servers.
1148   *
1149   * @return  The number of acknowledgements that this replica has received
1150   *          from other servers, or {@code null} if it was not included in the
1151   *          monitor entry.
1152     */
1153  @Nullable()
1154  public Long getReceivedAcks()
1155  {
1156    return receivedAcks;
1157  }
1158
1159
1160
1161  /**
1162   * Retrieves the number of acknowledgements that this replica has sent to
1163   * other servers.
1164   *
1165   * @return  The number of acknowledgements that this replica has sent to
1166   *          other servers, or {@code null} if it was not included in the
1167   *          monitor entry.
1168   */
1169  @Nullable()
1170  public Long getSentAcks()
1171  {
1172    return sentAcks;
1173  }
1174
1175
1176
1177  /**
1178   * Retrieves the number of updates that are currently in progress in the
1179   * Directory Server and have not yet been sent to the replication server.
1180   *
1181   * @return  The number of updates that are currently in progress in the
1182   *          Directory Server and have not yet been sent to the replication
1183   *          server, or {@code null} if it was not included in the monitor
1184   *          entry.
1185   */
1186  @Nullable()
1187  public Long getPendingUpdates()
1188  {
1189    return pendingUpdates;
1190  }
1191
1192
1193
1194  /**
1195   * Retrieves the total number of updates that have been replayed in this
1196   * replica.
1197   *
1198   * @return  The total number of updates that have been replayed in this
1199   *          replica, or {@code null} if it was not included in the monitor
1200   *          entry.
1201   */
1202  @Nullable()
1203  public Long getTotalUpdatesReplayed()
1204  {
1205    return totalReplayed;
1206  }
1207
1208
1209
1210  /**
1211   * Retrieves the number of updates that have been successfully replayed in
1212   * this replica without conflicts.
1213   *
1214   * @return  The number of updates that have been successfully replayed in this
1215   *          replica without conflicts, or {@code null} if it was not included
1216   *          in the monitor entry.
1217   */
1218  @Nullable()
1219  public Long getUpdatesSuccessfullyReplayed()
1220  {
1221    return successfullyReplayed;
1222  }
1223
1224
1225
1226  /**
1227   * Retrieves the number of failures that have occurred while attempting to
1228   * replay changes.
1229   *
1230   * @return  The number of failures that have occurred while attempting to
1231   *          replay changes, or {@code null} if it was not included in the
1232   *          monitor entry.
1233   */
1234  @Nullable()
1235  public Long getUpdateReplayFailures()
1236  {
1237    return failedReplayed;
1238  }
1239
1240
1241
1242  /**
1243   * Retrieves the number of updates that have been replayed in this replica
1244   * after automatically resolving a modify conflict.
1245   *
1246   * @return  The number of updates that have been replayed in this replica
1247   *          after automatically resolving a modify conflict, or {@code null}
1248   *          if it was not included in the monitor entry.
1249   */
1250  @Nullable()
1251  public Long getUpdatesReplayedAfterModifyConflict()
1252  {
1253    return replayedAfterModifyConflict;
1254  }
1255
1256
1257
1258  /**
1259   * Retrieves the number of updates that have been replayed in this replica
1260   * after automatically resolving a naming conflict.
1261   *
1262   * @return  The number of updates that have been replayed in this replica
1263   *          after automatically resolving a naming conflict, or {@code null}
1264   *          if it was not included in the monitor entry.
1265   */
1266  @Nullable()
1267  public Long getUpdatesReplayedAfterNamingConflict()
1268  {
1269    return replayedAfterNamingConflict;
1270  }
1271
1272
1273
1274  /**
1275   * Retrieves the number of updates that could not be replayed as a result of a
1276   * naming conflict that could not be automatically resolved.
1277   *
1278   * @return  The number of updates that could not be replayed as a result of a
1279   *          naming conflict that could not be automatically resolved, or
1280   *          {@code null} if it was not included in the monitor entry.
1281   */
1282  @Nullable()
1283  public Long getUnresolvedNamingConflicts()
1284  {
1285    return unresolvedNamingConflicts;
1286  }
1287
1288
1289
1290  /**
1291   * Retrieves the number of conflict entries that currently exist in the
1292   * associated backend.
1293   *
1294   * @return  The number of conflict entries that currently exist in the
1295   *          associated backend, or {@code null} if it was not included in the
1296   *          monitor entry.
1297   *
1298   *
1299   * The name of the attribute that contains the number of conflict entries
1300   * that currently exist in the associated backend.
1301   */
1302  @Nullable()
1303  public Long getConflictEntryCount()
1304  {
1305    return conflictEntryCount;
1306  }
1307
1308
1309
1310  /**
1311   * Retrieves the current receive window size for this replica.
1312   *
1313   * @return  The current receive window size for this replica, or {@code null}
1314   *          if it was not included in the monitor entry.
1315   */
1316  @Nullable()
1317  public Long getCurrentReceiveWindowSize()
1318  {
1319    return currentReceiveWindowSize;
1320  }
1321
1322
1323
1324  /**
1325   * Retrieves the current send window size for this replica.
1326   *
1327   * @return  The current send window size for this replica, or {@code null} if
1328   *          it was not included in the monitor entry.
1329   */
1330  @Nullable()
1331  public Long getCurrentSendWindowSize()
1332  {
1333    return currentSendWindowSize;
1334  }
1335
1336
1337
1338  /**
1339   * Retrieves the maximum receive window size for this replica.
1340   *
1341   * @return  The maximum receive window size for this replica, or {@code null}
1342   *          if it was not included in the monitor entry.
1343   */
1344  @Nullable()
1345  public Long getMaximumReceiveWindowSize()
1346  {
1347    return maxReceiveWindowSize;
1348  }
1349
1350
1351
1352  /**
1353   * Retrieves the maximum send window size for this replica.
1354   *
1355   * @return  The maximum send window size for this replica, or {@code null} if
1356   *          it was not included in the monitor entry.
1357   */
1358  @Nullable()
1359  public Long getMaximumSendWindowSize()
1360  {
1361    return maxSendWindowSize;
1362  }
1363
1364
1365
1366  /**
1367   * Retrieves the number of changes that have been applied in one or more other
1368   * replicas but have not yet been applied in the local server.
1369   *
1370   * @return  The number of changes that have been applied in one or more other
1371   *          replicas but have not yet been applied in the local server, or
1372   *          {@code null} if it was not included in the monitor entry.
1373   */
1374  @Nullable()
1375  public Long getReplicationBacklog()
1376  {
1377    return replicationBacklog;
1378  }
1379
1380
1381
1382  /**
1383   * Retrieves the completion time for the oldest change that has been applied
1384   * in one or other replicas but has not yet been applied in the local server.
1385   *
1386   * @return  The completion time for the oldest change that has been applied in
1387   *          one or more other replicas but has not yet been applied in the
1388   *          local server, or {@code null} if it was not included in the
1389   *          monitor entry.
1390   */
1391  @Nullable()
1392  public Date getOldestBacklogChangeTime()
1393  {
1394    return oldestBacklogChangeTime;
1395  }
1396
1397
1398
1399  /**
1400   * Retrieves the number of changes in the pending changes queue that have not
1401   * yet been committed to the local database.
1402   *
1403   * @return  The number of changes in the pending changes queue that have not
1404   *          yet been committed to the local database, or {@code null} if it
1405   *          was not included in the monitor entry.
1406   */
1407  @Nullable()
1408  public Long getPendingChangesCurrentUncommittedSize()
1409  {
1410    return pendingChangesCurrentUncommittedSize;
1411  }
1412
1413
1414
1415  /**
1416   * Retrieves the age, in milliseconds, of the oldest operation in the
1417   * pending changes queue.
1418   *
1419   * @return  The age, in milliseconds, of the oldest operation in the pending
1420   *          changes queue, or {@code null} if it was not included in the
1421   *          monitor entry.
1422   */
1423  @Nullable()
1424  public Long getAgeOfOldestPendingUpdateMillis()
1425  {
1426    return ageOfOldestPendingUpdateMillis;
1427  }
1428
1429
1430
1431  /**
1432   * Retrieves the maximum number of operations that may be held in the
1433   * pending changes queue.
1434   *
1435   * @return  The maximum number of operations that may be held in the pending
1436   *          changes queue, or {@code null} if it was not included in the
1437   *          monitor entry.
1438   */
1439  @Nullable()
1440  public Long getPendingChangesMaxCapacity()
1441  {
1442    return pendingChangesMaxCapacity;
1443  }
1444
1445
1446
1447  /**
1448   * Retrieves the largest number of operations that have been in the pending
1449   * changes queue at any time.
1450   *
1451   * @return  The largest number of operations that have been in the pending
1452   *          changes queue at any time, or {@code null} if it was not included
1453   *          in the monitor entry.
1454   */
1455  @Nullable()
1456  public Long getPendingChangesLargestSizeReached()
1457  {
1458    return pendingChangesLargestSizeReached;
1459  }
1460
1461
1462
1463  /**
1464   * Retrieves the number of times that the server attempted to add a change to
1465   * the pending changes queue when it was already full.
1466   *
1467   * @return  The number of times that the server attempted to add a change to
1468   *          the pending changes queue when it was already full, or
1469   *          {@code null} if it was not included in the monitor entry.
1470   */
1471  @Nullable()
1472  public Long getPendingChangesNumTimesAddedToFullQueue()
1473  {
1474    return pendingChangesNumTimesAddedToFullQueue;
1475  }
1476
1477
1478
1479  /**
1480   * Retrieves the number of times that the server has logged that an operation
1481   * in the pending changes queue has stalled.
1482   *
1483   * @return  The number of times that the server has logged that an operation
1484   *          in the pending changes queue has stalled, or {@code null} if it
1485   *          was not included in the monitor entry.
1486   */
1487  @Nullable()
1488  public Long getPendingChangesNumTimesStallLogged()
1489  {
1490    return pendingChangesNumTimesStallLogged;
1491  }
1492
1493
1494
1495  /**
1496   * Retrieves the latency, in milliseconds, of the last update that was
1497   * successfully replayed.
1498   *
1499   * @return  The latency, in milliseconds, of the last update that was
1500   *          successfully replayed, or {@code null} if it was not included in
1501   *          the monitor entry.
1502   */
1503  @Nullable()
1504  public Long getLastUpdateLatencyMillis()
1505  {
1506    return lastUpdateLatencyMillis;
1507  }
1508
1509
1510
1511  /**
1512   * Retrieves the average replication latency, in milliseconds, for operations
1513   * processed over a recent interval.
1514   *
1515   * @return  The average replication latency, in milliseconds, for operations
1516   *          processed over a recent interval, or {@code null} if it was not
1517   *          included in the monitor entry.
1518   */
1519  @Nullable()
1520  public Long getRecentAverageLatencyMillis()
1521  {
1522    return recentAverageLatencyMillis;
1523  }
1524
1525
1526
1527  /**
1528   * Retrieves the maximum replication latency, in milliseconds, for any
1529   * operation processed over a recent interval.
1530   *
1531   * @return  The maximum replication latency, in milliseconds, for any
1532   *          operation processed over a recent interval, or {@code null} if it
1533   *          was not included in the monitor entry.
1534   */
1535  @Nullable()
1536  public Long getRecentMaximumLatencyMillis()
1537  {
1538    return recentMaximumLatencyMillis;
1539  }
1540
1541
1542
1543  /**
1544   * Retrieves the minimum replication latency, in milliseconds, for any
1545   * operation processed over a recent interval.
1546   *
1547   * @return  The minimum replication latency, in milliseconds, for any
1548   *          operation processed over a recent interval, or {@code null} if it
1549   *          was not included in the monitor entry.
1550   */
1551  @Nullable()
1552  public Long getRecentMinimumLatencyMillis()
1553  {
1554    return recentMinimumLatencyMillis;
1555  }
1556
1557
1558
1559  /**
1560   * Retrieves the number of negative replication latencies encountered over a
1561   * recent interval.
1562   *
1563   * @return  The number of negative replication latencies encountered over a
1564   *          recent interval, or {@code null} if it was not included in the
1565   *          monitor entry.
1566   */
1567  @Nullable()
1568  public Long getRecentNegativeLatencyUpdateCount()
1569  {
1570    return recentNegativeLatencyUpdateCount;
1571  }
1572
1573
1574
1575  /**
1576   * Retrieves the sum of latencies, in milliseconds, for operations processed
1577   * over a recent interval.
1578   *
1579   * @return  The sum of latencies, in milliseconds, for operations processed
1580   *          over a recent interval, or {@code null} if it was not included in
1581   *          the monitor entry.
1582   */
1583  @Nullable()
1584  public Long getRecentSumLatencyMillis()
1585  {
1586    return recentSumLatencyMillis;
1587  }
1588
1589
1590
1591  /**
1592   * Retrieves the number of operations processed over the recent interval used
1593   * for recent replication latency calculations.
1594   *
1595   * @return  The number of operations processed over the recent interval, or
1596   *          {@code null} if it was not included in the monitor entry.
1597   */
1598  @Nullable()
1599  public Long getRecentUpdateCount()
1600  {
1601    return recentUpdateCount;
1602  }
1603
1604
1605
1606  /**
1607   * Retrieves the average replication latency, in milliseconds, for operations
1608   * processed since the server was started.
1609   *
1610   * @return  The average replication latency, in milliseconds, for operations
1611   *          processed since the server was started, or {@code null} if it was
1612   *          not included in the monitor entry.
1613   */
1614  @Nullable()
1615  public Long getTotalAverageLatencyMillis()
1616  {
1617    return totalAverageLatencyMillis;
1618  }
1619
1620
1621
1622  /**
1623   * Retrieves the maximum replication latency, in milliseconds, for any
1624   * operation processed since the server was started.
1625   *
1626   * @return  The maximum replication latency, in milliseconds, for any
1627   *          operation processed since the server was started, or {@code null}
1628   *          if it was not included in the monitor entry.
1629   */
1630  @Nullable()
1631  public Long getTotalMaximumLatencyMillis()
1632  {
1633    return totalMaximumLatencyMillis;
1634  }
1635
1636
1637
1638  /**
1639   * Retrieves the minimum replication latency, in milliseconds, for any
1640   * operation processed since the server was started.
1641   *
1642   * @return  The minimum replication latency, in milliseconds, for any
1643   *          operation processed since the server was started, or {@code null}
1644   *          if it was not included in the monitor entry.
1645   */
1646  @Nullable()
1647  public Long getTotalMinimumLatencyMillis()
1648  {
1649    return totalMinimumLatencyMillis;
1650  }
1651
1652
1653
1654  /**
1655   * Retrieves the number of negative replication latencies encountered since
1656   * the server was started.
1657   *
1658   * @return  The number of negative replication latencies encountered since the
1659   *          server was started, or {@code null} if it was not included in the
1660   *          monitor entry.
1661   */
1662  @Nullable()
1663  public Long getTotalNegativeLatencyUpdateCount()
1664  {
1665    return totalNegativeLatencyUpdateCount;
1666  }
1667
1668
1669
1670  /**
1671   * Retrieves the sum of latencies, in milliseconds, for operations processed
1672   * since the server was started.
1673   *
1674   * @return  The sum of latencies, in milliseconds, for operations processed
1675   *          since the server was started.
1676   */
1677  @Nullable()
1678  public Long getTotalSumLatencyMillis()
1679  {
1680    return totalSumLatencyMillis;
1681  }
1682
1683
1684
1685  /**
1686   * Retrieves the number of changes that have begun processing with replication
1687   * assurance enabled.
1688   *
1689   * @return  The number of changes that have begun processing with replication
1690   *          assurance enabled, or {@code null} if it was not included in the
1691   *          monitor entry.
1692   */
1693  @Nullable()
1694  public Long getReplicationAssuranceSubmittedOperations()
1695  {
1696    return replicationAssuranceSubmittedOperations;
1697  }
1698
1699
1700
1701  /**
1702   * Retrieves the number of changes that were processed with replication
1703   * assurance and completed successfully within the assurance constraints.
1704   *
1705   * @return  The number of changes that were processed with replication
1706   *          assurance and completed successfully within the assurance
1707   *          constraints, or {@code null} if it was not included in the monitor
1708   *          entry.
1709   */
1710  @Nullable()
1711  public Long getReplicationAssuranceCompletedNormally()
1712  {
1713    return replicationAssuranceCompletedNormally;
1714  }
1715
1716
1717
1718  /**
1719   * Retrieves the number of changes that were processed with replication
1720   * assurance but could not be completed successfully within the assurance
1721   * constraints.
1722   *
1723   * @return  The number of changes that were processed with replication
1724   *          assurance but could not be completed successfully within the
1725   *          assurance constraints, or {@code null} if it was not included in
1726   *          the monitor entry.
1727   */
1728  @Nullable()
1729  public Long getReplicationAssuranceCompletedAbnormally()
1730  {
1731    return replicationAssuranceCompletedAbnormally;
1732  }
1733
1734
1735
1736  /**
1737   * Retrieves the number of changes that were processed with replication
1738   * assurance but could not be completed successfully within the assurance
1739   * constraints because a timeout was encountered.
1740   *
1741   * @return  The number of changes that were processed with replication
1742   *          assurance but could not be completed successfully within the
1743   *          assurance constraints because a timeout was encountered, or
1744   *          {@code null} if it was not included in the monitor entry.
1745   */
1746  @Nullable()
1747  public Long getReplicationAssuranceCompletedWithTimeout()
1748  {
1749    return replicationAssuranceCompletedWithTimeout;
1750  }
1751
1752
1753
1754  /**
1755   * Retrieves the number of changes that were processed with replication
1756   * assurance but could not be completed successfully within the assurance
1757   * constraints because of a server shutdown.
1758   *
1759   * @return  The number of changes that were processed with replication
1760   *          assurance but could not be completed successfully within the
1761   *          assurance constraints because of a server shutdown, or
1762   *          {@code null} if it was not included in the monitor entry.
1763   */
1764  @Nullable()
1765  public Long getReplicationAssuranceCompletedWithShutdown()
1766  {
1767    return replicationAssuranceCompletedWithShutdown;
1768  }
1769
1770
1771
1772  /**
1773   * Retrieves the number of operations of any type that failed on their initial
1774   * attempt, but that were requeued and succeeded on a retry.
1775   *
1776   * @return  The number of operations of any type that failed on their initial
1777   *          attempt, but that were requeued and succeeded on a retry, or
1778   *          {@code null} if it was not included in the monitor entry.
1779   */
1780  @Nullable()
1781  public Long getRequeueRetryOpSuccessCount()
1782  {
1783    return requeueRetryOpSuccessCount;
1784  }
1785
1786
1787
1788  /**
1789   * Retrieves the number of operations of any type that failed on their initial
1790   * attempt, were requeued, and failed again on a retry.
1791   *
1792   * @return  The number of operations of any type that failed on their initial
1793   *          attempt, were requeued, and failed again on a retry, or
1794   *          {@code null} if it was not included in the monitor entry.
1795   */
1796  @Nullable()
1797  public Long getRequeueRetryOpFailedCount()
1798  {
1799    return requeueRetryOpFailedCount;
1800  }
1801
1802
1803
1804  /**
1805   * Retrieves the number of add operations that failed on their initial
1806   * attempt, but that were requeued and succeeded on a retry.
1807   *
1808   * @return  The number of add operations that failed on their initial attempt,
1809   *          but that were requeued and succeeded on a retry, or {@code null}
1810   *          if it was not included in the monitor entry.
1811   */
1812  @Nullable()
1813  public Long getRequeueRetryAddSuccessCount()
1814  {
1815    return requeueRetryAddSuccessCount;
1816  }
1817
1818
1819
1820  /**
1821   * Retrieves the number of add operations that failed on their initial
1822   * attempt, were requeued, and failed again on a retry.
1823   *
1824   * @return  The number of add operations that failed on their initial attempt,
1825   *          were requeued, and failed again on a retry, or {@code null} if it
1826   *          was not included in the monitor entry.
1827   */
1828  @Nullable()
1829  public Long getRequeueRetryAddFailedCount()
1830  {
1831    return requeueRetryAddFailedCount;
1832  }
1833
1834
1835
1836  /**
1837   * Retrieves the number of delete operations that failed on their initial
1838   * attempt, but that were requeued and succeeded on a retry.
1839   *
1840   * @return  The number of delete operations that failed on their initial
1841   *          attempt, but that were requeued and succeeded on a retry, or
1842   *          {@code null} if it was not included in the monitor entry.
1843   */
1844  @Nullable()
1845  public Long getRequeueRetryDeleteSuccessCount()
1846  {
1847    return requeueRetryDeleteSuccessCount;
1848  }
1849
1850
1851
1852  /**
1853   * Retrieves the number of delete operations that failed on their initial
1854   * attempt, were requeued, and failed again on a retry.
1855   *
1856   * @return  The number of delete operations that failed on their initial
1857   *          attempt, were requeued, and failed again on a retry, or
1858   *          {@code null} if it was not included in the monitor entry.
1859   */
1860  @Nullable()
1861  public Long getRequeueRetryDeleteFailedCount()
1862  {
1863    return requeueRetryDeleteFailedCount;
1864  }
1865
1866
1867
1868  /**
1869   * Retrieves the number of modify operations that failed on their initial
1870   * attempt, but that were requeued and succeeded on a retry.
1871   *
1872   * @return  The number of modify operations that failed on their initial
1873   *          attempt, but that were requeued and succeeded on a retry, or
1874   *          {@code null} if it was not included in the monitor entry.
1875   */
1876  @Nullable()
1877  public Long getRequeueRetryModifySuccessCount()
1878  {
1879    return requeueRetryModifySuccessCount;
1880  }
1881
1882
1883
1884  /**
1885   * Retrieves the number of modify operations that failed on their initial
1886   * attempt, were requeued, and failed again on a retry.
1887   *
1888   * @return  The number of modify operations that failed on their initial
1889   *          attempt, were requeued, and failed again on a retry, or
1890   *          {@code null} if it was not included in the monitor entry.
1891   */
1892  @Nullable()
1893  public Long getRequeueRetryModifyFailedCount()
1894  {
1895    return requeueRetryModifyFailedCount;
1896  }
1897
1898
1899
1900  /**
1901   * Retrieves the number of modify DN operations that failed on their initial
1902   * attempt, but that were requeued and succeeded on a retry.
1903   *
1904   * @return  The number of modify DN operations that failed on their initial
1905   *          attempt, but that were requeued and succeeded on a retry, or
1906   *          {@code null} if it was not included in the monitor entry.
1907   */
1908  @Nullable()
1909  public Long getRequeueRetryModifyDNSuccessCount()
1910  {
1911    return requeueRetryModifyDNSuccessCount;
1912  }
1913
1914
1915
1916  /**
1917   * Retrieves the number of modify DN operations that failed on their initial
1918   * attempt, were requeued, and failed again on a retry.
1919   *
1920   * @return  The number of modify DN operations that failed on their initial
1921   *          attempt, were requeued, and failed again on a retry, or
1922   *          {@code null} if it was not included in the monitor entry.
1923   */
1924  @Nullable()
1925  public Long getRequeueRetryModifyDNFailedCount()
1926  {
1927    return requeueRetryModifyDNFailedCount;
1928  }
1929
1930
1931
1932  /**
1933   * Retrieves the average length of time, in milliseconds, required to
1934   * successfully process operations on a retry attempt after the initial
1935   * failure.
1936   *
1937   * @return  The average length of time, in milliseconds, required to
1938   *          successfully process operations on a retry attempt after the
1939   *          initial failure, or {@code null} if it was not included in the
1940   *          monitor entry.
1941   */
1942  @Nullable()
1943  public Double getRequeueRetrySuccessAverageDurationMillis()
1944  {
1945    return requeueRetrySuccessAverageDurationMillis;
1946  }
1947
1948
1949
1950  /**
1951   * Retrieves the maximum length of time, in milliseconds, required to
1952   * successfully process an operation on a retry attempt after the initial
1953   * failure.
1954   *
1955   * @return  The maximum length of time, in milliseconds, required to
1956   *          successfully process an operation on a retry attempt after the
1957   *          initial failure, or {@code null} if it was not included in the
1958   *          monitor entry.
1959   */
1960  @Nullable()
1961  public Double getRequeueRetrySuccessMaximumDurationMillis()
1962  {
1963    return requeueRetrySuccessMaximumDurationMillis;
1964  }
1965
1966
1967
1968  /**
1969   * Retrieves the total length of time, in milliseconds, required to process
1970   * operations that succeeded on a retry attempt after an initial failure.
1971   *
1972   * @return  The total length of time, in milliseconds, required to process
1973   *          operations that succeeded on a retry attempt after an initial
1974   *          failure, or {@code null} if it was not included in the monitor
1975   *          entry.
1976   */
1977  @Nullable()
1978  public Long getRequeueRetrySuccessTotalDurationMillis()
1979  {
1980    return requeueRetrySuccessTotalDurationMillis;
1981  }
1982
1983
1984
1985  /**
1986   * {@inheritDoc}
1987   */
1988  @Override()
1989  @NotNull()
1990  public String getMonitorDisplayName()
1991  {
1992    return INFO_REPLICA_MONITOR_DISPNAME.get();
1993  }
1994
1995
1996
1997  /**
1998   * {@inheritDoc}
1999   */
2000  @Override()
2001  @NotNull()
2002  public String getMonitorDescription()
2003  {
2004    return INFO_REPLICA_MONITOR_DESC.get();
2005  }
2006
2007
2008
2009  /**
2010   * {@inheritDoc}
2011   */
2012  @Override()
2013  @NotNull()
2014  public Map<String,MonitorAttribute> getMonitorAttributes()
2015  {
2016    final LinkedHashMap<String,MonitorAttribute> attrs =
2017         new LinkedHashMap<>(StaticUtils.computeMapCapacity(30));
2018
2019    if (baseDN != null)
2020    {
2021      addMonitorAttribute(attrs,
2022           ATTR_BASE_DN,
2023           INFO_REPLICA_DISPNAME_BASE_DN.get(),
2024           INFO_REPLICA_DESC_BASE_DN.get(),
2025           baseDN);
2026    }
2027
2028    if (replicaID != null)
2029    {
2030      addMonitorAttribute(attrs,
2031           ATTR_REPLICA_ID,
2032           INFO_REPLICA_DISPNAME_REPLICA_ID.get(),
2033           INFO_REPLICA_DESC_REPLICA_ID.get(),
2034           replicaID);
2035    }
2036
2037    if (generationID != null)
2038    {
2039      addMonitorAttribute(attrs,
2040           ATTR_GENERATION_ID,
2041           INFO_REPLICA_DISPNAME_GENERATION_ID.get(),
2042           INFO_REPLICA_DESC_GENERATION_ID.get(),
2043           generationID);
2044    }
2045
2046    if (replicationServerAddress != null)
2047    {
2048      addMonitorAttribute(attrs,
2049           ATTR_CONNECTED_TO,
2050           INFO_REPLICA_DISPNAME_CONNECTED_TO.get(),
2051           INFO_REPLICA_DESC_CONNECTED_TO.get(),
2052           replicationServerAddress + ':' + replicationServerPort);
2053    }
2054
2055    if (useSSL != null)
2056    {
2057      addMonitorAttribute(attrs,
2058           ATTR_SSL_ENCRYPTION,
2059           INFO_REPLICA_DISPNAME_USE_SSL.get(),
2060           INFO_REPLICA_DESC_USE_SSL.get(),
2061           useSSL);
2062    }
2063
2064    if (lostConnections != null)
2065    {
2066      addMonitorAttribute(attrs,
2067           ATTR_LOST_CONNECTIONS,
2068           INFO_REPLICA_DISPNAME_LOST_CONNECTIONS.get(),
2069           INFO_REPLICA_DESC_LOST_CONNECTIONS.get(),
2070           lostConnections);
2071    }
2072
2073    if (totalUpdateCount != null)
2074    {
2075      addMonitorAttribute(attrs,
2076           ATTR_TOTAL_UPDATE_COUNT,
2077           INFO_REPLICA_DISPNAME_TOTAL_UPDATE_COUNT.get(),
2078           INFO_REPLICA_DESC_TOTAL_UPDATE_COUNT.get(),
2079           totalUpdateCount);
2080    }
2081
2082    if (receivedUpdates != null)
2083    {
2084      addMonitorAttribute(attrs,
2085           ATTR_RECEIVED_UPDATES,
2086           INFO_REPLICA_DISPNAME_RECEIVED_UPDATES.get(),
2087           INFO_REPLICA_DESC_RECEIVED_UPDATES.get(),
2088           receivedUpdates);
2089    }
2090
2091    if (sentUpdates != null)
2092    {
2093      addMonitorAttribute(attrs,
2094           ATTR_SENT_UPDATES,
2095           INFO_REPLICA_DISPNAME_SENT_UPDATES.get(),
2096           INFO_REPLICA_DESC_SENT_UPDATES.get(),
2097           sentUpdates);
2098    }
2099
2100    if (receivedAcks != null)
2101    {
2102      addMonitorAttribute(attrs,
2103           ATTR_RECEIVED_ACKS,
2104           INFO_REPLICA_DISPNAME_RECEIVED_ACKS.get(),
2105           INFO_REPLICA_DESC_RECEIVED_ACKS.get(),
2106           receivedAcks);
2107    }
2108
2109    if (sentAcks != null)
2110    {
2111      addMonitorAttribute(attrs,
2112           ATTR_SENT_ACKS,
2113           INFO_REPLICA_DISPNAME_SENT_ACKS.get(),
2114           INFO_REPLICA_DESC_SENT_ACKS.get(),
2115           sentAcks);
2116    }
2117
2118    if (pendingUpdates != null)
2119    {
2120      addMonitorAttribute(attrs,
2121           ATTR_PENDING_UPDATES,
2122           INFO_REPLICA_DISPNAME_PENDING_UPDATES.get(),
2123           INFO_REPLICA_DESC_PENDING_UPDATES.get(),
2124           pendingUpdates);
2125    }
2126
2127    if (totalReplayed != null)
2128    {
2129      addMonitorAttribute(attrs,
2130           ATTR_TOTAL_REPLAYED,
2131           INFO_REPLICA_DISPNAME_TOTAL_REPLAYED.get(),
2132           INFO_REPLICA_DESC_TOTAL_REPLAYED.get(),
2133           totalReplayed);
2134    }
2135
2136    if (successfullyReplayed != null)
2137    {
2138      addMonitorAttribute(attrs,
2139           ATTR_SUCCESSFUL_REPLAYED,
2140           INFO_REPLICA_DISPNAME_SUCCESSFUL_REPLAYED.get(),
2141           INFO_REPLICA_DESC_SUCCESSFUL_REPLAYED.get(),
2142           successfullyReplayed);
2143    }
2144
2145    if (failedReplayed != null)
2146    {
2147      addMonitorAttribute(attrs,
2148           ATTR_FAILED_REPLAYED,
2149           INFO_REPLICA_DISPNAME_FAILED_REPLAYED.get(),
2150           INFO_REPLICA_DESC_FAILED_REPLAYED.get(),
2151           failedReplayed);
2152    }
2153
2154    if (replayedAfterModifyConflict != null)
2155    {
2156      addMonitorAttribute(attrs,
2157           ATTR_RESOLVED_MODIFY_CONFLICTS,
2158           INFO_REPLICA_DISPNAME_RESOLVED_MODIFY_CONFLICTS.get(),
2159           INFO_REPLICA_DESC_RESOLVED_MODIFY_CONFLICTS.get(),
2160           replayedAfterModifyConflict);
2161    }
2162
2163    if (replayedAfterNamingConflict != null)
2164    {
2165      addMonitorAttribute(attrs,
2166           ATTR_RESOLVED_NAMING_CONFLICTS,
2167           INFO_REPLICA_DISPNAME_RESOLVED_NAMING_CONFLICTS.get(),
2168           INFO_REPLICA_DESC_RESOLVED_NAMING_CONFLICTS.get(),
2169           replayedAfterNamingConflict);
2170    }
2171
2172    if (unresolvedNamingConflicts != null)
2173    {
2174      addMonitorAttribute(attrs,
2175           ATTR_UNRESOLVED_NAMING_CONFLICTS,
2176           INFO_REPLICA_DISPNAME_UNRESOLVED_NAMING_CONFLICTS.get(),
2177           INFO_REPLICA_DESC_UNRESOLVED_NAMING_CONFLICTS.get(),
2178           unresolvedNamingConflicts);
2179    }
2180
2181    if (conflictEntryCount != null)
2182    {
2183      addMonitorAttribute(attrs,
2184           ATTR_CONFLICT_ENTRY_COUNT,
2185           INFO_REPLICA_DISPNAME_CONFLICT_ENTRY_COUNT.get(),
2186           INFO_REPLICA_DESC_CONFLICT_ENTRY_COUNT.get(),
2187           conflictEntryCount);
2188    }
2189
2190    if (currentReceiveWindowSize != null)
2191    {
2192      addMonitorAttribute(attrs,
2193           ATTR_CURRENT_RECEIVE_WINDOW_SIZE,
2194           INFO_REPLICA_DISPNAME_CURRENT_RECEIVE_WINDOW_SIZE.get(),
2195           INFO_REPLICA_DESC_CURRENT_RECEIVE_WINDOW_SIZE.get(),
2196           currentReceiveWindowSize);
2197    }
2198
2199    if (currentSendWindowSize != null)
2200    {
2201      addMonitorAttribute(attrs,
2202           ATTR_CURRENT_SEND_WINDOW_SIZE,
2203           INFO_REPLICA_DISPNAME_CURRENT_SEND_WINDOW_SIZE.get(),
2204           INFO_REPLICA_DESC_CURRENT_SEND_WINDOW_SIZE.get(),
2205           currentSendWindowSize);
2206    }
2207
2208    if (maxReceiveWindowSize != null)
2209    {
2210      addMonitorAttribute(attrs,
2211           ATTR_MAX_RECEIVE_WINDOW_SIZE,
2212           INFO_REPLICA_DISPNAME_MAX_RECEIVE_WINDOW_SIZE.get(),
2213           INFO_REPLICA_DESC_MAX_RECEIVE_WINDOW_SIZE.get(),
2214           maxReceiveWindowSize);
2215    }
2216
2217    if (maxSendWindowSize != null)
2218    {
2219      addMonitorAttribute(attrs,
2220           ATTR_MAX_SEND_WINDOW_SIZE,
2221           INFO_REPLICA_DISPNAME_MAX_SEND_WINDOW_SIZE.get(),
2222           INFO_REPLICA_DESC_MAX_SEND_WINDOW_SIZE.get(),
2223           maxSendWindowSize);
2224    }
2225
2226    if (replicationBacklog != null)
2227    {
2228      addMonitorAttribute(attrs,
2229           ATTR_REPLICATION_BACKLOG,
2230           INFO_REPLICA_DISPNAME_REPLICATION_BACKLOG.get(),
2231           INFO_REPLICA_DESC_REPLICATION_BACKLOG.get(),
2232           replicationBacklog);
2233    }
2234
2235    if (oldestBacklogChangeTime != null)
2236    {
2237      addMonitorAttribute(attrs,
2238           ATTR_OLDEST_BACKLOG_CHANGE_TIME,
2239           INFO_REPLICA_DISPNAME_OLDEST_BACKLOG_CHANGE_TIME.get(),
2240           INFO_REPLICA_DESC_OLDEST_BACKLOG_CHANGE_TIME.get(),
2241           oldestBacklogChangeTime);
2242    }
2243
2244    if (pendingChangesCurrentUncommittedSize != null)
2245    {
2246      addMonitorAttribute(attrs,
2247           ATTR_PENDING_CHANGES_CURRENT_UNCOMMITTED_SIZE,
2248           INFO_REPLICA_DISPNAME_PENDING_CHANGES_UNCOMMITTED_SIZE.get(),
2249           INFO_REPLICA_DESC_PENDING_CHANGES_UNCOMMITTED_SIZE.get(),
2250           pendingChangesCurrentUncommittedSize);
2251    }
2252
2253    if (ageOfOldestPendingUpdateMillis != null)
2254    {
2255      addMonitorAttribute(attrs,
2256           ATTR_AGE_OF_OLDEST_PENDING_UPDATE_MILLIS,
2257           INFO_REPLICA_DISPNAME_AGE_OF_OLDEST_PENDING_UPDATE.get(),
2258           INFO_REPLICA_DESC_AGE_OF_OLDEST_PENDING_UPDATE.get(),
2259           ageOfOldestPendingUpdateMillis);
2260    }
2261
2262    if (pendingChangesMaxCapacity != null)
2263    {
2264      addMonitorAttribute(attrs,
2265           ATTR_PENDING_CHANGES_MAX_CAPACITY,
2266           INFO_REPLICA_DISPNAME_PENDING_CHANGES_MAX_CAPACITY.get(),
2267           INFO_REPLICA_DESC_PENDING_CHANGES_MAX_CAPACITY.get(),
2268           pendingChangesMaxCapacity);
2269    }
2270
2271    if (pendingChangesLargestSizeReached != null)
2272    {
2273      addMonitorAttribute(attrs,
2274           ATTR_PENDING_CHANGES_LARGEST_SIZE_REACHED,
2275           INFO_REPLICA_DISPNAME_PENDING_CHANGES_LARGEST_SIZE.get(),
2276           INFO_REPLICA_DESC_PENDING_CHANGES_LARGEST_SIZE.get(),
2277           pendingChangesLargestSizeReached);
2278    }
2279
2280    if (pendingChangesNumTimesAddedToFullQueue != null)
2281    {
2282      addMonitorAttribute(attrs,
2283           ATTR_PENDING_CHANGES_NUM_TIMES_ADDED_TO_FULL_QUEUE,
2284           INFO_REPLICA_DISPNAME_PENDING_CHANGES_ADD_TO_FULL.get(),
2285           INFO_REPLICA_DESC_PENDING_CHANGES_ADD_TO_FULL.get(),
2286           pendingChangesNumTimesAddedToFullQueue);
2287    }
2288
2289    if (pendingChangesNumTimesStallLogged != null)
2290    {
2291      addMonitorAttribute(attrs,
2292           ATTR_PENDING_CHANGES_NUM_TIMES_STALL_LOGGED,
2293           INFO_REPLICA_DISPNAME_PENDING_CHANGES_STALL_LOGGED.get(),
2294           INFO_REPLICA_DESC_PENDING_CHANGES_STALL_LOGGED.get(),
2295           pendingChangesNumTimesStallLogged);
2296    }
2297
2298    if (lastUpdateLatencyMillis != null)
2299    {
2300      addMonitorAttribute(attrs,
2301           ATTR_LAST_UPDATE_LATENCY_MILLIS,
2302           INFO_REPLICA_DISPNAME_LAST_UPDATE_LATENCY.get(),
2303           INFO_REPLICA_DESC_LAST_UPDATE_LATENCY.get(),
2304           lastUpdateLatencyMillis);
2305    }
2306
2307    if (recentAverageLatencyMillis != null)
2308    {
2309      addMonitorAttribute(attrs,
2310           ATTR_RECENT_AVERAGE_LATENCY_MILLIS,
2311           INFO_REPLICA_DISPNAME_RECENT_AVERAGE_LATENCY.get(),
2312           INFO_REPLICA_DESC_RECENT_AVERAGE_LATENCY.get(),
2313           recentAverageLatencyMillis);
2314    }
2315
2316    if (recentMaximumLatencyMillis != null)
2317    {
2318      addMonitorAttribute(attrs,
2319           ATTR_RECENT_MAXIMUM_LATENCY_MILLIS,
2320           INFO_REPLICA_DISPNAME_RECENT_MAX_LATENCY.get(),
2321           INFO_REPLICA_DESC_RECENT_MAX_LATENCY.get(),
2322           recentMaximumLatencyMillis);
2323    }
2324
2325    if (recentMinimumLatencyMillis != null)
2326    {
2327      addMonitorAttribute(attrs,
2328           ATTR_RECENT_MINIMUM_LATENCY_MILLIS,
2329           INFO_REPLICA_DISPNAME_RECENT_MIN_LATENCY.get(),
2330           INFO_REPLICA_DESC_RECENT_MIN_LATENCY.get(),
2331           recentMinimumLatencyMillis);
2332    }
2333
2334    if (recentNegativeLatencyUpdateCount != null)
2335    {
2336      addMonitorAttribute(attrs,
2337           ATTR_RECENT_NEGATIVE_LATENCY_UPDATE_COUNT,
2338           INFO_REPLICA_DISPNAME_RECENT_NEGATIVE_LATENCY.get(),
2339           INFO_REPLICA_DESC_RECENT_NEGATIVE_LATENCY.get(),
2340           recentNegativeLatencyUpdateCount);
2341    }
2342
2343    if (recentSumLatencyMillis != null)
2344    {
2345      addMonitorAttribute(attrs,
2346           ATTR_RECENT_SUM_LATENCY_MILLIS,
2347           INFO_REPLICA_DISPNAME_RECENT_SUM_LATENCY.get(),
2348           INFO_REPLICA_DESC_RECENT_SUM_LATENCY.get(),
2349           recentSumLatencyMillis);
2350    }
2351
2352    if (recentUpdateCount != null)
2353    {
2354      addMonitorAttribute(attrs,
2355           ATTR_RECENT_UPDATE_COUNT,
2356           INFO_REPLICA_DISPNAME_RECENT_UPDATE_COUNT.get(),
2357           INFO_REPLICA_DESC_RECENT_UPDATE_COUNT.get(),
2358           recentUpdateCount);
2359    }
2360
2361    if (totalAverageLatencyMillis != null)
2362    {
2363      addMonitorAttribute(attrs,
2364           ATTR_TOTAL_AVERAGE_LATENCY_MILLIS,
2365           INFO_REPLICA_DISPNAME_TOTAL_AVERAGE_LATENCY.get(),
2366           INFO_REPLICA_DESC_TOTAL_AVERAGE_LATENCY.get(),
2367           totalAverageLatencyMillis);
2368    }
2369
2370    if (totalMaximumLatencyMillis != null)
2371    {
2372      addMonitorAttribute(attrs,
2373           ATTR_TOTAL_MAXIMUM_LATENCY_MILLIS,
2374           INFO_REPLICA_DISPNAME_TOTAL_MAX_LATENCY.get(),
2375           INFO_REPLICA_DESC_TOTAL_MAX_LATENCY.get(),
2376           totalMaximumLatencyMillis);
2377    }
2378
2379    if (totalMinimumLatencyMillis != null)
2380    {
2381      addMonitorAttribute(attrs,
2382           ATTR_TOTAL_MINIMUM_LATENCY_MILLIS,
2383           INFO_REPLICA_DISPNAME_TOTAL_MIN_LATENCY.get(),
2384           INFO_REPLICA_DESC_TOTAL_MIN_LATENCY.get(),
2385           totalMinimumLatencyMillis);
2386    }
2387
2388    if (totalNegativeLatencyUpdateCount != null)
2389    {
2390      addMonitorAttribute(attrs,
2391           ATTR_TOTAL_NEGATIVE_LATENCY_UPDATE_COUNT,
2392           INFO_REPLICA_DISPNAME_TOTAL_NEGATIVE_LATENCY.get(),
2393           INFO_REPLICA_DESC_TOTAL_NEGATIVE_LATENCY.get(),
2394           totalNegativeLatencyUpdateCount);
2395    }
2396
2397    if (totalSumLatencyMillis != null)
2398    {
2399      addMonitorAttribute(attrs,
2400           ATTR_TOTAL_SUM_LATENCY_MILLIS,
2401           INFO_REPLICA_DISPNAME_TOTAL_SUM_LATENCY.get(),
2402           INFO_REPLICA_DESC_TOTAL_SUM_LATENCY.get(),
2403           totalSumLatencyMillis);
2404    }
2405
2406    if (replicationAssuranceSubmittedOperations != null)
2407    {
2408      addMonitorAttribute(attrs,
2409           ATTR_REPLICATION_ASSURANCE_SUBMITTED_OPERATIONS,
2410           INFO_REPLICA_DISPNAME_REPL_ASSURANCE_SUBMITTED_OPS.get(),
2411           INFO_REPLICA_DESC_REPL_ASSURANCE_SUBMITTED_OPS.get(),
2412           replicationAssuranceSubmittedOperations);
2413    }
2414
2415    if (replicationAssuranceCompletedNormally != null)
2416    {
2417      addMonitorAttribute(attrs,
2418           ATTR_REPLICATION_ASSURANCE_COMPLETED_NORMALLY,
2419           INFO_REPLICA_DISPNAME_REPL_ASSURANCE_COMPLETED_NORMALLY.get(),
2420           INFO_REPLICA_DESC_REPL_ASSURANCE_COMPLETED_NORMALLY.get(),
2421           replicationAssuranceCompletedNormally);
2422    }
2423
2424    if (replicationAssuranceCompletedAbnormally != null)
2425    {
2426      addMonitorAttribute(attrs,
2427           ATTR_REPLICATION_ASSURANCE_COMPLETED_ABNORMALLY,
2428           INFO_REPLICA_DISPNAME_REPL_ASSURANCE_COMPLETED_ABNORMALLY.get(),
2429           INFO_REPLICA_DESC_REPL_ASSURANCE_COMPLETED_ABNORMALLY.get(),
2430           replicationAssuranceCompletedAbnormally);
2431    }
2432
2433    if (replicationAssuranceCompletedWithTimeout != null)
2434    {
2435      addMonitorAttribute(attrs,
2436           ATTR_REPLICATION_ASSURANCE_COMPLETED_WITH_TIMEOUT,
2437           INFO_REPLICA_DISPNAME_REPL_ASSURANCE_COMPLETED_WITH_TIMEOUT.get(),
2438           INFO_REPLICA_DESC_REPL_ASSURANCE_COMPLETED_WITH_TIMEOUT.get(),
2439           replicationAssuranceCompletedWithTimeout);
2440    }
2441
2442    if (replicationAssuranceCompletedWithShutdown != null)
2443    {
2444      addMonitorAttribute(attrs,
2445           ATTR_REPLICATION_ASSURANCE_COMPLETED_WITH_SHUTDOWN,
2446           INFO_REPLICA_DISPNAME_REPL_ASSURANCE_COMPLETED_WITH_SHUTDOWN.get(),
2447           INFO_REPLICA_DESC_REPL_ASSURANCE_COMPLETED_WITH_SHUTDOWN.get(),
2448           replicationAssuranceCompletedWithShutdown);
2449    }
2450
2451    if (requeueRetryOpSuccessCount != null)
2452    {
2453      addMonitorAttribute(attrs,
2454           ATTR_REQUEUE_RETRY_OP_SUCCESS_COUNT,
2455           INFO_REPLICA_DISPNAME_RETRY_OP_SUCCESS_COUNT.get(),
2456           INFO_REPLICA_DESC_RETRY_OP_SUCCESS_COUNT.get(),
2457           requeueRetryOpSuccessCount);
2458    }
2459
2460    if (requeueRetryOpFailedCount != null)
2461    {
2462      addMonitorAttribute(attrs,
2463           ATTR_REQUEUE_RETRY_OP_FAILED_COUNT,
2464           INFO_REPLICA_DISPNAME_RETRY_OP_FAILED_COUNT.get(),
2465           INFO_REPLICA_DESC_RETRY_OP_FAILED_COUNT.get(),
2466           requeueRetryOpFailedCount);
2467    }
2468
2469    if (requeueRetryAddSuccessCount != null)
2470    {
2471      addMonitorAttribute(attrs,
2472           ATTR_REQUEUE_RETRY_ADD_SUCCESS_COUNT,
2473           INFO_REPLICA_DISPNAME_RETRY_ADD_SUCCESS_COUNT.get(),
2474           INFO_REPLICA_DESC_RETRY_ADD_SUCCESS_COUNT.get(),
2475           requeueRetryAddSuccessCount);
2476    }
2477
2478    if (requeueRetryAddFailedCount != null)
2479    {
2480      addMonitorAttribute(attrs,
2481           ATTR_REQUEUE_RETRY_ADD_FAILED_COUNT,
2482           INFO_REPLICA_DISPNAME_RETRY_ADD_FAILED_COUNT.get(),
2483           INFO_REPLICA_DESC_RETRY_ADD_FAILED_COUNT.get(),
2484           requeueRetryAddFailedCount);
2485    }
2486
2487    if (requeueRetryDeleteSuccessCount != null)
2488    {
2489      addMonitorAttribute(attrs,
2490           ATTR_REQUEUE_RETRY_DELETE_SUCCESS_COUNT,
2491           INFO_REPLICA_DISPNAME_RETRY_DELETE_SUCCESS_COUNT.get(),
2492           INFO_REPLICA_DESC_RETRY_DELETE_SUCCESS_COUNT.get(),
2493           requeueRetryDeleteSuccessCount);
2494    }
2495
2496    if (requeueRetryDeleteFailedCount != null)
2497    {
2498      addMonitorAttribute(attrs,
2499           ATTR_REQUEUE_RETRY_DELETE_FAILED_COUNT,
2500           INFO_REPLICA_DISPNAME_RETRY_DELETE_FAILED_COUNT.get(),
2501           INFO_REPLICA_DESC_RETRY_DELETE_FAILED_COUNT.get(),
2502           requeueRetryDeleteFailedCount);
2503    }
2504
2505    if (requeueRetryModifySuccessCount != null)
2506    {
2507      addMonitorAttribute(attrs,
2508           ATTR_REQUEUE_RETRY_MODIFY_SUCCESS_COUNT,
2509           INFO_REPLICA_DISPNAME_RETRY_MODIFY_SUCCESS_COUNT.get(),
2510           INFO_REPLICA_DESC_RETRY_MODIFY_SUCCESS_COUNT.get(),
2511           requeueRetryModifySuccessCount);
2512    }
2513
2514    if (requeueRetryModifyFailedCount != null)
2515    {
2516      addMonitorAttribute(attrs,
2517           ATTR_REQUEUE_RETRY_MODIFY_FAILED_COUNT,
2518           INFO_REPLICA_DISPNAME_RETRY_MODIFY_FAILED_COUNT.get(),
2519           INFO_REPLICA_DESC_RETRY_MODIFY_FAILED_COUNT.get(),
2520           requeueRetryModifyFailedCount);
2521    }
2522
2523    if (requeueRetryModifyDNSuccessCount != null)
2524    {
2525      addMonitorAttribute(attrs,
2526           ATTR_REQUEUE_RETRY_MODIFY_DN_SUCCESS_COUNT,
2527           INFO_REPLICA_DISPNAME_RETRY_MODIFY_DN_SUCCESS_COUNT.get(),
2528           INFO_REPLICA_DESC_RETRY_MODIFY_DN_SUCCESS_COUNT.get(),
2529           requeueRetryModifyDNSuccessCount);
2530    }
2531
2532    if (requeueRetryModifyDNFailedCount != null)
2533    {
2534      addMonitorAttribute(attrs,
2535           ATTR_REQUEUE_RETRY_MODIFY_DN_FAILED_COUNT,
2536           INFO_REPLICA_DISPNAME_RETRY_MODIFY_DN_FAILED_COUNT.get(),
2537           INFO_REPLICA_DESC_RETRY_MODIFY_DN_FAILED_COUNT.get(),
2538           requeueRetryModifyDNFailedCount);
2539    }
2540
2541    if (requeueRetrySuccessAverageDurationMillis != null)
2542    {
2543      addMonitorAttribute(attrs,
2544           ATTR_REQUEUE_RETRY_OP_SUCCESS_AVERAGE_DURATION_MILLIS,
2545           INFO_REPLICA_DISPNAME_RETRY_AVERAGE_DURATION.get(),
2546           INFO_REPLICA_DESC_RETRY_AVERAGE_DURATION.get(),
2547           requeueRetrySuccessAverageDurationMillis);
2548    }
2549
2550    if (requeueRetrySuccessMaximumDurationMillis != null)
2551    {
2552      addMonitorAttribute(attrs,
2553           ATTR_REQUEUE_RETRY_OP_SUCCESS_MAXIMUM_DURATION_MILLIS,
2554           INFO_REPLICA_DISPNAME_RETRY_MAX_DURATION.get(),
2555           INFO_REPLICA_DESC_RETRY_MAX_DURATION.get(),
2556           requeueRetrySuccessMaximumDurationMillis);
2557    }
2558
2559    if (requeueRetrySuccessTotalDurationMillis != null)
2560    {
2561      addMonitorAttribute(attrs,
2562           ATTR_REQUEUE_RETRY_OP_SUCCESS_TOTAL_DURATION_MILLIS,
2563           INFO_REPLICA_DISPNAME_RETRY_TOTAL_DURATION.get(),
2564           INFO_REPLICA_DESC_RETRY_TOTAL_DURATION.get(),
2565           requeueRetrySuccessTotalDurationMillis);
2566    }
2567
2568    return Collections.unmodifiableMap(attrs);
2569  }
2570}