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

Jean-Noel Rouvignac
11.58.2013 49f8f06c0fed42adbe430e664c1c47c7e500fde3
OPENDJ-1134 (CR-2355) Introduce a class in replication for encapsulating host+port combinations

Fixed a regression introduced in r9605: It was found by Christophe Sovant with the functional test suite.

Partial revert of r9605:
Using DN.toNormalizedString() should have been only done for replication metadata, not for user data because OpenDJ stores and returns data like provided by users.
4 files modified
13 ■■■■ changed files
opends/src/server/org/opends/server/replication/protocol/AddMsg.java 5 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/LDAPUpdateMsg.java 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/ModifyDNMsg.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/ModifyMsg.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/AddMsg.java
@@ -180,9 +180,8 @@
    AddOperation add =  new AddOperationBasis(connection,
        InternalClientConnection.nextOperationID(),
        InternalClientConnection.nextMessageID(), null,
        ByteString.valueOf(newDN.toNormalizedString()), attr);
    AddContext ctx = new AddContext(getCSN(), getEntryUUID(),
        parentEntryUUID);
        ByteString.valueOf(newDN.toString()), attr);
    AddContext ctx = new AddContext(getCSN(), getEntryUUID(), parentEntryUUID);
    add.setAttachment(SYNCHROCONTEXT, ctx);
    return add;
  }
opends/src/server/org/opends/server/replication/protocol/LDAPUpdateMsg.java
@@ -237,7 +237,7 @@
  public byte[] encodeHeader(byte type, int additionalLength, short version)
    throws UnsupportedEncodingException
  {
    byte[] byteDn = dn.toNormalizedString().getBytes("UTF-8");
    byte[] byteDn = dn.toString().getBytes("UTF-8");
    byte[] csnByte = getCSN().toString().getBytes("UTF-8");
    byte[] byteEntryuuid = getEntryUUID().getBytes("UTF-8");
@@ -297,7 +297,7 @@
  public byte[] encodeHeader_V1(byte type, int additionalLength)
    throws UnsupportedEncodingException
  {
    byte[] byteDn = dn.toNormalizedString().getBytes("UTF-8");
    byte[] byteDn = dn.toString().getBytes("UTF-8");
    byte[] csnByte = getCSN().toString().getBytes("UTF-8");
    byte[] byteEntryuuid = getEntryUUID().getBytes("UTF-8");
opends/src/server/org/opends/server/replication/protocol/ModifyDNMsg.java
@@ -165,7 +165,7 @@
    ModifyDNOperation moddn =  new ModifyDNOperationBasis(connection,
        InternalClientConnection.nextOperationID(),
        InternalClientConnection.nextMessageID(), null,
        ByteString.valueOf(newDN.toNormalizedString()),
        ByteString.valueOf(newDN.toString()),
        ByteString.valueOf(newRDN),
        deleteOldRdn,
        (newSuperior == null ? null : ByteString.valueOf(newSuperior)));
opends/src/server/org/opends/server/replication/protocol/ModifyMsg.java
@@ -137,7 +137,7 @@
    ModifyOperation mod = new ModifyOperationBasis(connection,
        InternalClientConnection.nextOperationID(),
        InternalClientConnection.nextMessageID(), null,
        ByteString.valueOf(newDN.toNormalizedString()), ldapmods);
        ByteString.valueOf(newDN.toString()), ldapmods);
    ModifyContext ctx = new ModifyContext(getCSN(), getEntryUUID());
    mod.setAttachment(SYNCHROCONTEXT, ctx);
    return mod;