From ea55147a2ea1994c28702db6f0225ffd1f790cbb Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Thu, 24 May 2007 16:00:57 +0000
Subject: [PATCH] Add some classes to the ads package so that the code is complete for it being us ed by the QuickSetup to both read data from registered servers and to configure ADS.
---
opends/src/ads/org/opends/admin/ads/ReplicaDescriptor.java | 63 +++++++++++++++++++++++++++++++
1 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/opends/src/ads/org/opends/admin/ads/ReplicaDescriptor.java b/opends/src/ads/org/opends/admin/ads/ReplicaDescriptor.java
index b7422cd..598de7f 100644
--- a/opends/src/ads/org/opends/admin/ads/ReplicaDescriptor.java
+++ b/opends/src/ads/org/opends/admin/ads/ReplicaDescriptor.java
@@ -27,6 +27,9 @@
package org.opends.admin.ads;
+import java.util.HashSet;
+import java.util.Set;
+
/**
* The object of this class represent a Replica (i.e. a suffix in a given
* server).
@@ -36,6 +39,8 @@
private SuffixDescriptor suffix;
private int entries = -1;
private ServerDescriptor server;
+ private Set<String> replicationServers = new HashSet<String>();
+ private int replicationId = -1;
/**
* Returns the number of entries contained in the replica.
@@ -47,6 +52,16 @@
}
/**
+ * Returns whether this replica is replicated or not.
+ * @return <CODE>true</CODE> if the replica is replicated and
+ * <CODE>false</CODE> otherwise.
+ */
+ public boolean isReplicated()
+ {
+ return replicationId != -1;
+ }
+
+ /**
* Sets the number of entries contained in the replica.
* @param entries the number of entries contained in the replica.
*/
@@ -97,4 +112,52 @@
{
this.suffix = suffix;
}
+
+ /**
+ * Returns a set containing the String representation of the replication
+ * servers that are defined in the replication domain for this replica.
+ * @return a set containing the String representation of the replication
+ * servers that are defined in the replication domain for this replica.
+ */
+ public Set<String> getReplicationServers()
+ {
+ HashSet<String> copy = new HashSet<String>();
+ copy.addAll(replicationServers);
+ return copy;
+ }
+
+ /**
+ * Sets the list of replication servers (in their String representation) that
+ * are defined in the replication domain for this replica.
+ * @param replicationServers the list of replication servers (in their String
+ * representation) that are defined in the replication domain for this
+ * replica.
+ */
+ public void setReplicationServers(Set<String> replicationServers)
+ {
+ this.replicationServers.clear();
+ this.replicationServers.addAll(replicationServers);
+ }
+
+ /**
+ * Returns the replication server id for the replication domain associated
+ * with this replica.
+ * @return the replication server id for the replication domain associated
+ * with this replica.
+ */
+ public int getReplicationId()
+ {
+ return replicationId;
+ }
+
+ /**
+ * Sets the replication server id for the replication domain associated
+ * with this replica.
+ * @param replicationId the replication server id for the replication domain
+ * associated with this replica.
+ */
+ public void setReplicationId(int replicationId)
+ {
+ this.replicationId = replicationId;
+ }
}
--
Gitblit v1.10.0