mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
24.00.2007 ea55147a2ea1994c28702db6f0225ffd1f790cbb
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;
  }
}