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.
| | |
| | | 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); |
| | |
| | | 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; |
| | |
| | | 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"); |
| | |
| | | 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"); |
| | | |
| | |
| | | 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"); |
| | | |
| | |
| | | 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))); |
| | |
| | | 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; |
| | |
| | | * <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(); |
| | |
| | | * <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(); |
| | |
| | | * <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(); |
| | |
| | | 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 = |