| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | 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. |
| | |
| | | { |
| | | this.protocolVersion = ProtocolVersion.getCurrentVersion(); |
| | | this.changeNumber = ctx.getChangeNumber(); |
| | | this.uniqueId = ctx.getEntryUid(); |
| | | this.entryUUID = ctx.getEntryUUID(); |
| | | this.dn = dn; |
| | | } |
| | | |
| | |
| | | { |
| | | this.protocolVersion = ProtocolVersion.getCurrentVersion(); |
| | | this.changeNumber = cn; |
| | | this.uniqueId = entryUUID; |
| | | this.entryUUID = entryUUID; |
| | | this.dn = dn; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | 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> |
| | |
| | | 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> |
| | |
| | | |
| | | /* 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 */ |
| | |
| | | |
| | | /* 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; |