From c3420bec486f1921ea67fab4b1019ef06a0cea16 Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Mon, 23 Mar 2009 09:04:22 +0000
Subject: [PATCH] Fix for 3889 : Replication domain don't have access to the Replica ServerStates
---
opends/src/server/org/opends/server/replication/server/MonitorData.java | 50 ++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/server/MonitorData.java b/opends/src/server/org/opends/server/replication/server/MonitorData.java
index 25b9992..81a1473 100644
--- a/opends/src/server/org/opends/server/replication/server/MonitorData.java
+++ b/opends/src/server/org/opends/server/replication/server/MonitorData.java
@@ -22,7 +22,7 @@
* CDDL HEADER END
*
*
- * Copyright 2008 Sun Microsystems, Inc.
+ * Copyright 2009 Sun Microsystems, Inc.
*/
package org.opends.server.replication.server;
@@ -193,7 +193,7 @@
}
// Computes the missing changes counters for RS :
- // Sum the difference of seqnuence numbers for each element in the States.
+ // Sum the difference of sequence numbers for each element in the States.
for (short lsiSid : RSStates.keySet())
{
@@ -390,4 +390,50 @@
}
}
+ /**
+ * Returns an iterator on the serverId of the Replicas for which
+ * we have monitoring data.
+ *
+ * @return The iterator.
+ */
+ public Iterator<Short> ldapIterator()
+ {
+ return LDAPStates.keySet().iterator();
+ }
+
+ /**
+ * Returns an iterator on the serverId of the Replication Servers for which
+ * we have monitoring data.
+ *
+ * @return The iterator.
+ */
+ public Iterator<Short> rsIterator()
+ {
+ return RSStates.keySet().iterator();
+ }
+
+ /**
+ * Get the state of the RS server with the provided serverId.
+ *
+ * @param serverId The server ID.
+ * @return The server state.
+ */
+ public ServerState getRSStates(short serverId)
+ {
+ return RSStates.get(serverId);
+ }
+
+ /**
+ * Get an approximation of the date of the first missing update.
+ *
+ * @param serverId The server ID.
+ * @return The date.
+ */
+ public long getRSApproxFirstMissingDate(short serverId)
+ {
+ Long res;
+ if ((res = fmRSDate.get(serverId)) != null)
+ return res;
+ return 0;
+ }
}
--
Gitblit v1.10.0