From 2d13862af451882e06a892347cab630304a9455c Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Tue, 21 Feb 2012 15:49:01 +0000
Subject: [PATCH] Initial cleanup work for OPENDJ-181: DirectoryException provided value has an invalid length for a UUID
---
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyMsg.java | 14
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java | 137 +++++++-------
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/protocol/SynchronizationMsgTest.java | 6
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/protocol/ProtocolCompatibilityTest.java | 26 +-
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/DeleteMsg.java | 14
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeDelOperation.java | 16 +
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyDnContext.java | 19 +-
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationBackend.java | 10
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java | 4
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/LDAPUpdateMsg.java | 26 +-
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyDNMsg.java | 76 ++++----
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/AddContext.java | 18 +
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/DeleteContext.java | 7
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java | 6
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeModifyOperation.java | 1
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/ModifyConflictTest.java | 16
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/EntryHistorical.java | 28 +-
opendj-sdk/opends/src/server/org/opends/server/workflowelement/externalchangelog/ECLSearchOperation.java | 6
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/PersistentServerState.java | 5
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeModdnOperation.java | 5
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyContext.java | 7
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/OperationContext.java | 17 +
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java | 8
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/AddMsg.java | 58 +++---
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeAddOperation.java | 5
25 files changed, 274 insertions(+), 261 deletions(-)
diff --git a/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java b/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java
index 97887da..241ea29 100644
--- a/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java
+++ b/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011 ForgeRock AS
+ * Portions Copyright 2011-2012 ForgeRock AS
*/
package org.opends.guitools.controlpanel.ui;
@@ -645,7 +645,7 @@
{
CustomSearchResult filteredSr;
List<Object> values =
- sr.getAttributeValues(EntryHistorical.HISTORICALATTRIBUTENAME);
+ sr.getAttributeValues(EntryHistorical.HISTORICAL_ATTRIBUTE_NAME);
if (values != null)
{
List<Object> newValues = new ArrayList<Object>();
@@ -660,7 +660,7 @@
else
{
filteredSr = sr.duplicate();
- filteredSr.set(EntryHistorical.HISTORICALATTRIBUTENAME, newValues);
+ filteredSr.set(EntryHistorical.HISTORICAL_ATTRIBUTE_NAME, newValues);
}
}
else
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/EntryHistorical.java b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/EntryHistorical.java
index 450f2bf..7080249 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/EntryHistorical.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/EntryHistorical.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011 ForgeRock AS
+ * Portions Copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.replication.plugin;
@@ -71,7 +71,7 @@
/**
* Name of the attribute used to store historical information.
*/
- public static final String HISTORICALATTRIBUTENAME = "ds-sync-hist";
+ public static final String HISTORICAL_ATTRIBUTE_NAME = "ds-sync-hist";
/**
* Name used to store attachment of historical information in the
@@ -83,7 +83,7 @@
/**
* Name of the entryuuid attribute.
*/
- public static final String ENTRYUIDNAME = "entryuuid";
+ public static final String ENTRYUUID_ATTRIBUTE_NAME = "entryuuid";
/* The delay to purge the historical informations
* This delay indicates the time the domain keeps the historical
@@ -320,7 +320,7 @@
PreOperationAddOperation addOperation)
{
AttributeType historicalAttrType =
- DirectoryServer.getSchema().getAttributeType(HISTORICALATTRIBUTENAME);
+ DirectoryServer.getSchema().getAttributeType(HISTORICAL_ATTRIBUTE_NAME);
// Get the changeNumber from the attached synchronization context
// Create the attribute (encoded)
@@ -346,7 +346,7 @@
private static AttributeValue encodeAddHistorical(ChangeNumber cn)
{
AttributeType historicalAttrType =
- DirectoryServer.getSchema().getAttributeType(HISTORICALATTRIBUTENAME);
+ DirectoryServer.getSchema().getAttributeType(HISTORICAL_ATTRIBUTE_NAME);
String strValue = "dn:" + cn.toString() +":add";
AttributeValue val = AttributeValues.create(historicalAttrType, strValue);
@@ -365,7 +365,7 @@
private static AttributeValue encodeMODDNHistorical(ChangeNumber cn)
{
AttributeType historicalAttrType =
- DirectoryServer.getSchema().getAttributeType(HISTORICALATTRIBUTENAME);
+ DirectoryServer.getSchema().getAttributeType(HISTORICAL_ATTRIBUTE_NAME);
String strValue = "dn:" + cn.toString() +":moddn";
AttributeValue val = AttributeValues.create(historicalAttrType, strValue);
@@ -450,7 +450,7 @@
purgeDate = TimeThread.getTime() - purgeDelayInMillisec;
AttributeType historicalAttrType =
- DirectoryServer.getSchema().getAttributeType(HISTORICALATTRIBUTENAME);
+ DirectoryServer.getSchema().getAttributeType(HISTORICAL_ATTRIBUTE_NAME);
AttributeBuilder builder = new AttributeBuilder(historicalAttrType);
for (Map.Entry<AttributeType, AttrHistoricalWithOptions> entryWithOptions :
@@ -837,7 +837,7 @@
}
else
{
- String uuidString = getEntryUuid(entry);
+ String uuidString = getEntryUUID(entry);
if (uuidString != null)
{
modifyFakeOperation = new FakeModifyOperation(entry.getDN(),
@@ -866,7 +866,7 @@
*/
public static List<Attribute> getHistoricalAttr(Entry entry)
{
- return entry.getAttribute(HISTORICALATTRIBUTENAME);
+ return entry.getAttribute(HISTORICAL_ATTRIBUTE_NAME);
}
/**
@@ -876,11 +876,11 @@
*
* @return The Unique Id of the entry if it has one. null, otherwise.
*/
- public static String getEntryUuid(Entry entry)
+ public static String getEntryUUID(Entry entry)
{
String uuidString = null;
AttributeType entryuuidAttrType =
- DirectoryServer.getSchema().getAttributeType(ENTRYUIDNAME);
+ DirectoryServer.getSchema().getAttributeType(ENTRYUUID_ATTRIBUTE_NAME);
List<Attribute> uuidAttrs =
entry.getOperationalAttribute(entryuuidAttrType);
if (uuidAttrs != null)
@@ -903,12 +903,12 @@
* @param op The operation
* @return The Entry Unique Id String form.
*/
- public static String getEntryUuid(PreOperationAddOperation op)
+ public static String getEntryUUID(PreOperationAddOperation op)
{
String uuidString = null;
Map<AttributeType, List<Attribute>> attrs = op.getOperationalAttributes();
AttributeType entryuuidAttrType =
- DirectoryServer.getSchema().getAttributeType(ENTRYUIDNAME);
+ DirectoryServer.getSchema().getAttributeType(ENTRYUUID_ATTRIBUTE_NAME);
List<Attribute> uuidAttrs = attrs.get(entryuuidAttrType);
if (uuidAttrs != null)
@@ -936,7 +936,7 @@
{
AttributeType attrType = attr.getAttributeType();
return
- attrType.getNameOrOID().equals(EntryHistorical.HISTORICALATTRIBUTENAME);
+ attrType.getNameOrOID().equals(EntryHistorical.HISTORICAL_ATTRIBUTE_NAME);
}
/**
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeAddOperation.java b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeAddOperation.java
index 4781b73..55abcb2 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeAddOperation.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeAddOperation.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
+ * Portions copyright 2012 ForgeRock AS.
*/
package org.opends.server.replication.plugin;
@@ -61,8 +62,8 @@
public AddMsg generateMessage()
{
return new AddMsg(getChangeNumber(), entry.getDN().toString(),
- EntryHistorical.getEntryUuid(entry),
- LDAPReplicationDomain.findEntryId(
+ EntryHistorical.getEntryUUID(entry),
+ LDAPReplicationDomain.findEntryUUID(
entry.getDN().getParentDNInSuffix()),
entry.getObjectClasses(),
entry.getUserAttributes(), entry.getOperationalAttributes());
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeDelOperation.java b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeDelOperation.java
index 9f1204b..56fc27f 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeDelOperation.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeDelOperation.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
+ * Portions copyright 2012 ForgeRock AS.
*/
package org.opends.server.replication.plugin;
@@ -42,20 +43,21 @@
public class FakeDelOperation extends FakeOperation
{
final private String dn;
- private final String uid;
+ private final String entryUUID;
/**
* Creates a new FakeDelOperation from the provided information.
*
* @param dn The dn of the entry that was deleted.
* @param changeNumber The ChangeNumber of the operation.
- * @param uid The Unique ID of the deleted entry.
+ * @param entryUUID The Unique ID of the deleted entry.
*/
- public FakeDelOperation(String dn, ChangeNumber changeNumber, String uid)
+ public FakeDelOperation(String dn, ChangeNumber changeNumber,
+ String entryUUID)
{
super(changeNumber);
this.dn = dn;
- this.uid = uid;
+ this.entryUUID = entryUUID;
}
@@ -65,7 +67,7 @@
@Override
public ReplicationMsg generateMessage()
{
- return new DeleteMsg(dn, this.getChangeNumber(), uid);
+ return new DeleteMsg(dn, this.getChangeNumber(), entryUUID);
}
/**
@@ -73,8 +75,8 @@
*
* @return The Unique ID of the entry that was deleted with this operation.
*/
- public String getUUID()
+ public String getEntryUUID()
{
- return uid;
+ return entryUUID;
}
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeModdnOperation.java b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeModdnOperation.java
index 748f777..13f89ae 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeModdnOperation.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeModdnOperation.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
+ * Portions copyright 2012 ForgeRock AS.
*/
package org.opends.server.replication.plugin;
@@ -65,8 +66,8 @@
{
DN dn = entry.getDN();
return new ModifyDNMsg(dn.toString(), this.getChangeNumber(),
- EntryHistorical.getEntryUuid(entry),
- LDAPReplicationDomain.findEntryId(dn.getParent()),
+ EntryHistorical.getEntryUUID(entry),
+ LDAPReplicationDomain.findEntryUUID(dn.getParent()),
false, dn.getParent().toString(), dn.getRDN().toString());
}
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeModifyOperation.java b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeModifyOperation.java
index 394e838..e9ad18a 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeModifyOperation.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/FakeModifyOperation.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
+ * Portions copyright 2012 ForgeRock AS.
*/
package org.opends.server.replication.plugin;
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
index ace05d4..5382759 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -33,7 +33,7 @@
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.replication.plugin.EntryHistorical.ENTRYUIDNAME;
+import static org.opends.server.replication.plugin.EntryHistorical.*;
import static org.opends.server.replication.protocol.OperationContext.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.createEntry;
@@ -1829,8 +1829,8 @@
* Check that the modified entry has the same entryuuid
* as it was in the original message.
*/
- String operationEntryUUID = ctx.getEntryUid();
- String modifiedEntryUUID = EntryHistorical.getEntryUuid(deletedEntry);
+ String operationEntryUUID = ctx.getEntryUUID();
+ String modifiedEntryUUID = EntryHistorical.getEntryUUID(deletedEntry);
if (!operationEntryUUID.equals(modifiedEntryUUID))
{
/*
@@ -1853,7 +1853,7 @@
// There is no replication context attached to the operation
// so this is not a replication operation.
ChangeNumber changeNumber = generateChangeNumber(deleteOperation);
- String modifiedEntryUUID = EntryHistorical.getEntryUuid(deletedEntry);
+ String modifiedEntryUUID = EntryHistorical.getEntryUUID(deletedEntry);
ctx = new DeleteContext(changeNumber, modifiedEntryUUID);
deleteOperation.setAttachment(SYNCHROCONTEXT, ctx);
@@ -1933,7 +1933,7 @@
* If an entry with the same entry uniqueID already exist then
* this operation has already been replayed in the past.
*/
- String uuid = ctx.getEntryUid();
+ String uuid = ctx.getEntryUUID();
if (findEntryDN(uuid) != null)
{
return new SynchronizationProviderResult.StopProcessing(
@@ -1945,14 +1945,14 @@
* of the parent entry
*/
- String parentUid = ctx.getParentUid();
+ String parentEntryUUID = ctx.getParentEntryUUID();
// root entry have no parent,
// there is no need to check for it.
- if (parentUid != null)
+ if (parentEntryUUID != null)
{
// There is a potential of perfs improvement here
// if we could avoid the following parent entry retrieval
- DN parentDnFromCtx = findEntryDN(ctx.getParentUid());
+ DN parentDnFromCtx = findEntryDN(ctx.getParentEntryUUID());
if (parentDnFromCtx == null)
{
@@ -2072,8 +2072,8 @@
* as was in the original message.
*/
String modifiedEntryUUID =
- EntryHistorical.getEntryUuid(modifyDNOperation.getOriginalEntry());
- if (!modifiedEntryUUID.equals(ctx.getEntryUid()))
+ EntryHistorical.getEntryUUID(modifyDNOperation.getOriginalEntry());
+ if (!modifiedEntryUUID.equals(ctx.getEntryUUID()))
{
/*
* The modified entry is not the same entry as the one on
@@ -2095,9 +2095,9 @@
* Also check that the current id of the
* parent is the same as when the operation was performed.
*/
- String newParentId = findEntryId(modifyDNOperation.getNewSuperior());
- if ((newParentId != null) && (ctx.getNewParentId() != null) &&
- (!newParentId.equals(ctx.getNewParentId())))
+ String newParentId = findEntryUUID(modifyDNOperation.getNewSuperior());
+ if ((newParentId != null) && (ctx.getNewSuperiorEntryUUID() != null) &&
+ (!newParentId.equals(ctx.getNewSuperiorEntryUUID())))
{
return new SynchronizationProviderResult.StopProcessing(
ResultCode.NO_SUCH_OBJECT, null);
@@ -2123,11 +2123,11 @@
String newParentId = null;
if (modifyDNOperation.getNewSuperior() != null)
{
- newParentId = findEntryId(modifyDNOperation.getNewSuperior());
+ newParentId = findEntryUUID(modifyDNOperation.getNewSuperior());
}
Entry modifiedEntry = modifyDNOperation.getOriginalEntry();
- String modifiedEntryUUID = EntryHistorical.getEntryUuid(modifiedEntry);
+ String modifiedEntryUUID = EntryHistorical.getEntryUUID(modifiedEntry);
ctx = new ModifyDnContext(changeNumber, modifiedEntryUUID, newParentId);
modifyDNOperation.setAttachment(SYNCHROCONTEXT, ctx);
}
@@ -2208,7 +2208,7 @@
// - attach the context to the op
ChangeNumber changeNumber = generateChangeNumber(modifyOperation);
- String modifiedEntryUUID = EntryHistorical.getEntryUuid(modifiedEntry);
+ String modifiedEntryUUID = EntryHistorical.getEntryUUID(modifiedEntry);
if (modifiedEntryUUID == null)
modifiedEntryUUID = modifyOperation.getEntryDN().toString();
ctx = new ModifyContext(changeNumber, modifiedEntryUUID);
@@ -2221,8 +2221,8 @@
// replayed here, it is necessary to
// - check if the entry has been renamed
// - check for conflicts
- String modifiedEntryUUID = ctx.getEntryUid();
- String currentEntryUUID = EntryHistorical.getEntryUuid(modifiedEntry);
+ String modifiedEntryUUID = ctx.getEntryUUID();
+ String currentEntryUUID = EntryHistorical.getEntryUUID(modifiedEntry);
if ((currentEntryUUID != null) &&
(!currentEntryUUID.equals(modifiedEntryUUID)))
{
@@ -2262,7 +2262,7 @@
* The preOperation phase for the add Operation.
* Its job is to generate the replication context associated to the
* operation. It is necessary to do it in this phase because contrary to
- * the other operations, the entry uid is not set when the handleConflict
+ * the other operations, the entry UUID is not set when the handleConflict
* phase is called.
*
* @param addOperation The Add Operation.
@@ -2270,8 +2270,8 @@
public void doPreOperation(PreOperationAddOperation addOperation)
{
AddContext ctx = new AddContext(generateChangeNumber(addOperation),
- EntryHistorical.getEntryUuid(addOperation),
- findEntryId(addOperation.getEntryDN().getParentDNInSuffix()));
+ EntryHistorical.getEntryUUID(addOperation),
+ findEntryUUID(addOperation.getEntryDN().getParentDNInSuffix()));
addOperation.setAttachment(SYNCHROCONTEXT, ctx);
}
@@ -2412,7 +2412,7 @@
* for which an other entry was in conflict.
* Steps:
* - get the DN freed by a DELETE or MODRDN op
- * - search for entries put in the conflict space (dn=entryuid'+'....)
+ * - search for entries put in the conflict space (dn=entryUUID'+'....)
* because the expected DN was not available (ds-sync-conflict=expected DN)
* - retain the entry with the oldest conflict
* - rename this entry with the freedDN as it was expected originally
@@ -2444,8 +2444,8 @@
ByteString.valueOf(freedDN.toString()));
LinkedHashSet<String> attrs = new LinkedHashSet<String>(1);
- attrs.add(EntryHistorical.HISTORICALATTRIBUTENAME);
- attrs.add(EntryHistorical.ENTRYUIDNAME);
+ attrs.add(EntryHistorical.HISTORICAL_ATTRIBUTE_NAME);
+ attrs.add(EntryHistorical.ENTRYUUID_ATTRIBUTE_NAME);
attrs.add("*");
InternalSearchOperation searchOp = conn.processSearch(
ByteString.valueOf(baseDn.toString()),
@@ -2835,13 +2835,13 @@
/**
* Find the Unique Id of the entry with the provided DN by doing a
- * search of the entry and extracting its uniqueID from its attributes.
+ * search of the entry and extracting its entryUUID from its attributes.
*
* @param dn The dn of the entry for which the unique Id is searched.
*
* @return The unique Id of the entry with the provided DN.
*/
- static String findEntryId(DN dn)
+ static String findEntryUUID(DN dn)
{
if (dn == null)
return null;
@@ -2850,7 +2850,7 @@
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
LinkedHashSet<String> attrs = new LinkedHashSet<String>(1);
- attrs.add(ENTRYUIDNAME);
+ attrs.add(ENTRYUUID_ATTRIBUTE_NAME);
InternalSearchOperation search = conn.processSearch(dn,
SearchScope.BASE_OBJECT, DereferencePolicy.NEVER_DEREF_ALIASES,
0, 0, false,
@@ -2865,7 +2865,7 @@
SearchResultEntry resultEntry = result.getFirst();
if (resultEntry != null)
{
- return EntryHistorical.getEntryUuid(resultEntry);
+ return EntryHistorical.getEntryUUID(resultEntry);
}
}
}
@@ -2921,7 +2921,7 @@
{
ResultCode result = op.getResultCode();
ModifyContext ctx = (ModifyContext) op.getAttachment(SYNCHROCONTEXT);
- String entryUid = ctx.getEntryUid();
+ String entryUUID = ctx.getEntryUUID();
if (result == ResultCode.NO_SUCH_OBJECT)
{
@@ -2931,7 +2931,7 @@
* search if the entry has been renamed, and return the new dn
* of the entry.
*/
- DN newdn = findEntryDN(entryUid);
+ DN newdn = findEntryDN(entryUUID);
if (newdn != null)
{
// There is an entry with the same unique id as this modify operation
@@ -2950,7 +2950,7 @@
}
else if (result == ResultCode.NOT_ALLOWED_ON_RDN)
{
- DN currentDN = findEntryDN(entryUid);
+ DN currentDN = findEntryDN(entryUUID);
RDN currentRDN;
if (currentDN != null)
{
@@ -3023,14 +3023,14 @@
{
ResultCode result = op.getResultCode();
DeleteContext ctx = (DeleteContext) op.getAttachment(SYNCHROCONTEXT);
- String entryUid = ctx.getEntryUid();
+ String entryUUID = ctx.getEntryUUID();
if (result == ResultCode.NO_SUCH_OBJECT)
{
/*
* Find if the entry is still in the database.
*/
- DN currentDn = findEntryDN(entryUid);
+ DN currentDn = findEntryDN(entryUUID);
if (currentDn == null)
{
/*
@@ -3065,7 +3065,7 @@
* when we are adding an entry whose parent entry has already been deleted.
*
*/
- if (findAndRenameChild(entryUid, op.getEntryDN(), op))
+ if (findAndRenameChild(entryUUID, op.getEntryDN(), op))
numUnresolvedNamingConflicts.incrementAndGet();
return false;
@@ -3095,8 +3095,8 @@
{
ResultCode result = op.getResultCode();
ModifyDnContext ctx = (ModifyDnContext) op.getAttachment(SYNCHROCONTEXT);
- String entryUid = ctx.getEntryUid();
- String newSuperiorID = ctx.getNewParentId();
+ String entryUUID = ctx.getEntryUUID();
+ String newSuperiorID = ctx.getNewSuperiorEntryUUID();
/*
* four possible cases :
@@ -3111,7 +3111,7 @@
*/
// get the current DN of this entry in the database.
- DN currentDN = findEntryDN(entryUid);
+ DN currentDN = findEntryDN(entryUUID);
// Construct the new DN to use for the entry.
DN entryDN = op.getEntryDN();
@@ -3185,7 +3185,7 @@
*/
ModifyDNMsg modifyDnMsg = (ModifyDNMsg) msg;
markConflictEntry(op, op.getEntryDN(), newDN);
- modifyDnMsg.setNewRDN(generateConflictRDN(entryUid,
+ modifyDnMsg.setNewRDN(generateConflictRDN(entryUUID,
modifyDnMsg.getNewRDN()));
modifyDnMsg.setNewSuperior(newSuperior.toString());
numUnresolvedNamingConflicts.incrementAndGet();
@@ -3217,8 +3217,8 @@
{
ResultCode result = op.getResultCode();
AddContext ctx = (AddContext) op.getAttachment(SYNCHROCONTEXT);
- String entryUid = ctx.getEntryUid();
- String parentUniqueId = ctx.getParentUid();
+ String entryUUID = ctx.getEntryUUID();
+ String parentUniqueId = ctx.getParentEntryUUID();
if (result == ResultCode.NO_SUCH_OBJECT)
{
@@ -3248,12 +3248,12 @@
*/
addConflict(msg);
- msg.setDn(generateConflictRDN(entryUid,
+ msg.setDn(generateConflictRDN(entryUUID,
op.getEntryDN().getRDN().toString()) + ","
+ baseDn);
- // reset the parent uid so that the check done is the handleConflict
- // phase does not fail.
- msg.setParentUid(null);
+ // reset the parent entryUUID so that the check done is the
+ // handleConflict phase does not fail.
+ msg.setParentEntryUUID(null);
numUnresolvedNamingConflicts.incrementAndGet();
return false;
}
@@ -3276,7 +3276,7 @@
* don't do anything
* if the entry unique id do not exist, generate conflict.
*/
- if (findEntryDN(entryUid) != null)
+ if (findEntryDN(entryUUID) != null)
{
// entry already exist : this is a replay
return true;
@@ -3284,7 +3284,7 @@
else
{
addConflict(msg);
- msg.setDn(generateConflictRDN(entryUid, msg.getDn()));
+ msg.setDn(generateConflictRDN(entryUUID, msg.getDn()));
numUnresolvedNamingConflicts.incrementAndGet();
return false;
}
@@ -3306,12 +3306,12 @@
* so that they stay below the baseDn of this replicationDomain and
* use the conflicting name and attribute.
*
- * @param entryUid The unique ID of the entry whose child must be renamed.
+ * @param entryUUID The unique ID of the entry whose child must be renamed.
* @param entryDN The DN of the entry whose child must be renamed.
* @param conflictOp The Operation that generated the conflict.
*/
private boolean findAndRenameChild(
- String entryUid, DN entryDN, Operation conflictOp)
+ String entryUUID, DN entryDN, Operation conflictOp)
{
boolean conflict = false;
@@ -3319,8 +3319,8 @@
try
{
LinkedHashSet<String> attrs = new LinkedHashSet<String>(1);
- attrs.add(ENTRYUIDNAME);
- attrs.add(EntryHistorical.HISTORICALATTRIBUTENAME);
+ attrs.add(ENTRYUUID_ATTRIBUTE_NAME);
+ attrs.add(EntryHistorical.HISTORICAL_ATTRIBUTE_NAME);
SearchFilter ALLMATCH;
ALLMATCH = SearchFilter.createFilterFromString("(objectClass=*)");
@@ -3343,7 +3343,7 @@
*/
conflict = true;
renameConflictEntry(conflictOp, entry.getDN(),
- EntryHistorical.getEntryUuid(entry));
+ EntryHistorical.getEntryUUID(entry));
}
}
}
@@ -3382,16 +3382,17 @@
*
* @param conflictOp The Operation that caused the conflict.
* @param dn The DN of the entry to be renamed.
- * @param uid The uniqueID of the entry to be renamed.
+ * @param entryUUID The uniqueID of the entry to be renamed.
*/
- private void renameConflictEntry(Operation conflictOp, DN dn, String uid)
+ private void renameConflictEntry(Operation conflictOp, DN dn,
+ String entryUUID)
{
Message alertMessage = NOTE_UNRESOLVED_CONFLICT.get(dn.toString());
DirectoryServer.sendAlertNotification(this,
ALERT_TYPE_REPLICATION_UNRESOLVED_CONFLICT, alertMessage);
ModifyDNOperation newOp =
- renameEntry(dn, generateDeleteConflictDn(uid, dn), baseDn, true);
+ renameEntry(dn, generateDeleteConflictDn(entryUUID, dn), baseDn, true);
if (newOp.getResultCode() != ResultCode.SUCCESS)
{
@@ -3489,29 +3490,29 @@
/**
* Generate the Dn to use for a conflicting entry.
*
- * @param entryUid The unique identifier of the entry involved in the
+ * @param entryUUID The unique identifier of the entry involved in the
* conflict.
* @param rdn Original rdn.
* @return The generated RDN for a conflicting entry.
*/
- private String generateConflictRDN(String entryUid, String rdn)
+ private String generateConflictRDN(String entryUUID, String rdn)
{
- return "entryuuid=" + entryUid + "+" + rdn;
+ return "entryuuid=" + entryUUID + "+" + rdn;
}
/**
* Generate the RDN to use for a conflicting entry whose father was deleted.
*
- * @param entryUid The unique identifier of the entry involved in the
+ * @param entryUUID The unique identifier of the entry involved in the
* conflict.
* @param dn The original DN of the entry.
*
* @return The generated RDN for a conflicting entry.
* @throws DirectoryException
*/
- private RDN generateDeleteConflictDn(String entryUid, DN dn)
+ private RDN generateDeleteConflictDn(String entryUUID, DN dn)
{
- String newRDN = "entryuuid=" + entryUid + "+" + dn.getRDN();
+ String newRDN = "entryuuid=" + entryUUID + "+" + dn.getRDN();
RDN rdn = null;
try
{
@@ -4863,13 +4864,13 @@
}
LDAPFilter filter = LDAPFilter.decode(
- "(&(" + EntryHistorical.HISTORICALATTRIBUTENAME + ">=dummy:"
- + fromChangeNumber + ")(" + EntryHistorical.HISTORICALATTRIBUTENAME +
+ "(&(" + EntryHistorical.HISTORICAL_ATTRIBUTE_NAME + ">=dummy:"
+ + fromChangeNumber + ")(" + EntryHistorical.HISTORICAL_ATTRIBUTE_NAME +
"<=dummy:" + maxValueForId + "))");
LinkedHashSet<String> attrs = new LinkedHashSet<String>(1);
- attrs.add(EntryHistorical.HISTORICALATTRIBUTENAME);
- attrs.add(EntryHistorical.ENTRYUIDNAME);
+ attrs.add(EntryHistorical.HISTORICAL_ATTRIBUTE_NAME);
+ attrs.add(EntryHistorical.ENTRYUUID_ATTRIBUTE_NAME);
attrs.add("*");
return conn.processSearch(
ByteString.valueOf(baseDn.toString()),
@@ -5651,7 +5652,7 @@
* for which an other entry was in conflict.
* Steps:
* - get the DN freed by a DELETE or MODRDN op
- * - search for entries put in the conflict space (dn=entryuid'+'....)
+ * - search for entries put in the conflict space (dn=entryUUID'+'....)
* because the expected DN was not available (ds-sync-conflict=expected DN)
* - retain the entry with the oldest conflict
* - rename this entry with the freedDN as it was expected originally
@@ -5676,7 +5677,7 @@
try
{
filter = LDAPFilter.decode(
- "(" + EntryHistorical.HISTORICALATTRIBUTENAME + ">=dummy:"
+ "(" + EntryHistorical.HISTORICAL_ATTRIBUTE_NAME + ">=dummy:"
+ lastChangeNumberPurgedFromHist + ")");
} catch (LDAPException e)
@@ -5685,8 +5686,8 @@
}
LinkedHashSet<String> attrs = new LinkedHashSet<String>(1);
- attrs.add(EntryHistorical.HISTORICALATTRIBUTENAME);
- attrs.add(EntryHistorical.ENTRYUIDNAME);
+ attrs.add(EntryHistorical.HISTORICAL_ATTRIBUTE_NAME);
+ attrs.add(EntryHistorical.ENTRYUUID_ATTRIBUTE_NAME);
attrs.add("*");
InternalSearchOperation searchOp = conn.processSearch(
ByteString.valueOf(baseDn.toString()),
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/PersistentServerState.java b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/PersistentServerState.java
index 6cf5725..729b122 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/PersistentServerState.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/PersistentServerState.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
+ * Portions copyright 2012 ForgeRock AS.
*/
package org.opends.server.replication.plugin;
import org.opends.messages.Message;
@@ -421,8 +422,8 @@
InternalSearchOperation op;
ChangeNumber serverStateMaxCn;
ChangeNumber dbMaxCn;
- final AttributeType histType =
- DirectoryServer.getAttributeType(EntryHistorical.HISTORICALATTRIBUTENAME);
+ final AttributeType histType = DirectoryServer.getAttributeType(
+ EntryHistorical.HISTORICAL_ATTRIBUTE_NAME);
// Retrieves the entries that have changed since the
// maxCn stored in the serverState
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/AddContext.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/AddContext.java
index a3093e4..326a2f4 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/AddContext.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/AddContext.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
+ * Portions copyright 2012 ForgeRock AS.
*/
package org.opends.server.replication.protocol;
@@ -37,19 +38,20 @@
/**
* The Unique Id of the parent entry of the added entry.
*/
- private String parentUid;
+ private String parentEntryUUID;
/**
* Creates a new AddContext with the provided information.
*
* @param changeNumber The change number of the add operation.
- * @param uid the Unique Id of the added entry.
- * @param parentUid The unique Id of the parent of the added entry.
+ * @param entryUUID the Unique Id of the added entry.
+ * @param parentEntryUUID The unique Id of the parent of the added entry.
*/
- public AddContext(ChangeNumber changeNumber, String uid, String parentUid)
+ public AddContext(ChangeNumber changeNumber, String entryUUID,
+ String parentEntryUUID)
{
- super(changeNumber, uid);
- this.parentUid = parentUid;
+ super(changeNumber, entryUUID);
+ this.parentEntryUUID = parentEntryUUID;
}
/**
@@ -57,8 +59,8 @@
*
* @return Returns the Unique Id of the parent of the added entry.
*/
- public String getParentUid()
+ public String getParentEntryUUID()
{
- return parentUid;
+ return parentEntryUUID;
}
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/AddMsg.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/AddMsg.java
index 611ff45..a624d6b 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/AddMsg.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/AddMsg.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011 ForgeRock AS
+ * Portions Copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.replication.protocol;
@@ -60,7 +60,7 @@
private byte[] encodedAttributes;
// Parent is managed decoded
- private String parentUniqueId;
+ private String parentEntryUUID;
/**
* Creates a new AddMessage.
@@ -74,7 +74,7 @@
AddContext ctx = (AddContext) op.getAttachment(SYNCHROCONTEXT);
// Stores parentUniqueID not encoded
- this.parentUniqueId = ctx.getParentUid();
+ this.parentEntryUUID = ctx.getParentEntryUUID();
// Stores attributes encoded
this.encodedAttributes = encodeAttributes(op.getObjectClasses(),
@@ -86,8 +86,8 @@
*
* @param cn ChangeNumber of the add.
* @param dn DN of the added entry.
- * @param uniqueId The Unique identifier of the added entry.
- * @param parentId The unique Id of the parent of the added
+ * @param entryUUID The Unique identifier of the added entry.
+ * @param parentEntryUUID The unique Id of the parent of the added
* entry.
* @param objectClasses objectclass of the added entry.
* @param userAttributes user attributes of the added entry.
@@ -95,16 +95,16 @@
*/
public AddMsg(ChangeNumber cn,
String dn,
- String uniqueId,
- String parentId,
+ String entryUUID,
+ String parentEntryUUID,
Map<ObjectClass, String> objectClasses,
Map<AttributeType,List<Attribute>> userAttributes,
Map<AttributeType,List<Attribute>> operationalAttributes)
{
- super (cn, uniqueId, dn);
+ super (cn, entryUUID, dn);
// Stores parentUniqueID not encoded
- this.parentUniqueId = parentId;
+ this.parentEntryUUID = parentEntryUUID;
// Stores attributes encoded
this.encodedAttributes = encodeAttributes(objectClasses, userAttributes,
@@ -134,7 +134,7 @@
super (cn, uniqueId, dn);
// Stores parentUniqueID not encoded
- this.parentUniqueId = parentId;
+ this.parentEntryUUID = parentId;
// Stores attributes encoded
this.encodedAttributes = encodeAttributes(objectClass, userAttributes,
@@ -183,8 +183,8 @@
InternalClientConnection.nextOperationID(),
InternalClientConnection.nextMessageID(), null,
ByteString.valueOf(newDn), attr);
- AddContext ctx = new AddContext(getChangeNumber(), getUniqueId(),
- parentUniqueId);
+ AddContext ctx = new AddContext(getChangeNumber(), getEntryUUID(),
+ parentEntryUUID);
add.setAttachment(SYNCHROCONTEXT, ctx);
return add;
}
@@ -201,9 +201,9 @@
{
int bodyLength = encodedAttributes.length;
byte[] byteParentId = null;
- if (parentUniqueId != null)
+ if (parentEntryUUID != null)
{
- byteParentId = parentUniqueId.getBytes("UTF-8");
+ byteParentId = parentEntryUUID.getBytes("UTF-8");
bodyLength += byteParentId.length + 1;
}
else
@@ -240,10 +240,10 @@
// Compute the total length of the body
byte[] byteParentId = null;
- if (parentUniqueId != null)
+ if (parentEntryUUID != null)
{
// Encode parentID now to get the length of the encoded bytes
- byteParentId = parentUniqueId.getBytes("UTF-8");
+ byteParentId = parentEntryUUID.getBytes("UTF-8");
bodyLength += byteParentId.length + 1;
}
else
@@ -282,10 +282,10 @@
// Compute the total length of the body
byte[] byteParentId = null;
- if (parentUniqueId != null)
+ if (parentEntryUUID != null)
{
// Encode parentID now to get the length of the encoded bytes
- byteParentId = parentUniqueId.getBytes("UTF-8");
+ byteParentId = parentEntryUUID.getBytes("UTF-8");
bodyLength += byteParentId.length + 1;
}
else
@@ -409,12 +409,12 @@
int length = getNextLength(in, pos);
if (length != 0)
{
- parentUniqueId = new String(in, pos, length, "UTF-8");
+ parentEntryUUID = new String(in, pos, length, "UTF-8");
pos += length + 1;
}
else
{
- parentUniqueId = null;
+ parentEntryUUID = null;
pos += 1;
}
@@ -434,12 +434,12 @@
int length = getNextLength(in, pos);
if (length != 0)
{
- parentUniqueId = new String(in, pos, length, "UTF-8");
+ parentEntryUUID = new String(in, pos, length, "UTF-8");
pos += length + 1;
}
else
{
- parentUniqueId = null;
+ parentEntryUUID = null;
pos += 1;
}
@@ -499,7 +499,7 @@
" protocolVersion: " + protocolVersion +
" dn: " + dn +
" changeNumber: " + changeNumber +
- " uniqueId: " + uniqueId +
+ " uniqueId: " + entryUUID +
" assuredFlag: " + assuredFlag;
}
if (protocolVersion >= ProtocolVersion.REPLICATION_PROTOCOL_V2)
@@ -508,7 +508,7 @@
" protocolVersion: " + protocolVersion +
" dn: " + dn +
" changeNumber: " + changeNumber +
- " uniqueId: " + uniqueId +
+ " uniqueId: " + entryUUID +
" assuredFlag: " + assuredFlag +
" assuredMode: " + assuredMode +
" safeDataLevel: " + safeDataLevel;
@@ -559,20 +559,20 @@
/**
* Set the parent unique id of this add msg.
*
- * @param uid the parent unique id.
+ * @param entryUUID the parent unique id.
*/
- public void setParentUid(String uid)
+ public void setParentEntryUUID(String entryUUID)
{
- parentUniqueId = uid;
+ parentEntryUUID = entryUUID;
}
/**
* Get the parent unique id of this add msg.
* @return the parent unique id.
*/
- public String getParentUid()
+ public String getParentEntryUUID()
{
- return parentUniqueId;
+ return parentEntryUUID;
}
/**
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/DeleteContext.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/DeleteContext.java
index d36e3a9..4ab21d2 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/DeleteContext.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/DeleteContext.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
+ * Portions copyright 2012 ForgeRock AS.
*/
package org.opends.server.replication.protocol;
@@ -37,10 +38,10 @@
* Creates a new DeleteContext with the provided information.
*
* @param changeNumber The change number of the Delete Operation.
- * @param uid The unique Id of the deleted entry.
+ * @param entryUUID The unique Id of the deleted entry.
*/
- public DeleteContext(ChangeNumber changeNumber, String uid)
+ public DeleteContext(ChangeNumber changeNumber, String entryUUID)
{
- super(changeNumber, uid);
+ super(changeNumber, entryUUID);
}
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/DeleteMsg.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/DeleteMsg.java
index 9a1c734..b65f548 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/DeleteMsg.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/DeleteMsg.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011 ForgeRock AS
+ * Portions Copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.replication.protocol;
@@ -75,11 +75,11 @@
* @param dn The dn with which the message must be created.
* @param changeNumber The change number with which the message must be
* created.
- * @param uid The unique id with which the message must be created.
+ * @param entryUUID The unique id with which the message must be created.
*/
- public DeleteMsg(String dn, ChangeNumber changeNumber, String uid)
+ public DeleteMsg(String dn, ChangeNumber changeNumber, String entryUUID)
{
- super(new DeleteContext(changeNumber, uid), dn);
+ super(new DeleteContext(changeNumber, entryUUID), dn);
}
/**
@@ -124,7 +124,7 @@
if (isSubtreeDelete)
del.addRequestControl(new SubtreeDeleteControl(false));
- DeleteContext ctx = new DeleteContext(getChangeNumber(), getUniqueId());
+ DeleteContext ctx = new DeleteContext(getChangeNumber(), getEntryUUID());
del.setAttachment(SYNCHROCONTEXT, ctx);
return del;
}
@@ -256,7 +256,7 @@
" protocolVersion: " + protocolVersion +
" dn: " + dn +
" changeNumber: " + changeNumber +
- " uniqueId: " + uniqueId +
+ " uniqueId: " + entryUUID +
" assuredFlag: " + assuredFlag;
}
if (protocolVersion >= ProtocolVersion.REPLICATION_PROTOCOL_V2)
@@ -265,7 +265,7 @@
" protocolVersion: " + protocolVersion +
" dn: " + dn +
" changeNumber: " + changeNumber +
- " uniqueId: " + uniqueId +
+ " uniqueId: " + entryUUID +
" assuredFlag: " + assuredFlag +
" assuredMode: " + assuredMode +
" safeDataLevel: " + safeDataLevel;
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/LDAPUpdateMsg.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/LDAPUpdateMsg.java
index 7bac025..0c0cb6e 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/LDAPUpdateMsg.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/LDAPUpdateMsg.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2006-2009 Sun Microsystems, Inc.
- * Portions Copyright 2011 ForgeRock AS
+ * Portions Copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.replication.protocol;
@@ -65,9 +65,9 @@
protected String dn = null;
/**
- * The uniqueId of the entry that was updated.
+ * The entryUUID of the entry that was updated.
*/
- protected String uniqueId;
+ protected String entryUUID;
/**
* Encoded form of the LDAPUpdateMsg.
@@ -98,7 +98,7 @@
{
this.protocolVersion = ProtocolVersion.getCurrentVersion();
this.changeNumber = ctx.getChangeNumber();
- this.uniqueId = ctx.getEntryUid();
+ this.entryUUID = ctx.getEntryUUID();
this.dn = dn;
}
@@ -116,7 +116,7 @@
{
this.protocolVersion = ProtocolVersion.getCurrentVersion();
this.changeNumber = cn;
- this.uniqueId = entryUUID;
+ this.entryUUID = entryUUID;
this.dn = dn;
}
@@ -171,13 +171,13 @@
}
/**
- * Get the Unique Identifier of the entry on which the operation happened.
+ * Get the entryUUID of the entry on which the operation happened.
*
- * @return The Unique Identifier of the entry on which the operation happened.
+ * @return The entryUUID of the entry on which the operation happened.
*/
- public String getUniqueId()
+ public String getEntryUUID()
{
- return uniqueId;
+ return entryUUID;
}
/**
@@ -251,7 +251,7 @@
byte[] byteDn = dn.getBytes("UTF-8");
byte[] changeNumberByte =
this.getChangeNumber().toString().getBytes("UTF-8");
- byte[] byteEntryuuid = getUniqueId().getBytes("UTF-8");
+ byte[] byteEntryuuid = getEntryUUID().getBytes("UTF-8");
/* The message header is stored in the form :
* <operation type><protocol version><changenumber><dn><entryuuid><assured>
@@ -312,7 +312,7 @@
byte[] byteDn = dn.getBytes("UTF-8");
byte[] changeNumberByte =
this.getChangeNumber().toString().getBytes("UTF-8");
- byte[] byteEntryuuid = getUniqueId().getBytes("UTF-8");
+ byte[] byteEntryuuid = getEntryUUID().getBytes("UTF-8");
/* The message header is stored in the form :
* <operation type><changenumber><dn><assured><entryuuid><change>
@@ -503,7 +503,7 @@
/* Read the entryuuid */
length = getNextLength(encodedMsg, pos);
- uniqueId = new String(encodedMsg, pos, length, "UTF-8");
+ entryUUID = new String(encodedMsg, pos, length, "UTF-8");
pos += length + 1;
/* Read the assured information */
@@ -574,7 +574,7 @@
/* read the entryuuid */
length = getNextLength(encodedMsg, pos);
- uniqueId = new String(encodedMsg, pos, length, "UTF-8");
+ entryUUID = new String(encodedMsg, pos, length, "UTF-8");
pos += length + 1;
return pos;
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyContext.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyContext.java
index 0fcdc06..b3fb74a 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyContext.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyContext.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
+ * Portions copyright 2012 ForgeRock AS.
*/
package org.opends.server.replication.protocol;
@@ -39,10 +40,10 @@
* Creates a new Modify Context with the provided parameters.
*
* @param changeNumber The change number of the operation.
- * @param uid the unique Id of the modified entry.
+ * @param entryUUID the unique Id of the modified entry.
*/
- public ModifyContext(ChangeNumber changeNumber, String uid)
+ public ModifyContext(ChangeNumber changeNumber, String entryUUID)
{
- super(changeNumber, uid);
+ super(changeNumber, entryUUID);
}
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyDNMsg.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyDNMsg.java
index 6f0e669..46a9887 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyDNMsg.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyDNMsg.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011 ForgeRock AS
+ * Portions Copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.replication.protocol;
@@ -54,7 +54,7 @@
private String newRDN;
private String newSuperior;
private boolean deleteOldRdn;
- private String newSuperiorId;
+ private String newSuperiorEntryUUID;
/**
* construct a new Modify DN message.
@@ -70,7 +70,7 @@
ModifyDnContext ctx =
(ModifyDnContext) operation.getAttachment(SYNCHROCONTEXT);
- newSuperiorId = ctx.getNewParentId();
+ newSuperiorEntryUUID = ctx.getNewSuperiorEntryUUID();
deleteOldRdn = operation.deleteOldRDN();
if (operation.getRawNewSuperior() != null)
@@ -87,22 +87,22 @@
*
* @param dn The dn to use for building the message.
* @param changeNumber The changeNumberto use for building the message.
- * @param uid The unique id to use for building the message.
- * @param newParentUid The new parent unique id to use for building
+ * @param entryUUID The unique id to use for building the message.
+ * @param newSuperiorEntryUUID The new parent unique id to use for building
* the message.
* @param deleteOldRdn boolean indicating if old rdn must be deleted to use
* for building the message.
* @param newSuperior The new Superior entry to use for building the message.
* @param newRDN The new Rdn to use for building the message.
*/
- public ModifyDNMsg(String dn, ChangeNumber changeNumber, String uid,
- String newParentUid, boolean deleteOldRdn,
+ public ModifyDNMsg(String dn, ChangeNumber changeNumber, String entryUUID,
+ String newSuperiorEntryUUID, boolean deleteOldRdn,
String newSuperior, String newRDN)
{
- super(new ModifyDnContext(changeNumber, uid, newParentUid), dn);
+ super(new ModifyDnContext(changeNumber, entryUUID, newSuperiorEntryUUID),
+ dn);
- newSuperiorId = newParentUid;
-
+ this.newSuperiorEntryUUID = newSuperiorEntryUUID;
this.deleteOldRdn = deleteOldRdn;
this.newSuperior = newSuperior;
this.newRDN = newRDN;
@@ -113,8 +113,8 @@
*
* @param dn The dn to use for building the message.
* @param changeNumber The changeNumberto use for building the message.
- * @param uid The unique id to use for building the message.
- * @param newParentUid The new parent unique id to use for building
+ * @param entryUUID The unique id to use for building the message.
+ * @param newSuperiorEntryUUID The new parent unique id to use for building
* the message.
* @param deleteOldRdn boolean indicating if old rdn must be deleted to use
* for building the message.
@@ -122,12 +122,12 @@
* @param newRDN The new Rdn to use for building the message.
* @param mods The mod of the operation.
*/
- public ModifyDNMsg(String dn, ChangeNumber changeNumber, String uid,
- String newParentUid, boolean deleteOldRdn,
- String newSuperior, String newRDN, List<Modification> mods)
+ public ModifyDNMsg(String dn, ChangeNumber changeNumber, String entryUUID,
+ String newSuperiorEntryUUID, boolean deleteOldRdn, String newSuperior,
+ String newRDN, List<Modification> mods)
{
- this(dn, changeNumber, uid, newParentUid, deleteOldRdn, newSuperior,
- newRDN);
+ this(dn, changeNumber, entryUUID, newSuperiorEntryUUID, deleteOldRdn,
+ newSuperior, newRDN);
this.encodedMods = encodeMods(mods);
}
@@ -181,8 +181,8 @@
moddn.addModification(mod);
}
- ModifyDnContext ctx = new ModifyDnContext(getChangeNumber(), getUniqueId(),
- newSuperiorId);
+ ModifyDnContext ctx = new ModifyDnContext(getChangeNumber(), getEntryUUID(),
+ newSuperiorEntryUUID);
moddn.setAttachment(SYNCHROCONTEXT, ctx);
return moddn;
}
@@ -211,9 +211,9 @@
else
bodyLength += 1;
- if (newSuperiorId != null)
+ if (newSuperiorEntryUUID != null)
{
- byteNewSuperiorId = newSuperiorId.getBytes("UTF-8");
+ byteNewSuperiorId = newSuperiorEntryUUID.getBytes("UTF-8");
bodyLength += byteNewSuperiorId.length + 1;
}
else
@@ -234,7 +234,7 @@
encodedMsg[pos++] = 0;
/* put the newsuperiorId and a terminating 0 */
- if (newSuperiorId != null)
+ if (newSuperiorEntryUUID != null)
{
pos = addByteArray(byteNewSuperiorId, encodedMsg, pos);
}
@@ -273,9 +273,9 @@
else
length += 1;
- if (newSuperiorId != null)
+ if (newSuperiorEntryUUID != null)
{
- byteNewSuperiorId = newSuperiorId.getBytes("UTF-8");
+ byteNewSuperiorId = newSuperiorEntryUUID.getBytes("UTF-8");
length += byteNewSuperiorId.length + 1;
}
else
@@ -300,7 +300,7 @@
encodedMsg[pos++] = 0;
/* put the newsuperiorId and a terminating 0 */
- if (newSuperiorId != null)
+ if (newSuperiorEntryUUID != null)
{
pos = addByteArray(byteNewSuperiorId, encodedMsg, pos);
}
@@ -348,9 +348,9 @@
else
bodyLength += 1;
- if (newSuperiorId != null)
+ if (newSuperiorEntryUUID != null)
{
- byteNewSuperiorId = newSuperiorId.getBytes("UTF-8");
+ byteNewSuperiorId = newSuperiorEntryUUID.getBytes("UTF-8");
bodyLength += byteNewSuperiorId.length + 1;
}
else
@@ -382,7 +382,7 @@
else
encodedMsg[pos++] = 0;
/* put the newsuperiorId and a terminating 0 */
- if (newSuperiorId != null)
+ if (newSuperiorEntryUUID != null)
{
pos = addByteArray(byteNewSuperiorId, encodedMsg, pos);
}
@@ -432,9 +432,9 @@
*/
length = getNextLength(in, pos);
if (length != 0)
- newSuperiorId = new String(in, pos, length, "UTF-8");
+ newSuperiorEntryUUID = new String(in, pos, length, "UTF-8");
else
- newSuperiorId = null;
+ newSuperiorEntryUUID = null;
pos += length + 1;
/* get the deleteoldrdn flag */
@@ -495,9 +495,9 @@
*/
length = getNextLength(in, pos);
if (length != 0)
- newSuperiorId = new String(in, pos, length, "UTF-8");
+ newSuperiorEntryUUID = new String(in, pos, length, "UTF-8");
else
- newSuperiorId = null;
+ newSuperiorEntryUUID = null;
pos += length + 1;
/* get the deleteoldrdn flag */
@@ -563,7 +563,7 @@
" protocolVersion: " + protocolVersion +
" dn: " + dn +
" changeNumber: " + changeNumber +
- " uniqueId: " + uniqueId +
+ " uniqueId: " + entryUUID +
" assuredFlag: " + assuredFlag +
" newRDN: " + newRDN +
" newSuperior: " + newSuperior +
@@ -575,7 +575,7 @@
" protocolVersion: " + protocolVersion +
" dn: " + dn +
" changeNumber: " + changeNumber +
- " uniqueId: " + uniqueId +
+ " uniqueId: " + entryUUID +
" newRDN: " + newRDN +
" newSuperior: " + newSuperior +
" deleteOldRdn: " + deleteOldRdn +
@@ -610,9 +610,9 @@
*
* @return The new superior id.
*/
- public String getNewSuperiorId()
+ public String getNewSuperiorEntryUUID()
{
- return newSuperiorId;
+ return newSuperiorEntryUUID;
}
/**
@@ -630,9 +630,9 @@
*
* @param newSup The new superior id.
*/
- public void setNewSuperiorId(String newSup)
+ public void setNewSuperiorEntryUUID(String newSup)
{
- newSuperiorId = newSup;
+ newSuperiorEntryUUID = newSup;
}
/**
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyDnContext.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyDnContext.java
index f5d6717..1338659 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyDnContext.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyDnContext.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
+ * Portions copyright 2012 ForgeRock AS.
*/
package org.opends.server.replication.protocol;
@@ -34,22 +35,22 @@
*/
public class ModifyDnContext extends OperationContext
{
- private String newParentId;
+ private String newSuperiorEntryUUID;
/**
* Creates a new ModifyDN Context with the provided parameters.
*
* @param changeNumber The change number of the operation.
- * @param uid the unique Id of the modified entry.
- * @param newParentId The unique Identifier of the new parent,
+ * @param entryUUID the unique Id of the modified entry.
+ * @param newSuperiorEntryUUID The unique Identifier of the new parent,
* can be null if the entry is to stay below the same
* parent.
*/
- public ModifyDnContext(ChangeNumber changeNumber, String uid,
- String newParentId)
+ public ModifyDnContext(ChangeNumber changeNumber, String entryUUID,
+ String newSuperiorEntryUUID)
{
- super(changeNumber, uid);
- this.newParentId = newParentId;
+ super(changeNumber, entryUUID);
+ this.newSuperiorEntryUUID = newSuperiorEntryUUID;
}
/**
@@ -58,8 +59,8 @@
*
* @return Returns the unique Identifier of the new parent..
*/
- public String getNewParentId()
+ public String getNewSuperiorEntryUUID()
{
- return newParentId;
+ return newSuperiorEntryUUID;
}
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyMsg.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyMsg.java
index daae6dc..e2ca106 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyMsg.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyMsg.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011 ForgeRock AS
+ * Portions Copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.replication.protocol;
@@ -69,13 +69,13 @@
* @param changeNumber The ChangeNumber for the operation.
* @param dn The baseDN of the operation.
* @param mods The mod of the operation.
- * @param entryuuid The unique id of the entry on which the modification
+ * @param entryUUID The unique id of the entry on which the modification
* needs to apply.
*/
public ModifyMsg(ChangeNumber changeNumber, DN dn, List<Modification> mods,
- String entryuuid)
+ String entryUUID)
{
- super(new ModifyContext(changeNumber, entryuuid),
+ super(new ModifyContext(changeNumber, entryUUID),
dn.toNormalizedString());
this.encodedMods = encodeMods(mods);
}
@@ -146,7 +146,7 @@
InternalClientConnection.nextOperationID(),
InternalClientConnection.nextMessageID(), null,
ByteString.valueOf(newDn), ldapmods);
- ModifyContext ctx = new ModifyContext(getChangeNumber(), getUniqueId());
+ ModifyContext ctx = new ModifyContext(getChangeNumber(), getEntryUUID());
mod.setAttachment(SYNCHROCONTEXT, ctx);
return mod;
@@ -165,7 +165,7 @@
" protocolVersion: " + protocolVersion +
" dn: " + dn +
" changeNumber: " + changeNumber +
- " uniqueId: " + uniqueId +
+ " uniqueId: " + entryUUID +
" assuredFlag: " + assuredFlag;
}
if (protocolVersion >= ProtocolVersion.REPLICATION_PROTOCOL_V2)
@@ -191,7 +191,7 @@
" protocolVersion: " + protocolVersion +
" dn: " + dn +
" changeNumber: " + changeNumber +
- " uniqueId: " + uniqueId +
+ " uniqueId: " + entryUUID +
" assuredFlag: " + assuredFlag +
" assuredMode: " + assuredMode +
" safeDataLevel: " + safeDataLevel +
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/OperationContext.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/OperationContext.java
index 6c2aa96..4185cf1 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/OperationContext.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/OperationContext.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
+ * Portions copyright 2012 ForgeRock AS.
*/
package org.opends.server.replication.protocol;
@@ -49,17 +50,17 @@
/**
* The unique Id of the entry that was modified in the original operation.
*/
- private String entryUid;
+ private String entryUUID;
/**
* Create a new OperationContext.
* @param changeNumber The change number of the operation.
- * @param uid The unique Identifier of the modified entry.
+ * @param entryUUID The unique Identifier of the modified entry.
*/
- protected OperationContext(ChangeNumber changeNumber, String uid)
+ protected OperationContext(ChangeNumber changeNumber, String entryUUID)
{
this.changeNumber = changeNumber;
- this.entryUid = uid;
+ this.entryUUID = entryUUID;
}
/**
@@ -77,9 +78,9 @@
*
* @return the unique Identifier of the modified entry.
*/
- public String getEntryUid()
+ public String getEntryUUID()
{
- return entryUid;
+ return entryUUID;
}
/**
@@ -129,7 +130,7 @@
{
OperationContext ctx = (OperationContext) obj;
return ((this.changeNumber.equals(ctx.getChangeNumber()) &&
- (this.entryUid.equals(ctx.getEntryUid()))));
+ (this.entryUUID.equals(ctx.getEntryUUID()))));
}
else
return false;
@@ -141,7 +142,7 @@
@Override
public int hashCode()
{
- return changeNumber.hashCode() + entryUid.hashCode();
+ return changeNumber.hashCode() + entryUUID.hashCode();
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationBackend.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationBackend.java
index acb95b5..3253baf 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationBackend.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationBackend.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2007-2009 Sun Microsystems, Inc.
- * Portions copyright 2011 ForgeRock AS
+ * Portions copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.replication.server;
import static org.opends.messages.BackendMessages.*;
@@ -871,7 +871,7 @@
AddMsg addMsg = (AddMsg)msg;
AddOperation addOperation = (AddOperation)msg.createOperation(conn);
- dn = DN.decode("puid=" + addMsg.getParentUid() + "+" +
+ dn = DN.decode("puid=" + addMsg.getParentEntryUUID() + "+" +
CHANGE_NUMBER + "=" + msg.getChangeNumber().toString() + "+" +
msg.getDn() + "," + BASE_DN);
@@ -922,7 +922,7 @@
{
DeleteMsg delMsg = (DeleteMsg)msg;
- dn = DN.decode("uuid=" + msg.getUniqueId() + "," +
+ dn = DN.decode("uuid=" + msg.getEntryUUID() + "," +
CHANGE_NUMBER + "=" + delMsg.getChangeNumber().toString()+ "," +
msg.getDn() +","+ BASE_DN);
@@ -945,7 +945,7 @@
{
ModifyOperation op = (ModifyOperation)msg.createOperation(conn);
- dn = DN.decode("uuid=" + msg.getUniqueId() + "," +
+ dn = DN.decode("uuid=" + msg.getEntryUUID() + "," +
CHANGE_NUMBER + "=" + msg.getChangeNumber().toString()+ "," +
msg.getDn() +","+ BASE_DN);
op.setInternalOperation(true);
@@ -969,7 +969,7 @@
{
ModifyDNOperation op = (ModifyDNOperation)msg.createOperation(conn);
- dn = DN.decode("uuid=" + msg.getUniqueId() + "," +
+ dn = DN.decode("uuid=" + msg.getEntryUUID() + "," +
CHANGE_NUMBER + "=" + msg.getChangeNumber().toString()+ "," +
msg.getDn() +","+ BASE_DN);
op.setInternalOperation(true);
diff --git a/opendj-sdk/opends/src/server/org/opends/server/workflowelement/externalchangelog/ECLSearchOperation.java b/opendj-sdk/opends/src/server/org/opends/server/workflowelement/externalchangelog/ECLSearchOperation.java
index c634a62..36dc59f 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/workflowelement/externalchangelog/ECLSearchOperation.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/workflowelement/externalchangelog/ECLSearchOperation.java
@@ -809,7 +809,7 @@
.getCookie().toString(), DN.decode(addMsg.getDn()),
addMsg.getChangeNumber(), ldifChanges, // entry as created (in LDIF
// format)
- addMsg.getUniqueId(),
+ addMsg.getEntryUUID(),
eclAttributes, // entry attributes
eclmsg.getDraftChangeNumber(), "add", changeInitiatorsName);
@@ -876,7 +876,7 @@
clEntry = createChangelogEntry(eclmsg.getServiceId(), eclmsg
.getCookie().toString(), DN.decode(modifyMsg.getDn()),
modifyMsg.getChangeNumber(), ldifChanges,
- modifyMsg.getUniqueId(),
+ modifyMsg.getEntryUUID(),
modifyMsg.getEclIncludes(), // entry attributes
eclmsg.getDraftChangeNumber(), changeType,
changeInitiatorsName);
@@ -909,7 +909,7 @@
.getCookie().toString(), DN.decode(delMsg.getDn()),
delMsg.getChangeNumber(),
null, // no changes
- delMsg.getUniqueId(),
+ delMsg.getEntryUUID(),
delMsg.getEclIncludes(), // entry attributes
eclmsg.getDraftChangeNumber(), "delete",
delMsg.getInitiatorsName());
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java
index df3d396..9832ec3 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011 ForgeRock AS
+ * Portions Copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.replication.plugin;
@@ -144,7 +144,7 @@
long startTime = TimeThread.getTime();
final DN dn1 = DN.decode("cn=test1," + baseDn.toString());
final AttributeType histType =
- DirectoryServer.getAttributeType(EntryHistorical.HISTORICALATTRIBUTENAME);
+ DirectoryServer.getAttributeType(EntryHistorical.HISTORICAL_ATTRIBUTE_NAME);
logError(Message.raw(Category.SYNC, Severity.INFORMATION,
"Starting replication test : changesCmpTest"));
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java
index fb2f6f6..9ef71f5 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011 ForgeRock AS
+ * Portions Copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.replication.plugin;
@@ -511,9 +511,9 @@
assertTrue(addOp.getChangeNumber() != null);
AddMsg addmsg = addOp.generateMessage();
assertTrue(dn1.equals(DN.decode(addmsg.getDn())));
- assertTrue(addmsg.getUniqueId().equals(EntryHistorical.getEntryUuid(entry)));
- String parentId = LDAPReplicationDomain.findEntryId(dn1.getParent());
- assertTrue(addmsg.getParentUid().equals(parentId));
+ assertTrue(addmsg.getEntryUUID().equals(EntryHistorical.getEntryUUID(entry)));
+ String parentId = LDAPReplicationDomain.findEntryUUID(dn1.getParent());
+ assertTrue(addmsg.getParentEntryUUID().equals(parentId));
addmsg.createOperation(InternalClientConnection.getRootConnection());
} else
{
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/ModifyConflictTest.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/ModifyConflictTest.java
index de802f0..2c5e1bd 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/ModifyConflictTest.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/ModifyConflictTest.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011 ForgeRock AS
+ * Portions Copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.replication.plugin;
@@ -1205,7 +1205,7 @@
{
AttributeType entryuuidAttrType =
DirectoryServer.getSchema().getAttributeType(
- EntryHistorical.ENTRYUIDNAME);
+ EntryHistorical.ENTRYUUID_ATTRIBUTE_NAME);
/*
* Objectclass and DN do not have any impact on the modify conflict
@@ -1248,11 +1248,11 @@
EntryHistorical hist, Entry entry)
{
AttributeType entryuuidAttrType =
- DirectoryServer.getSchema().getAttributeType(EntryHistorical.ENTRYUIDNAME);
+ DirectoryServer.getSchema().getAttributeType(EntryHistorical.ENTRYUUID_ATTRIBUTE_NAME);
// Get the historical uuid associated to the entry
// (the one that needs to be tested)
- String uuid = EntryHistorical.getEntryUuid(entry);
+ String uuid = EntryHistorical.getEntryUUID(entry);
// Get the Entry uuid in String format
List<Attribute> uuidAttrs = entry
@@ -1283,7 +1283,7 @@
if (generatedMsg instanceof LDAPUpdateMsg)
{
LDAPUpdateMsg new_name = (LDAPUpdateMsg) generatedMsg;
- assertEquals(new_name.getUniqueId(),uuid);
+ assertEquals(new_name.getEntryUUID(),uuid);
}
@@ -1364,7 +1364,7 @@
{
AttributeType historicalAttrType =
DirectoryServer.getSchema().getAttributeType(
- EntryHistorical.HISTORICALATTRIBUTENAME);
+ EntryHistorical.HISTORICAL_ATTRIBUTE_NAME);
InternalClientConnection aConnection =
InternalClientConnection.getRootConnection();
@@ -1442,11 +1442,11 @@
{
AttributeType entryuuidAttrType =
DirectoryServer.getSchema().getAttributeType(
- EntryHistorical.ENTRYUIDNAME);
+ EntryHistorical.ENTRYUUID_ATTRIBUTE_NAME);
// Get the historical uuid associated to the entry
// (the one that needs to be tested)
- String uuid = EntryHistorical.getEntryUuid(addOp);
+ String uuid = EntryHistorical.getEntryUUID(addOp);
// Get the op uuid in String format
List<Attribute> uuidAttrs = addOp.getOperationalAttributes().get(
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/protocol/ProtocolCompatibilityTest.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/protocol/ProtocolCompatibilityTest.java
index 9793eea..7dd2b85 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/protocol/ProtocolCompatibilityTest.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/protocol/ProtocolCompatibilityTest.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions copyright 2011 ForgeRock AS
+ * Portions copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.replication.protocol;
@@ -268,11 +268,11 @@
assertEquals(newMsg.getVersion(), ProtocolVersion.REPLICATION_PROTOCOL_V1);
// Check fields common to both versions
- assertEquals(newMsg.getUniqueId(), msg.getUniqueId());
+ assertEquals(newMsg.getEntryUUID(), msg.getEntryUUID());
assertEquals(newMsg.getDn(), msg.getDn());
assertEquals(newMsg.getChangeNumber(), msg.getChangeNumber());
assertEquals(newMsg.isAssured(), msg.isAssured());
- assertEquals(newMsg.getParentUid(), msg.getParentUid());
+ assertEquals(newMsg.getParentEntryUUID(), msg.getParentEntryUUID());
// Create an add operation from each message to compare attributes (kept encoded in messages)
Operation op = msg.createOperation(connection, rawDN);
@@ -311,10 +311,10 @@
assertEquals(vlastMsg.getVersion(), REPLICATION_PROTOCOL_VLAST);
// Check we retrieve original VLAST message (VLAST fields)
- assertEquals(msg.getUniqueId(), vlastMsg.getUniqueId());
+ assertEquals(msg.getEntryUUID(), vlastMsg.getEntryUUID());
assertEquals(msg.getDn(), vlastMsg.getDn());
assertEquals(msg.getChangeNumber(), vlastMsg.getChangeNumber());
- assertEquals(msg.getParentUid(), vlastMsg.getParentUid());
+ assertEquals(msg.getParentEntryUUID(), vlastMsg.getParentEntryUUID());
assertEquals(msg.isAssured(), vlastMsg.isAssured());
assertEquals(msg.getAssuredMode(), vlastMsg.getAssuredMode());
assertEquals(msg.getSafeDataLevel(), vlastMsg.getSafeDataLevel());
@@ -420,7 +420,7 @@
assertEquals(newMsg.getVersion(), ProtocolVersion.REPLICATION_PROTOCOL_V1);
// Check fields common to both versions
- assertEquals(newMsg.getUniqueId(), msg.getUniqueId());
+ assertEquals(newMsg.getEntryUUID(), msg.getEntryUUID());
assertEquals(newMsg.getDn(), msg.getDn());
assertEquals(newMsg.getChangeNumber(), msg.getChangeNumber());
assertEquals(newMsg.isAssured(), msg.isAssured());
@@ -447,7 +447,7 @@
assertEquals(vlastMsg.getVersion(), REPLICATION_PROTOCOL_VLAST);
// Check we retrieve original VLAST message (VLAST fields)
- assertEquals(msg.getUniqueId(), vlastMsg.getUniqueId());
+ assertEquals(msg.getEntryUUID(), vlastMsg.getEntryUUID());
assertEquals(msg.getDn(), vlastMsg.getDn());
assertEquals(msg.getChangeNumber(), vlastMsg.getChangeNumber());
assertEquals(msg.isAssured(), vlastMsg.isAssured());
@@ -591,7 +591,7 @@
assertEquals(newv1Msg.getVersion(), ProtocolVersion.REPLICATION_PROTOCOL_V1);
// Check fields common to both versions
- assertEquals(newv1Msg.getUniqueId(), origVlastMsg.getUniqueId());
+ assertEquals(newv1Msg.getEntryUUID(), origVlastMsg.getEntryUUID());
assertEquals(newv1Msg.getDn(), origVlastMsg.getDn());
assertEquals(newv1Msg.getChangeNumber(), origVlastMsg.getChangeNumber());
assertEquals(newv1Msg.isAssured(), origVlastMsg.isAssured());
@@ -634,7 +634,7 @@
assertEquals(generatedVlastMsg.getVersion(), REPLICATION_PROTOCOL_VLAST);
// Check we retrieve original VLAST message (VLAST fields)
- assertEquals(origVlastMsg.getUniqueId(), generatedVlastMsg.getUniqueId());
+ assertEquals(origVlastMsg.getEntryUUID(), generatedVlastMsg.getEntryUUID());
assertEquals(origVlastMsg.getDn(), generatedVlastMsg.getDn());
assertEquals(origVlastMsg.getChangeNumber(), generatedVlastMsg.getChangeNumber());
assertEquals(origVlastMsg.isAssured(), generatedVlastMsg.isAssured());
@@ -783,13 +783,13 @@
assertEquals(newMsg.getVersion(), ProtocolVersion.REPLICATION_PROTOCOL_V1);
// Check fields common to both versions
- assertEquals(newMsg.getUniqueId(), msg.getUniqueId());
+ assertEquals(newMsg.getEntryUUID(), msg.getEntryUUID());
assertEquals(newMsg.getDn(), msg.getDn());
assertEquals(newMsg.getChangeNumber(), msg.getChangeNumber());
assertEquals(newMsg.isAssured(), msg.isAssured());
assertEquals(newMsg.getNewRDN(), msg.getNewRDN());
assertEquals(newMsg.getNewSuperior(), msg.getNewSuperior());
- assertEquals(newMsg.getNewSuperiorId(), msg.getNewSuperiorId());
+ assertEquals(newMsg.getNewSuperiorEntryUUID(), msg.getNewSuperiorEntryUUID());
assertEquals(newMsg.deleteOldRdn(), msg.deleteOldRdn());
// Create a modDn operation from each message to compare fields)
@@ -829,7 +829,7 @@
assertEquals(vlastMsg.getVersion(), REPLICATION_PROTOCOL_VLAST);
// Check we retrieve original VLAST message (VLAST fields)
- assertEquals(msg.getUniqueId(), vlastMsg.getUniqueId());
+ assertEquals(msg.getEntryUUID(), vlastMsg.getEntryUUID());
assertEquals(msg.getDn(), vlastMsg.getDn());
assertEquals(msg.getChangeNumber(), vlastMsg.getChangeNumber());
assertEquals(msg.isAssured(), vlastMsg.isAssured());
@@ -837,7 +837,7 @@
assertEquals(msg.getSafeDataLevel(), vlastMsg.getSafeDataLevel());
assertEquals(msg.getNewRDN(), vlastMsg.getNewRDN());
assertEquals(msg.getNewSuperior(), vlastMsg.getNewSuperior());
- assertEquals(msg.getNewSuperiorId(), vlastMsg.getNewSuperiorId());
+ assertEquals(msg.getNewSuperiorEntryUUID(), vlastMsg.getNewSuperiorEntryUUID());
assertEquals(msg.deleteOldRdn(), vlastMsg.deleteOldRdn());
// Get ECL entry attributes
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/protocol/SynchronizationMsgTest.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/protocol/SynchronizationMsgTest.java
index 53f1a71..b3b2f94 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/protocol/SynchronizationMsgTest.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/protocol/SynchronizationMsgTest.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
- * Portions copyright 2011 ForgeRock AS
+ * Portions copyright 2011-2012 ForgeRock AS
*/
package org.opends.server.replication.protocol;
@@ -295,7 +295,7 @@
assertEquals(msg.getDn(), fakeDN) ;
// Check uuid
- assertEquals(msg.getUniqueId(), generatedMsg.getUniqueId());
+ assertEquals(msg.getEntryUUID(), generatedMsg.getEntryUUID());
// Check assured flag
assertEquals(msg.isAssured(), generatedMsg.isAssured());
@@ -595,7 +595,7 @@
assertEquals(generatedMsg.toString(), msg.toString());
// Test that generated attributes match original attributes.
- assertEquals(generatedMsg.getParentUid(), msg.getParentUid());
+ assertEquals(generatedMsg.getParentEntryUUID(), msg.getParentEntryUUID());
assertEquals(generatedMsg.isAssured(), isAssured);
assertEquals(generatedMsg.getAssuredMode(), assuredMode);
assertEquals(generatedMsg.getSafeDataLevel(), safeDataLevel);
--
Gitblit v1.10.0