From 3ef361dfc380b2e3cb1bb522d750a4b9a48a4f4a Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 08 Jan 2014 10:17:03 +0000
Subject: [PATCH] Replaced/removed numerous fields and methods of ReplicationDomain by directly storing the config. Changed a lot of subclasses due to this change.

---
 opends/src/server/org/opends/server/replication/common/DSInfo.java |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/common/DSInfo.java b/opends/src/server/org/opends/server/replication/common/DSInfo.java
index fcc036d..a07ae6b 100644
--- a/opends/src/server/org/opends/server/replication/common/DSInfo.java
+++ b/opends/src/server/org/opends/server/replication/common/DSInfo.java
@@ -26,8 +26,7 @@
  */
 package org.opends.server.replication.common;
 
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 /**
  * This class holds information about a DS connected to the topology. This
@@ -35,8 +34,7 @@
  * messages, to keep every member (RS or DS) of the topology aware of the DS
  * topology.
  * <p>
- * This class is almost immutable, because it does not copy the List and Set
- * passed into the ctor.
+ * @Immutable
  */
 public final class DSInfo
 {
@@ -68,7 +66,6 @@
   private final Set<String> eclIncludesForDeletes;
 
 
-
   /**
    * Creates a new instance of DSInfo with every given info.
    *
@@ -101,8 +98,8 @@
   public DSInfo(int dsId, String dsUrl, int rsId, long generationId,
       ServerStatus status, boolean assuredFlag,
       AssuredMode assuredMode, byte safeDataLevel, byte groupId,
-      List<String> refUrls, Set<String> eclIncludes,
-      Set<String> eclIncludesForDeletes, short protocolVersion)
+      Collection<String> refUrls, Collection<String> eclIncludes,
+      Collection<String> eclIncludesForDeletes, short protocolVersion)
   {
     this.dsId = dsId;
     this.dsUrl = dsUrl;
@@ -113,9 +110,11 @@
     this.assuredMode = assuredMode;
     this.safeDataLevel = safeDataLevel;
     this.groupId = groupId;
-    this.refUrls = refUrls;
-    this.eclIncludes = eclIncludes;
-    this.eclIncludesForDeletes = eclIncludesForDeletes;
+    this.refUrls = Collections.unmodifiableList(new ArrayList<String>(refUrls));
+    this.eclIncludes =
+        Collections.unmodifiableSet(new HashSet<String>(eclIncludes));
+    this.eclIncludesForDeletes =
+        Collections.unmodifiableSet(new HashSet<String>(eclIncludesForDeletes));
     this.protocolVersion = protocolVersion;
   }
 

--
Gitblit v1.10.0