Class ModifyDNMsg
java.lang.Object
org.opends.server.replication.protocol.ReplicationMsg
org.opends.server.replication.protocol.UpdateMsg
org.opends.server.replication.protocol.LDAPUpdateMsg
org.opends.server.replication.protocol.ModifyCommonMsg
org.opends.server.replication.protocol.ModifyDNMsg
- All Implemented Interfaces:
Comparable<UpdateMsg>
Message used to send Modify DN information.
-
Field Summary
Fields inherited from class org.opends.server.replication.protocol.ReplicationMsg
COMPACT_MASK, COMPACT_TYPE_ADD, COMPACT_TYPE_DELETE, COMPACT_TYPE_MODIFY, COMPACT_TYPE_MODIFY_DN, COMPACT_TYPE_REPLICA_OFFLINE, MSG_TYPE_DISK_ENCODING
-
Constructor Summary
ConstructorDescriptionModifyDNMsg
(Dn dn, CSN csn, UUID entryUUID, UUID newSuperiorEntryUUID, boolean deleteOldRdn, Dn newSuperior, Rdn newRDN) Construct a new Modify DN message (no mods).ModifyDNMsg
(Dn dn, CSN csn, UUID entryUUID, UUID newSuperiorEntryUUID, boolean deleteOldRdn, Dn newSuperior, Rdn newRDN, List<Modification> mods) Construct a new Modify DN message (with mods).ModifyDNMsg
(CSN csn, Dn dn, UUID entryUUID, Rdn newRdn, Dn newSuperior, UUID newSuperiorEntryUUID, boolean deleteOldRdn, byte[] encodedMods, byte[] encodedEclIncludes) Creates a new ModifyDN message.ModifyDNMsg
(PostOperationModifyDNOperation operation) Builds a ModifyDNMsg. -
Method Summary
Modifier and TypeMethodDescription<E extends Exception>
voidaccept
(UpdateMsgVisitor<E> visitor) Applies anUpdateMsgVisitor
to thisUpdateMsg
.createRequest
(Dn newDN) Create a request from this message using the provided DN.boolean
Get the delete old rdn option.byte[]
getBytesLatest
(short protocolVersion) Get the byte array representation of this message.boolean
Get the delete old rdn option.Get the new RDN of this operation.Get the new superior.Get the new superior id.void
setDeleteOldRdn
(boolean delete) Set the delete old rdn option.void
Set the new RDN of this operation.void
setNewSuperior
(Dn newSuperior) Set the new superior.int
size()
Return the number of bytes used by this message.toJson()
Returns the json representation of this update message.toString()
Methods inherited from class org.opends.server.replication.protocol.ModifyCommonMsg
appendEncodedMods, getMods, setMods
Methods inherited from class org.opends.server.replication.protocol.LDAPUpdateMsg
appendEclIncludes, createRequest, generateMsg, getBytes, getDN, getEclIncludes, getEntryUUID, setDN, setEclIncludes
Methods inherited from class org.opends.server.replication.protocol.UpdateMsg
compareTo, equals, getBytes, getCSN, getVersion, hashCode
Methods inherited from class org.opends.server.replication.protocol.ReplicationMsg
decodeMsg, isRetryable
-
Constructor Details
-
ModifyDNMsg
Builds a ModifyDNMsg.- Parameters:
operation
- the modify DN operation that will be used to build the ModifyDNMsg
-
ModifyDNMsg
public ModifyDNMsg(Dn dn, CSN csn, UUID entryUUID, UUID newSuperiorEntryUUID, boolean deleteOldRdn, Dn newSuperior, Rdn newRDN) Construct a new Modify DN message (no mods). Note: Keep this constructor version to support already written tests, not using mods.- Parameters:
dn
- The dn to use for building the message.csn
- The CSN to use for building the message.entryUUID
- The unique id to use for building the message.newSuperiorEntryUUID
- The new parent unique id to use for building the message.deleteOldRdn
- boolean indicating if old rdn must be deleted to use for building the message.newSuperior
- The new Superior entry to use for building the message.newRDN
- The new Rdn to use for building the message.
-
ModifyDNMsg
public ModifyDNMsg(Dn dn, CSN csn, UUID entryUUID, UUID newSuperiorEntryUUID, boolean deleteOldRdn, Dn newSuperior, Rdn newRDN, List<Modification> mods) Construct a new Modify DN message (with mods).- Parameters:
dn
- The dn to use for building the message.csn
- The CSNto use for building the message.entryUUID
- The unique id to use for building the message.newSuperiorEntryUUID
- The new parent unique id to use for building the message.deleteOldRdn
- boolean indicating if old rdn must be deleted to use for building the message.newSuperior
- The new Superior entry to use for building the message.newRDN
- The new Rdn to use for building the message.mods
- The mod of the operation.
-
ModifyDNMsg
public ModifyDNMsg(CSN csn, Dn dn, UUID entryUUID, Rdn newRdn, Dn newSuperior, UUID newSuperiorEntryUUID, boolean deleteOldRdn, byte[] encodedMods, byte[] encodedEclIncludes) Creates a new ModifyDN message.- Parameters:
dn
- The dn to use for building the message.csn
- The CSNto use for building the message.entryUUID
- The unique id to use for building the message.newRdn
- The new Rdn to use for building the message.newSuperiorEntryUUID
- The new parent unique id to use for building the message.deleteOldRdn
- boolean indicating if old rdn must be deleted to use for building the message.newSuperior
- The new Superior entry to use for building the message.encodedMods
- The encodedMods of the operation.encodedEclIncludes
- The encodedEclIncludes of the operation.
-
-
Method Details
-
accept
Description copied from class:UpdateMsg
Applies anUpdateMsgVisitor
to thisUpdateMsg
.- Specified by:
accept
in classUpdateMsg
- Type Parameters:
E
- The type of the exception thrown by the visitor method if it fails, orNeverThrowsException
if the visitor cannot fail.- Parameters:
visitor
- The message visitor.- Throws:
E
- If the visitor failed.
-
createRequest
Description copied from class:LDAPUpdateMsg
Create a request from this message using the provided DN.- Specified by:
createRequest
in classLDAPUpdateMsg
- Parameters:
newDN
- the DN to use when creating the request.- Returns:
- the created request
- Throws:
LdapException
- In case of LDAP decoding exceptionIOException
- In case of ASN1 decoding exception
-
getBytesLatest
public byte[] getBytesLatest(short protocolVersion) Description copied from class:LDAPUpdateMsg
Get the byte array representation of this message.This uses the provided version number which must be at least version 4.
- Specified by:
getBytesLatest
in classLDAPUpdateMsg
- Parameters:
protocolVersion
- the actual protocol version to encode into- Returns:
- The byte array representation of this Message.
-
toString
- Overrides:
toString
in classLDAPUpdateMsg
-
toJson
Description copied from class:UpdateMsg
Returns the json representation of this update message.- Overrides:
toJson
in classLDAPUpdateMsg
- Returns:
- The json representation of this update message.
-
setNewSuperior
Set the new superior.- Parameters:
newSuperior
- the new superior.
-
getNewSuperior
Get the new superior.- Returns:
- The new superior.
-
getNewSuperiorEntryUUID
Get the new superior id.- Returns:
- The new superior id.
-
deleteOldRdn
public boolean deleteOldRdn()Get the delete old rdn option.- Returns:
- The delete old rdn option.
-
setDeleteOldRdn
public void setDeleteOldRdn(boolean delete) Set the delete old rdn option.- Parameters:
delete
- The delete old rdn option.
-
getDeleteOldRdn
public boolean getDeleteOldRdn()Get the delete old rdn option.- Returns:
- true if delete old rdn option
-
getNewRDN
Get the new RDN of this operation.- Returns:
- The new RDN of this operation.
-
setNewRDN
Set the new RDN of this operation.- Parameters:
newRDN
- the new RDN of this operation.
-
size
public int size()Description copied from class:UpdateMsg
Return the number of bytes used by this message.- Specified by:
size
in classLDAPUpdateMsg
- Returns:
- The number of bytes used by this message.
-