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 class ModifyDNMsg extends ModifyCommonMsg
Message used to send Modify DN information.
-
-
Field Summary
-
Fields inherited from class org.opends.server.replication.protocol.ModifyCommonMsg
encodedMods
-
Fields inherited from class org.opends.server.replication.protocol.LDAPUpdateMsg
bytes, dn, encodedEclIncludes, entryUUID
-
Fields inherited from class org.opends.server.replication.protocol.UpdateMsg
assuredFlag, assuredMode, csn, protocolVersion, safeDataLevel
-
Fields inherited from class org.opends.server.replication.protocol.ReplicationMsg
MSG_TYPE_DISK_ENCODING
-
-
Constructor Summary
Constructors Constructor Description ModifyDNMsg(DN dn, CSN csn, String entryUUID, String newSuperiorEntryUUID, boolean deleteOldRdn, String newSuperior, String newRDN)Construct a new Modify DN message (no mods).ModifyDNMsg(DN dn, CSN csn, String entryUUID, String newSuperiorEntryUUID, boolean deleteOldRdn, String newSuperior, String newRDN, List<Modification> mods)Construct a new Modify DN message (with mods).ModifyDNMsg(PostOperationModifyDNOperation operation)Construct a new Modify DN message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModifyDNOperationcreateOperation(InternalClientConnection connection, DN newDN)Create and Operation from the message using the provided DN.booleandeleteOldRdn()Get the delete old rdn option.byte[]getBytes_V1()Get the byte array representation of this message.byte[]getBytes_V23()Get the byte array representation of this message.byte[]getBytes_V45(short protocolVersion)Get the byte array representation of this message.booleangetDeleteOldRdn()Get the delete old rdn option.StringgetNewRDN()Get the new RDN of this operation.StringgetNewSuperior()Get the new superior.StringgetNewSuperiorEntryUUID()Get the new superior id.booleannewDNIsEqual(DN targetDN)Check if the new dn of this ModifyDNMsg is the same as the targetDN given in parameter.booleannewDNIsParent(DN targetDn)Check if this MSG will change the DN of the target entry to be the same as the dn given as a parameter.booleannewParentIsEqual(DN targetDN)Check if the new parent of the modifyDNMsg is the same as the targetDN given in parameter.voidsetDeleteOldRdn(boolean delete)Set the delete old rdn option.voidsetNewRDN(String newRDN)Set the new RDN of this operation.voidsetNewSuperior(String string)Set the new superior.voidsetNewSuperiorEntryUUID(String newSup)Set the new superior id.intsize()Return the number of bytes used by this message.StringtoString()-
Methods inherited from class org.opends.server.replication.protocol.ModifyCommonMsg
decodeMods, decodeRawMods, encodeMods, getMods, setMods
-
Methods inherited from class org.opends.server.replication.protocol.LDAPUpdateMsg
createOperation, encode, encodeHeader, generateMsg, getBytes, getDN, getEclIncludes, getEntryUUID, headerSize, setDN, setEclIncludes
-
Methods inherited from class org.opends.server.replication.protocol.UpdateMsg
compareTo, contributesToDomainState, decodeHeader, equals, getAssuredMode, getBytes, getCSN, getPayload, getSafeDataLevel, getVersion, hashCode, isAssured, setAssured, setAssuredMode, setSafeDataLevel
-
Methods inherited from class org.opends.server.replication.protocol.ReplicationMsg
generateMsg, isEncodableFor
-
-
-
-
Constructor Detail
-
ModifyDNMsg
public ModifyDNMsg(PostOperationModifyDNOperation operation)
Construct a new Modify DN message.- Parameters:
operation- The operation to use for building the message
-
ModifyDNMsg
public ModifyDNMsg(DN dn, CSN csn, String entryUUID, String newSuperiorEntryUUID, boolean deleteOldRdn, String newSuperior, String 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, String entryUUID, String newSuperiorEntryUUID, boolean deleteOldRdn, String newSuperior, String 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.
-
-
Method Detail
-
createOperation
public ModifyDNOperation createOperation(InternalClientConnection connection, DN newDN) throws LDAPException, IOException
Description copied from class:LDAPUpdateMsgCreate and Operation from the message using the provided DN.- Specified by:
createOperationin classLDAPUpdateMsg- Parameters:
connection- connection to use when creating the message.newDN- the DN to use when creating the operation.- Returns:
- the created Operation.
- Throws:
LDAPException- In case of LDAP decoding exception.IOException- In case of ASN1 decoding exception.
-
getBytes_V1
public byte[] getBytes_V1()
Description copied from class:LDAPUpdateMsgGet the byte array representation of this message. This uses the version 1 of the replication protocol (used for compatibility purpose).- Specified by:
getBytes_V1in classLDAPUpdateMsg- Returns:
- The byte array representation of this message.
-
getBytes_V23
public byte[] getBytes_V23()
Description copied from class:LDAPUpdateMsgGet the byte array representation of this message. This uses the version 2 of the replication protocol (used for compatibility purpose).- Specified by:
getBytes_V23in classLDAPUpdateMsg- Returns:
- The byte array representation of this message.
-
getBytes_V45
public byte[] getBytes_V45(short protocolVersion)
Description copied from class:LDAPUpdateMsgGet the byte array representation of this message. This uses the provided version number which must be version 4 or newer.- Specified by:
getBytes_V45in classLDAPUpdateMsg- Parameters:
protocolVersion- the actual protocol version to encode into- Returns:
- The byte array representation of this Message.
-
setNewSuperior
public void setNewSuperior(String string)
Set the new superior.- Parameters:
string- the new superior.
-
getNewSuperior
public String getNewSuperior()
Get the new superior.- Returns:
- The new superior.
-
getNewSuperiorEntryUUID
public String 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.
-
setNewSuperiorEntryUUID
public void setNewSuperiorEntryUUID(String newSup)
Set the new superior id.- Parameters:
newSup- The new superior id.
-
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 String getNewRDN()
Get the new RDN of this operation.- Returns:
- The new RDN of this operation.
-
setNewRDN
public void setNewRDN(String newRDN)
Set the new RDN of this operation.- Parameters:
newRDN- the new RDN of this operation.
-
newDNIsParent
public boolean newDNIsParent(DN targetDn)
Check if this MSG will change the DN of the target entry to be the same as the dn given as a parameter.- Parameters:
targetDn- the DN to use when checking if this MSG will change the DN of the entry to a given DN.- Returns:
- A boolean indicating if the modify DN MSG will change the DN of the target entry to be the same as the dn given as a parameter.
-
newDNIsEqual
public boolean newDNIsEqual(DN targetDN)
Check if the new dn of this ModifyDNMsg is the same as the targetDN given in parameter.- Parameters:
targetDN- The targetDN to use to check for equality.- Returns:
- A boolean indicating if the targetDN if the same as the new DN of the ModifyDNMsg.
-
newParentIsEqual
public boolean newParentIsEqual(DN targetDN)
Check if the new parent of the modifyDNMsg is the same as the targetDN given in parameter.- Parameters:
targetDN- the targetDN to use when checking equality.- Returns:
- A boolean indicating if the new parent of the modifyDNMsg is the same as the targetDN.
-
size
public int size()
Description copied from class:LDAPUpdateMsgReturn the number of bytes used by this message.- Specified by:
sizein classLDAPUpdateMsg- Returns:
- The number of bytes used by this message.
-
-