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>
public final class ModifyDNMsg extends ModifyCommonMsg
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
Constructors Constructor Description ModifyDNMsg(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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E extends Exception>
voidaccept(UpdateMsgVisitor<E> visitor)
Applies anUpdateMsgVisitor
to thisUpdateMsg
.ModifyDnRequest
createRequest(Dn newDN)
Create a request from this message using the provided DN.boolean
deleteOldRdn()
Get the delete old rdn option.byte[]
getBytesLatest(short protocolVersion)
Get the byte array representation of this message.boolean
getDeleteOldRdn()
Get the delete old rdn option.Rdn
getNewRDN()
Get the new RDN of this operation.Dn
getNewSuperior()
Get the new superior.UUID
getNewSuperiorEntryUUID()
Get the new superior id.void
setDeleteOldRdn(boolean delete)
Set the delete old rdn option.void
setNewRDN(Rdn newRDN)
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.JsonValue
toJson()
Returns the json representation of this update message.String
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 Detail
-
ModifyDNMsg
public ModifyDNMsg(PostOperationModifyDNOperation operation)
-
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 Detail
-
accept
public <E extends Exception> void accept(UpdateMsgVisitor<E> visitor) throws E extends Exception
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.E extends Exception
-
createRequest
public ModifyDnRequest createRequest(Dn newDN) throws IOException
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
public String toString()
- Overrides:
toString
in classLDAPUpdateMsg
-
toJson
public JsonValue 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
public void setNewSuperior(Dn newSuperior)
Set the new superior.- Parameters:
newSuperior
- the new superior.
-
getNewSuperior
public Dn getNewSuperior()
Get the new superior.- Returns:
- The new superior.
-
getNewSuperiorEntryUUID
public UUID 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
public Rdn getNewRDN()
Get the new RDN of this operation.- Returns:
- The new RDN of this operation.
-
setNewRDN
public void setNewRDN(Rdn newRDN)
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.
-
-