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

Jean-Noel Rouvignac
26.22.2013 0472508ea9c57e77d90b7a67ce9f161e6d7965f2
OPENDJ-1134 (CR-2355) Introduce a class in replication for encapsulating host+port combinations

*Msg.java:
Used DN.toNormalizedString() instead of DN.toString() for better perfs.
9 files modified
22 ■■■■ changed files
opends/src/server/org/opends/server/replication/protocol/AddMsg.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/InitializeRequestMsg.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/InitializeTargetMsg.java 2 ●●● 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/ReplServerStartDSMsg.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/ReplServerStartMsg.java 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/ServerStartMsg.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/AddMsg.java
@@ -180,7 +180,7 @@
    AddOperation add =  new AddOperationBasis(connection,
        InternalClientConnection.nextOperationID(),
        InternalClientConnection.nextMessageID(), null,
        ByteString.valueOf(newDN.toString()), attr);
        ByteString.valueOf(newDN.toNormalizedString()), attr);
    AddContext ctx = new AddContext(getCSN(), getEntryUUID(),
        parentEntryUUID);
    add.setAttachment(SYNCHROCONTEXT, ctx);
opends/src/server/org/opends/server/replication/protocol/InitializeRequestMsg.java
@@ -136,7 +136,7 @@
  public byte[] getBytes(short version)
  {
    try {
      byte[] baseDNBytes = baseDN.toString().getBytes("UTF-8");
      byte[] baseDNBytes = baseDN.toNormalizedString().getBytes("UTF-8");
      byte[] senderBytes = String.valueOf(senderID).getBytes("UTF-8");
      byte[] destinationBytes = String.valueOf(destination).getBytes("UTF-8");
      byte[] initWindowBytes = null;
opends/src/server/org/opends/server/replication/protocol/InitializeTargetMsg.java
@@ -196,7 +196,7 @@
    try
    {
      byte[] byteDestination = String.valueOf(destination).getBytes("UTF-8");
      byte[] byteDn = baseDN.toString().getBytes("UTF-8");
      byte[] byteDn = baseDN.toNormalizedString().getBytes("UTF-8");
      byte[] byteSender = String.valueOf(senderID).getBytes("UTF-8");
      byte[] byteRequestor = String.valueOf(requestorID).getBytes("UTF-8");
      byte[] byteEntryCount = String.valueOf(entryCount).getBytes("UTF-8");
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.toString().getBytes("UTF-8");
    byte[] byteDn = dn.toNormalizedString().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.toString().getBytes("UTF-8");
    byte[] byteDn = dn.toNormalizedString().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.toString()),
        ByteString.valueOf(newDN.toNormalizedString()),
        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.toString()), ldapmods);
        ByteString.valueOf(newDN.toNormalizedString()), ldapmods);
    ModifyContext ctx = new ModifyContext(getCSN(), getEntryUUID());
    mod.setAttachment(SYNCHROCONTEXT, ctx);
    return mod;
opends/src/server/org/opends/server/replication/protocol/ReplServerStartDSMsg.java
@@ -261,7 +261,7 @@
     * <degradedStatusThreshold><weight><connectedDSNumber>
     * <serverState>
     */
    byte[] byteDn = baseDN.toString().getBytes("UTF-8");
    byte[] byteDn = baseDN.toNormalizedString().getBytes("UTF-8");
    byte[] byteServerId = String.valueOf(serverId).getBytes("UTF-8");
    byte[] byteServerUrl = serverURL.getBytes("UTF-8");
    byte[] byteServerState = serverState.getBytes();
opends/src/server/org/opends/server/replication/protocol/ReplServerStartMsg.java
@@ -325,7 +325,7 @@
     * <degradedStatusThreshold><serverState>
     */
    byte[] byteDn = baseDN.toString().getBytes("UTF-8");
    byte[] byteDn = baseDN.toNormalizedString().getBytes("UTF-8");
    byte[] byteServerId = String.valueOf(serverId).getBytes("UTF-8");
    byte[] byteServerUrl = serverURL.getBytes("UTF-8");
    byte[] byteServerState = serverState.getBytes();
@@ -446,7 +446,7 @@
     * <operation type><basedn><serverid><serverURL><windowsize><serverState>
     */
    try {
      byte[] byteDn = baseDN.toString().getBytes("UTF-8");
      byte[] byteDn = baseDN.toNormalizedString().getBytes("UTF-8");
      byte[] byteServerId = String.valueOf(serverId).getBytes("UTF-8");
      byte[] byteServerUrl = serverURL.getBytes("UTF-8");
      byte[] byteServerState = serverState.getBytes();
opends/src/server/org/opends/server/replication/protocol/ServerStartMsg.java
@@ -292,7 +292,7 @@
  public byte[] getBytes(short sessionProtocolVersion)
  {
    try {
      byte[] byteDn = baseDN.toString().getBytes("UTF-8");
      byte[] byteDn = baseDN.toNormalizedString().getBytes("UTF-8");
      byte[] byteServerId = String.valueOf(serverId).getBytes("UTF-8");
      byte[] byteServerUrl = serverURL.getBytes("UTF-8");
      byte[] byteMaxRecvDelay =