opends/src/server/org/opends/server/replication/common/FirstChangeNumberVirtualAttributeProvider.java
@@ -27,14 +27,13 @@ */ package org.opends.server.replication.common; import static org.opends.server.loggers.debug.DebugLogger.getTracer; import static org.opends.messages.ExtensionMessages.*; import static org.opends.server.loggers.debug.DebugLogger.*; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; import static org.opends.messages.ExtensionMessages.*; import org.opends.messages.Message; import org.opends.server.admin.server.ConfigurationChangeListener; import org.opends.server.admin.std.server.UserDefinedVirtualAttributeCfg; @@ -45,15 +44,7 @@ import org.opends.server.loggers.debug.DebugTracer; import org.opends.server.replication.plugin.MultimasterReplication; import org.opends.server.replication.server.ReplicationServer; import org.opends.server.types.AttributeValue; import org.opends.server.types.AttributeValues; import org.opends.server.types.ByteString; import org.opends.server.types.ConfigChangeResult; import org.opends.server.types.DebugLogLevel; import org.opends.server.types.Entry; import org.opends.server.types.InitializationException; import org.opends.server.types.ResultCode; import org.opends.server.types.VirtualAttributeRule; import org.opends.server.types.*; import org.opends.server.util.ServerConstants; import org.opends.server.workflowelement.externalchangelog.ECLWorkflowElement; @@ -145,10 +136,8 @@ if (eclwe!=null) { // Set a list of excluded domains (also exclude 'cn=changelog' itself) ArrayList<String> excludedDomains = Set<String> excludedDomains = MultimasterReplication.getECLDisabledDomains(); if (!excludedDomains.contains( ServerConstants.DN_EXTERNAL_CHANGELOG_ROOT)) excludedDomains.add(ServerConstants.DN_EXTERNAL_CHANGELOG_ROOT); ReplicationServer rs = eclwe.getReplicationServer(); @@ -157,7 +146,6 @@ rs.getEligibleCN(), excludedDomains); first = String.valueOf(limits[0]); } } catch(Exception e) @@ -210,6 +198,7 @@ /** * {@inheritDoc} */ @Override public boolean isConfigurationChangeAcceptable( UserDefinedVirtualAttributeCfg configuration, List<Message> unacceptableReasons) @@ -222,6 +211,7 @@ /** * {@inheritDoc} */ @Override public ConfigChangeResult applyConfigurationChange( UserDefinedVirtualAttributeCfg configuration) { opends/src/server/org/opends/server/replication/common/LastChangeNumberVirtualAttributeProvider.java
@@ -27,14 +27,13 @@ */ package org.opends.server.replication.common; import static org.opends.server.loggers.debug.DebugLogger.getTracer; import static org.opends.messages.ExtensionMessages.*; import static org.opends.server.loggers.debug.DebugLogger.*; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; import static org.opends.messages.ExtensionMessages.*; import org.opends.messages.Message; import org.opends.server.admin.server.ConfigurationChangeListener; import org.opends.server.admin.std.server.UserDefinedVirtualAttributeCfg; @@ -45,15 +44,7 @@ import org.opends.server.loggers.debug.DebugTracer; import org.opends.server.replication.plugin.MultimasterReplication; import org.opends.server.replication.server.ReplicationServer; import org.opends.server.types.AttributeValue; import org.opends.server.types.AttributeValues; import org.opends.server.types.ByteString; import org.opends.server.types.ConfigChangeResult; import org.opends.server.types.DebugLogLevel; import org.opends.server.types.Entry; import org.opends.server.types.InitializationException; import org.opends.server.types.ResultCode; import org.opends.server.types.VirtualAttributeRule; import org.opends.server.types.*; import org.opends.server.util.ServerConstants; import org.opends.server.workflowelement.externalchangelog.ECLWorkflowElement; @@ -145,10 +136,8 @@ if (eclwe!=null) { // Set a list of excluded domains (also exclude 'cn=changelog' itself) ArrayList<String> excludedDomains = Set<String> excludedDomains = MultimasterReplication.getECLDisabledDomains(); if (!excludedDomains.contains( ServerConstants.DN_EXTERNAL_CHANGELOG_ROOT)) excludedDomains.add(ServerConstants.DN_EXTERNAL_CHANGELOG_ROOT); ReplicationServer rs = eclwe.getReplicationServer(); @@ -209,6 +198,7 @@ /** * {@inheritDoc} */ @Override public boolean isConfigurationChangeAcceptable( UserDefinedVirtualAttributeCfg configuration, List<Message> unacceptableReasons) @@ -221,6 +211,7 @@ /** * {@inheritDoc} */ @Override public ConfigChangeResult applyConfigurationChange( UserDefinedVirtualAttributeCfg configuration) { opends/src/server/org/opends/server/replication/common/LastCookieVirtualProvider.java
@@ -23,18 +23,17 @@ * * * Copyright 2009 Sun Microsystems, Inc. * Portions Copyright 2011-2012 ForgeRock AS * Portions Copyright 2011-2013 ForgeRock AS */ package org.opends.server.replication.common; import java.util.ArrayList; import static org.opends.messages.ExtensionMessages.*; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import static org.opends.messages.ExtensionMessages.*; import org.opends.messages.Message; import org.opends.server.admin.server.ConfigurationChangeListener; import org.opends.server.admin.std.server.UserDefinedVirtualAttributeCfg; @@ -44,14 +43,7 @@ import org.opends.server.core.SearchOperation; import org.opends.server.replication.plugin.MultimasterReplication; import org.opends.server.replication.server.ReplicationServer; import org.opends.server.types.AttributeValue; import org.opends.server.types.AttributeValues; import org.opends.server.types.ByteString; import org.opends.server.types.ConfigChangeResult; import org.opends.server.types.Entry; import org.opends.server.types.InitializationException; import org.opends.server.types.ResultCode; import org.opends.server.types.VirtualAttributeRule; import org.opends.server.types.*; import org.opends.server.util.ServerConstants; import org.opends.server.workflowelement.externalchangelog.ECLWorkflowElement; @@ -136,10 +128,8 @@ if (eclwe!=null) { // Set a list of excluded domains (also exclude 'cn=changelog' itself) ArrayList<String> excludedDomains = Set<String> excludedDomains = MultimasterReplication.getECLDisabledDomains(); if (!excludedDomains.contains( ServerConstants.DN_EXTERNAL_CHANGELOG_ROOT)) excludedDomains.add(ServerConstants.DN_EXTERNAL_CHANGELOG_ROOT); ReplicationServer rs = eclwe.getReplicationServer(); @@ -193,6 +183,7 @@ /** * {@inheritDoc} */ @Override public boolean isConfigurationChangeAcceptable( UserDefinedVirtualAttributeCfg configuration, List<Message> unacceptableReasons) @@ -205,6 +196,7 @@ /** * {@inheritDoc} */ @Override public ConfigChangeResult applyConfigurationChange( UserDefinedVirtualAttributeCfg configuration) { opends/src/server/org/opends/server/replication/plugin/MultimasterReplication.java
@@ -33,9 +33,7 @@ ReplicationRepairRequestControl.*; import static org.opends.server.util.StaticUtils.*; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.*; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.LinkedBlockingQueue; @@ -848,9 +846,9 @@ * Gets the baseDn of the domains that have a private backend. * @return The private baseDN. */ public static ArrayList<String> getECLDisabledDomains() public static Set<String> getECLDisabledDomains() { ArrayList<String> disabledServiceIDs = new ArrayList<String>(); Set<String> disabledServiceIDs = new HashSet<String>(); for (LDAPReplicationDomain domain : domains.values()) { opends/src/server/org/opends/server/replication/protocol/StartECLSessionMsg.java
@@ -29,11 +29,13 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.zip.DataFormatException; import org.opends.server.replication.common.ChangeNumber; import org.opends.server.util.StaticUtils; /** @@ -59,7 +61,7 @@ public final static short REQUEST_TYPE_FROM_DRAFT_CHANGE_NUMBER = 1; /** * This specifies that the ECL is requested ony for the entry that have * This specifies that the ECL is requested only for the entry that have * a repl change number matching the provided one. * TODO: not yet implemented */ @@ -82,31 +84,38 @@ */ public final static short PERSISTENT_CHANGES_ONLY = 2; // The type of request as defined by REQUEST_TYPE_... /** The type of request as defined by REQUEST_TYPE_... */ private short eclRequestType; // When eclRequestType = FROM_COOKIE, // specifies the provided cookie value. /** * When eclRequestType = FROM_COOKIE, specifies the provided cookie value. */ private String crossDomainServerState = ""; // When eclRequestType = FROM_CHANGE_NUMBER, // specifies the provided change number first and last - [CHANGELOG] /** * When eclRequestType = FROM_CHANGE_NUMBER, specifies the provided change * number first and last - [CHANGELOG]. */ private int firstDraftChangeNumber = -1; private int lastDraftChangeNumber = -1; // When eclRequestType = EQUALS_REPL_CHANGE_NUMBER, // specifies the provided replication change number. /** * When eclRequestType = EQUALS_REPL_CHANGE_NUMBER, specifies the provided * replication change number. */ private ChangeNumber changeNumber; // Specifies whether the search is persistent and changesOnly /** Specifies whether the search is persistent and changesOnly. */ private short isPersistent = NON_PERSISTENT; // A string helping debuging and tracing the client operation related when // processing, on the RS side, a request on the ECL. /** * A string helping debugging and tracing the client operation related when * processing, on the RS side, a request on the ECL. */ private String operationId = ""; // Excluded domains private ArrayList<String> excludedServiceIDs = new ArrayList<String>(); /** Excluded domains. */ private Set<String> excludedServiceIDs = new HashSet<String>(); /** * Creates a new StartSessionMsg message from its encoded form. @@ -205,7 +214,7 @@ changeNumber = new ChangeNumber(0,0,0); isPersistent = NON_PERSISTENT; operationId = "-1"; excludedServiceIDs = new ArrayList<String>(); excludedServiceIDs = new HashSet<String>(); } /** @@ -214,11 +223,8 @@ @Override public byte[] getBytes(short protocolVersion) { String excludedSIDsString = ""; for (String excludedServiceID : excludedServiceIDs) { excludedSIDsString = excludedSIDsString.concat(excludedServiceID+";"); } String excludedSIDsString = StaticUtils.collectionToString(excludedServiceIDs, ";"); try { @@ -277,7 +283,7 @@ @Override public String toString() { return (this.getClass().getCanonicalName() + " [" + return getClass().getCanonicalName() + " [" + " requestType="+ eclRequestType + " persistentSearch=" + isPersistent + " changeNumber=" + changeNumber + @@ -285,7 +291,7 @@ " lastDraftChangeNumber=" + lastDraftChangeNumber + " generalizedState=" + crossDomainServerState + " operationId=" + operationId + " excludedDNs=" + excludedServiceIDs + "]"); " excludedDNs=" + excludedServiceIDs + "]"; } /** @@ -417,7 +423,7 @@ * Getter on the list of excluded ServiceIDs. * @return the list of excluded ServiceIDs. */ public ArrayList<String> getExcludedServiceIDs() public Set<String> getExcludedServiceIDs() { return this.excludedServiceIDs; } @@ -426,7 +432,7 @@ * Setter on the list of excluded ServiceIDs. * @param excludedServiceIDs the provided list of excluded ServiceIDs. */ public void setExcludedDNs(ArrayList<String> excludedServiceIDs) public void setExcludedDNs(Set<String> excludedServiceIDs) { this.excludedServiceIDs = excludedServiceIDs; } opends/src/server/org/opends/server/replication/server/ECLServerHandler.java
@@ -28,17 +28,12 @@ package org.opends.server.replication.server; import static org.opends.messages.ReplicationMessages.*; import static org.opends.server.loggers.ErrorLogger.logError; import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; import static org.opends.server.loggers.ErrorLogger.*; import static org.opends.server.loggers.debug.DebugLogger.*; import static org.opends.server.replication.protocol.ProtocolVersion.*; import java.io.IOException; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.*; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.zip.DataFormatException; @@ -51,11 +46,7 @@ import org.opends.server.replication.common.ServerState; import org.opends.server.replication.common.ServerStatus; import org.opends.server.replication.protocol.*; import org.opends.server.types.Attribute; import org.opends.server.types.Attributes; import org.opends.server.types.DebugLogLevel; import org.opends.server.types.DirectoryException; import org.opends.server.types.ResultCode; import org.opends.server.types.*; import org.opends.server.util.ServerConstants; /** @@ -65,14 +56,16 @@ public final class ECLServerHandler extends ServerHandler { // This is a string identifying the operation, provided by the client part // of the ECL, used to help interpretation of messages logged. String operationId; /** * This is a string identifying the operation, provided by the client part of * the ECL, used to help interpretation of messages logged. */ private String operationId; // Iterator on the draftCN database. /** Iterator on the draftCN database. */ private DraftCNDbIterator draftCNDbIter = null; boolean draftCompat = false; private boolean draftCompat = false; /** * Specifies the last draft changer number (seqnum) requested. */ @@ -107,8 +100,7 @@ /** * Specifies the excluded DNs (like cn=admin, ...). */ public ArrayList<String> excludedServiceIDs = new ArrayList<String>(); //HashSet<String> excludedServiceIDs = new HashSet<String>(); public Set<String> excludedServiceIDs = new HashSet<String>(); /** * Eligible changeNumber - only changes older or equal to eligibleCN @@ -1203,7 +1195,7 @@ { try { acquired = sendWindow.tryAcquire((long) 500, TimeUnit.MILLISECONDS); acquired = sendWindow.tryAcquire(500, TimeUnit.MILLISECONDS); interrupted = false; } catch (InterruptedException e) { opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -1643,7 +1643,7 @@ * @param excludedServiceIDs the provided list of serviceIDs excluded from * the computation of eligibleCN. */ public void disableEligibility(List<String> excludedServiceIDs) public void disableEligibility(Set<String> excludedServiceIDs) { this.excludedServiceIDs = excludedServiceIDs; } @@ -1788,10 +1788,8 @@ * @return The first and last draftCN. * @throws DirectoryException When it happens. */ public int[] getECLDraftCNLimits( ChangeNumber crossDomainEligibleCN, ArrayList<String> excludedServiceIDs) throws DirectoryException public int[] getECLDraftCNLimits(ChangeNumber crossDomainEligibleCN, Set<String> excludedServiceIDs) throws DirectoryException { /* The content of the DraftCNdb depends on the SEARCH operations done before * requesting the DraftCN. If no operations, DraftCNdb is empty. @@ -1914,8 +1912,7 @@ * @param excludedServiceIDs The list of serviceIDs excluded from ECL. * @return the last cookie value. */ public MultiDomainServerState getLastECLCookie( List<String> excludedServiceIDs) public MultiDomainServerState getLastECLCookie(Set<String> excludedServiceIDs) { disableEligibility(excludedServiceIDs); opends/src/server/org/opends/server/workflowelement/externalchangelog/ECLSearchOperation.java
@@ -23,7 +23,7 @@ * * * Copyright 2008-2010 Sun Microsystems, Inc. * Portions Copyright 2010-2012 ForgeRock AS * Portions Copyright 2010-2013 ForgeRock AS */ package org.opends.server.workflowelement.externalchangelog; @@ -31,12 +31,11 @@ import static org.opends.messages.CoreMessages.*; import static org.opends.server.config.ConfigConstants.*; import static org.opends.server.loggers.ErrorLogger.logError; import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; import static org.opends.server.loggers.debug.DebugLogger.getTracer; import static org.opends.server.util.LDIFWriter.appendLDIFSeparatorAndValue; import static org.opends.server.loggers.ErrorLogger.*; import static org.opends.server.loggers.debug.DebugLogger.*; import static org.opends.server.util.LDIFWriter.*; import static org.opends.server.util.ServerConstants.*; import static org.opends.server.util.StaticUtils.getExceptionMessage; import static org.opends.server.util.StaticUtils.*; import java.text.SimpleDateFormat; import java.util.*; @@ -238,9 +237,8 @@ startECLSessionMsg.setOperationId(this.toString()); // Set a list of excluded domains (also exclude 'cn=changelog' itself) ArrayList<String> excludedDomains = Set<String> excludedDomains = MultimasterReplication.getECLDisabledDomains(); if (!excludedDomains.contains(ServerConstants.DN_EXTERNAL_CHANGELOG_ROOT)) excludedDomains.add(ServerConstants.DN_EXTERNAL_CHANGELOG_ROOT); startECLSessionMsg.setExcludedDNs(excludedDomains); opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ExternalChangeLogTest.java
@@ -23,7 +23,7 @@ * * * Copyright 2006-2010 Sun Microsystems, Inc. * Portions copyright 2011 ForgeRock AS * Portions copyright 2011-2013 ForgeRock AS */ package org.opends.server.replication; @@ -134,7 +134,6 @@ /** * Tests for the replicationServer code. */ public class ExternalChangeLogTest extends ReplicationTestCase { // The tracer object for the debug logger @@ -3990,10 +3989,8 @@ } sleep(1000); debugInfo(tn, "Perfs test in compat - search lastChangeNumber"); ArrayList<String> excludedDomains = Set<String> excludedDomains = MultimasterReplication.getECLDisabledDomains(); if (!excludedDomains.contains( ServerConstants.DN_EXTERNAL_CHANGELOG_ROOT)) excludedDomains.add(ServerConstants.DN_EXTERNAL_CHANGELOG_ROOT); ECLWorkflowElement eclwe = (ECLWorkflowElement) opends/tests/unit-tests-testng/src/server/org/opends/server/replication/protocol/SynchronizationMsgTest.java
@@ -27,52 +27,21 @@ */ package org.opends.server.replication.protocol; import static org.opends.server.TestCaseUtils.TEST_ROOT_DN_STRING; import static org.opends.server.replication.protocol.OperationContext.SYNCHROCONTEXT; import static org.opends.server.replication.protocol.ProtocolVersion.getCurrentVersion; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; import static org.opends.server.TestCaseUtils.*; import static org.opends.server.replication.protocol.OperationContext.*; import static org.opends.server.replication.protocol.ProtocolVersion.*; import static org.testng.Assert.*; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.UUID; import java.util.*; import java.util.zip.DataFormatException; import org.opends.messages.Message; import org.opends.server.core.AddOperation; import org.opends.server.core.AddOperationBasis; import org.opends.server.core.DeleteOperationBasis; import org.opends.server.core.DirectoryServer; import org.opends.server.core.ModifyDNOperationBasis; import org.opends.server.core.ModifyOperation; import org.opends.server.core.ModifyOperationBasis; import org.opends.server.controls.SubtreeDeleteControl; import org.opends.server.core.*; import org.opends.server.protocols.internal.InternalClientConnection; import org.opends.server.replication.ReplicationTestCase; import org.opends.server.replication.common.AssuredMode; import org.opends.server.replication.common.ChangeNumber; import org.opends.server.replication.common.DSInfo; import org.opends.server.replication.common.MultiDomainServerState; import org.opends.server.replication.common.RSInfo; import org.opends.server.replication.common.ServerState; import org.opends.server.replication.common.ServerStatus; import org.opends.server.types.Attribute; import org.opends.server.types.AttributeBuilder; import org.opends.server.types.AttributeType; import org.opends.server.types.Attributes; import org.opends.server.types.DN; import org.opends.server.types.Modification; import org.opends.server.types.ModificationType; import org.opends.server.types.ObjectClass; import org.opends.server.types.Operation; import org.opends.server.types.RDN; import org.opends.server.types.RawAttribute; import org.opends.server.replication.common.*; import org.opends.server.types.*; import org.opends.server.util.TimeThread; import org.opends.server.workflowelement.localbackend.LocalBackendAddOperation; import org.opends.server.workflowelement.localbackend.LocalBackendDeleteOperation; @@ -81,7 +50,6 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import org.opends.server.controls.SubtreeDeleteControl; /** * Test the constructors, encoders and decoders of the replication protocol * PDUs classes (message classes) @@ -643,7 +611,7 @@ DN dn = DN.decode(rawDN); AddOperation addOpB = new AddOperationBasis(connection, (long) 1, 1, null, dn, objectClassList, userAttList, opList); 1, 1, null, dn, objectClassList, userAttList, opList); LocalBackendAddOperation addOp = new LocalBackendAddOperation(addOpB); OperationContext opCtx = new AddContext(cn, "thisIsaUniqueID", "parentUniqueId"); @@ -813,15 +781,15 @@ { String baseDN = TEST_ROOT_DN_STRING; ServerState state = new ServerState(); state.update(new ChangeNumber((long)0, 0,0)); state.update(new ChangeNumber(0, 0,0)); Object[] set1 = new Object[] {1, baseDN, 0, state, 0L, false, (byte)0}; state = new ServerState(); state.update(new ChangeNumber((long)75, 5,263)); state.update(new ChangeNumber(75, 5,263)); Object[] set2 = new Object[] {16, baseDN, 100, state, 1248L, true, (byte)31}; state = new ServerState(); state.update(new ChangeNumber((long)75, 98573895,45263)); state.update(new ChangeNumber(75, 98573895,45263)); Object[] set3 = new Object[] {16, baseDN, 100, state, 1248L, true, (byte)31}; return new Object [][] { set1, set2, set3 }; @@ -857,15 +825,15 @@ { String baseDN = TEST_ROOT_DN_STRING; ServerState state = new ServerState(); state.update(new ChangeNumber((long)0, 0,0)); state.update(new ChangeNumber(0, 0,0)); Object[] set1 = new Object[] {1, baseDN, 0, "localhost:8989", state, 0L, (byte)0, 0}; state = new ServerState(); state.update(new ChangeNumber((long)75, 5,263)); state.update(new ChangeNumber(75, 5,263)); Object[] set2 = new Object[] {16, baseDN, 100, "anotherHost:1025", state, 1245L, (byte)25, 3456}; state = new ServerState(); state.update(new ChangeNumber((long)75, 5, 45263)); state.update(new ChangeNumber(75, 5, 45263)); Object[] set3 = new Object[] {16, baseDN, 100, "anotherHost:1025", state, 1245L, (byte)25, 3456}; return new Object [][] { set1, set2, set3 }; @@ -902,15 +870,15 @@ { String baseDN = TEST_ROOT_DN_STRING; ServerState state = new ServerState(); state.update(new ChangeNumber((long)0, 0, 0)); state.update(new ChangeNumber(0, 0, 0)); Object[] set1 = new Object[] {1, baseDN, 0, "localhost:8989", state, 0L, (byte)0, 0, 0, 0}; state = new ServerState(); state.update(new ChangeNumber((long)75, 5, 263)); state.update(new ChangeNumber(75, 5, 263)); Object[] set2 = new Object[] {16, baseDN, 100, "anotherHost:1025", state, 1245L, (byte)25, 3456, 3, 31512}; state = new ServerState(); state.update(new ChangeNumber((long)123, 5, 98)); state.update(new ChangeNumber(123, 5, 98)); Object[] set3 = new Object[] {36, baseDN, 100, "anotherHostAgain:8017", state, 6841L, (byte)32, 2496, 630, 9524}; return new Object [][] { set1, set2, set3 }; @@ -1006,18 +974,18 @@ a3.add("uid"); Set<String> a4 = new HashSet<String>(); DSInfo dsInfo1 = new DSInfo(13, "dsHost1:111", 26, (long)154631, ServerStatus.FULL_UPDATE_STATUS, DSInfo dsInfo1 = new DSInfo(13, "dsHost1:111", 26, 154631, ServerStatus.FULL_UPDATE_STATUS, false, AssuredMode.SAFE_DATA_MODE, (byte)12, (byte)132, urls1, a1, a1, (short)1); DSInfo dsInfo2 = new DSInfo(-436, "dsHost2:222", 493, (long)-227896, ServerStatus.DEGRADED_STATUS, DSInfo dsInfo2 = new DSInfo(-436, "dsHost2:222", 493, -227896, ServerStatus.DEGRADED_STATUS, true, AssuredMode.SAFE_READ_MODE, (byte)-7, (byte)-265, urls2, a2, a2, (short)2); DSInfo dsInfo3 = new DSInfo(2436, "dsHost3:333", 591, (long)0, ServerStatus.NORMAL_STATUS, DSInfo dsInfo3 = new DSInfo(2436, "dsHost3:333", 591, 0, ServerStatus.NORMAL_STATUS, false, AssuredMode.SAFE_READ_MODE, (byte)17, (byte)0, urls3, a3, a3, (short)3); DSInfo dsInfo4 = new DSInfo(415, "dsHost4:444", 146, (long)0, ServerStatus.BAD_GEN_ID_STATUS, DSInfo dsInfo4 = new DSInfo(415, "dsHost4:444", 146, 0, ServerStatus.BAD_GEN_ID_STATUS, true, AssuredMode.SAFE_DATA_MODE, (byte)2, (byte)15, urls4, a4, a4, (short)4); DSInfo dsInfo5 = new DSInfo(452436, "dsHost5:555", 45591, (long)0, ServerStatus.NORMAL_STATUS, DSInfo dsInfo5 = new DSInfo(452436, "dsHost5:555", 45591, 0, ServerStatus.NORMAL_STATUS, false, AssuredMode.SAFE_READ_MODE, (byte)17, (byte)0, urls3, a1, a1, (short)5); List<DSInfo> dsList1 = new ArrayList<DSInfo>(); @@ -1035,13 +1003,13 @@ dsList4.add(dsInfo2); dsList4.add(dsInfo1); RSInfo rsInfo1 = new RSInfo(4527, "rsHost1:123", (long)45316, (byte)103, 1); RSInfo rsInfo1 = new RSInfo(4527, "rsHost1:123", 45316, (byte)103, 1); RSInfo rsInfo2 = new RSInfo(4527, "rsHost2:456", (long)0, (byte)0, 1); RSInfo rsInfo2 = new RSInfo(4527, "rsHost2:456", 0, (byte)0, 1); RSInfo rsInfo3 = new RSInfo(0, "rsHost3:789", (long)-21113, (byte)98, 1); RSInfo rsInfo3 = new RSInfo(0, "rsHost3:789", -21113, (byte)98, 1); RSInfo rsInfo4 = new RSInfo(45678, "rsHost4:1011", (long)-21113, (byte)98, 1); RSInfo rsInfo4 = new RSInfo(45678, "rsHost4:1011", -21113, (byte)98, 1); List<RSInfo> rsList1 = new ArrayList<RSInfo>(); rsList1.add(rsInfo1); @@ -1406,7 +1374,7 @@ final String test = "string used for test"; UpdateMsg msg = new UpdateMsg( new ChangeNumber((long) 1, 2 , 39123), new ChangeNumber(1, 2 , 39123), test.getBytes()); UpdateMsg newMsg = new UpdateMsg(msg.getBytes()); assertEquals(test.getBytes(), newMsg.getPayload()); @@ -1449,7 +1417,7 @@ ChangeNumber changeNumber = new ChangeNumber(TimeThread.getTime(), 123, 45); String generalizedState = "fakegenstate"; ServerState state = new ServerState(); assertTrue(state.update(new ChangeNumber((long)75, 5,263))); assertTrue(state.update(new ChangeNumber(75, 5,263))); short mode = 3; int firstDraftChangeNumber = 13; int lastDraftChangeNumber = 14; @@ -1463,7 +1431,7 @@ msg.setLastDraftChangeNumber(lastDraftChangeNumber); msg.setECLRequestType(mode); msg.setOperationId(myopid); ArrayList<String> dns = new ArrayList<String>(); Set<String> dns = new HashSet<String>(); String dn1 = "cn=admin data"; String dn2 = "cn=config"; dns.add(dn1); @@ -1481,7 +1449,7 @@ msg.getCrossDomainServerState().equalsIgnoreCase(newMsg.getCrossDomainServerState())); assertTrue( msg.getOperationId().equalsIgnoreCase(newMsg.getOperationId())); ArrayList<String> dns2 = newMsg.getExcludedServiceIDs(); Set<String> dns2 = newMsg.getExcludedServiceIDs(); assertTrue(dns2.size()==2); boolean dn1found=false,dn2found=false; for (String dn : dns2) @@ -1537,7 +1505,7 @@ // create op AddOperation addOpB = new AddOperationBasis(connection, (long) 1, 1, null, dn, objectClassList, userAttList, opList); 1, 1, null, dn, objectClassList, userAttList, opList); LocalBackendAddOperation addOp = new LocalBackendAddOperation(addOpB); OperationContext opCtx = new AddContext(cn, "thisIsaUniqueID", "parentUniqueId"); @@ -1617,7 +1585,7 @@ // create op ModifyOperation modifyOpB = new ModifyOperationBasis( connection, (long)1, 1, null, dn, mods); connection, 1, 1, null, dn, mods); LocalBackendModifyOperation modifyOp = new LocalBackendModifyOperation(modifyOpB); OperationContext opCtx = new ModifyContext(cn, "thisIsaUniqueID");