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)Builds a ModifyDNMsg.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E extends Exception>
voidaccept(UpdateMsgVisitor<E> visitor)Applies anUpdateMsgVisitorto thisUpdateMsg.ModifyDnRequestcreateRequest(Dn newDN)Create a request from this message using the provided DN.booleandeleteOldRdn()Get the delete old rdn option.byte[]getBytesLatest(short protocolVersion)Get the byte array representation of this message.booleangetDeleteOldRdn()Get the delete old rdn option.RdngetNewRDN()Get the new RDN of this operation.DngetNewSuperior()Get the new superior.UUIDgetNewSuperiorEntryUUID()Get the new superior id.voidsetDeleteOldRdn(boolean delete)Set the delete old rdn option.voidsetNewRDN(Rdn newRDN)Set the new RDN of this operation.voidsetNewSuperior(Dn newSuperior)Set the new superior.intsize()Return the number of bytes used by this message.JsonValuetoJson()Returns the json representation of this update message.StringtoString()-
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)
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 Detail
-
accept
public <E extends Exception> void accept(UpdateMsgVisitor<E> visitor) throws E extends Exception
Description copied from class:UpdateMsgApplies anUpdateMsgVisitorto thisUpdateMsg.- Specified by:
acceptin classUpdateMsg- Type Parameters:
E- The type of the exception thrown by the visitor method if it fails, orNeverThrowsExceptionif 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:LDAPUpdateMsgCreate a request from this message using the provided DN.- Specified by:
createRequestin 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:LDAPUpdateMsgGet the byte array representation of this message.This uses the provided version number which must be at least version 4.
- Specified by:
getBytesLatestin classLDAPUpdateMsg- Parameters:
protocolVersion- the actual protocol version to encode into- Returns:
- The byte array representation of this Message.
-
toString
public String toString()
- Overrides:
toStringin classLDAPUpdateMsg
-
toJson
public JsonValue toJson()
Description copied from class:UpdateMsgReturns the json representation of this update message.- Overrides:
toJsonin 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:UpdateMsgReturn the number of bytes used by this message.- Specified by:
sizein classLDAPUpdateMsg- Returns:
- The number of bytes used by this message.
-
-