Package com.unboundid.ldif
Class LDIFModifyDNChangeRecord
- java.lang.Object
-
- com.unboundid.ldif.LDIFChangeRecord
-
- com.unboundid.ldif.LDIFModifyDNChangeRecord
-
- All Implemented Interfaces:
LDIFRecord,java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class LDIFModifyDNChangeRecord extends LDIFChangeRecord
This class defines an LDIF modify DN change record, which can be used to represent an LDAP modify DN request. See the documentation for theLDIFChangeRecordclass for an example demonstrating the process for interacting with LDIF change records.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LDIFModifyDNChangeRecord(ModifyDNRequest modifyDNRequest)Creates a new LDIF modify DN change record from the provided modify DN request.LDIFModifyDNChangeRecord(java.lang.String dn, java.lang.String newRDN, boolean deleteOldRDN, java.lang.String newSuperiorDN)Creates a new LDIF modify DN change record with the provided information.LDIFModifyDNChangeRecord(java.lang.String dn, java.lang.String newRDN, boolean deleteOldRDN, java.lang.String newSuperiorDN, java.util.List<Control> controls)Creates a new LDIF modify DN change record with the provided information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandeleteOldRDN()Indicates whether to delete the current RDN value from the entry.LDIFModifyDNChangeRecordduplicate(Control... controls)Creates a duplicate of this LDIF change record with the provided set of controls.booleanequals(java.lang.Object o)Indicates whether the provided object is equal to this LDIF change record.ChangeTypegetChangeType()Retrieves the type of operation represented by this LDIF change record.DNgetNewDN()Retrieves the DN that the entry should have after the successful completion of the operation.java.lang.StringgetNewRDN()Retrieves the new RDN value for the entry.java.lang.StringgetNewSuperiorDN()Retrieves the new superior DN for the entry, if applicable.RDNgetParsedNewRDN()Retrieves the parsed new RDN value for the entry.DNgetParsedNewSuperiorDN()Retrieves the parsed new superior DN for the entry, if applicable.inthashCode()Retrieves a hash code for this change record.LDAPResultprocessChange(LDAPInterface connection, boolean includeControls)Apply the change represented by this LDIF change record to a directory server using the provided connection, optionally including any change record controls in the request.java.lang.String[]toLDIF(int wrapColumn)Retrieves a string array whose lines contain an LDIF representation of this change record.voidtoLDIF(ByteStringBuffer buffer, int wrapColumn)Appends an LDIF string representation of this change record to the provided buffer.voidtoLDIFString(java.lang.StringBuilder buffer, int wrapColumn)Appends an LDIF string representation of this change record to the provided buffer.ModifyDNRequesttoModifyDNRequest()Creates a modify DN request from this LDIF modify DN change record.ModifyDNRequesttoModifyDNRequest(boolean includeControls)Creates a modify DN request from this LDIF modify DN change record, optionally including any change record controls in the request.voidtoString(java.lang.StringBuilder buffer)Appends a single-line string representation of this change record to the provided buffer.-
Methods inherited from class com.unboundid.ldif.LDIFChangeRecord
getControls, getDN, getParsedDN, processChange, toLDIF, toLDIF, toLDIFString, toLDIFString, toLDIFString, toString
-
-
-
-
Constructor Detail
-
LDIFModifyDNChangeRecord
public LDIFModifyDNChangeRecord(java.lang.String dn, java.lang.String newRDN, boolean deleteOldRDN, java.lang.String newSuperiorDN)
Creates a new LDIF modify DN change record with the provided information.- Parameters:
dn- The current DN for the entry. It must not benull.newRDN- The new RDN value for the entry. It must not benull.deleteOldRDN- Indicates whether to delete the currentRDN value from the entry.newSuperiorDN- The new superior DN for this LDIF modify DN change record. It may benullif the entry is not to be moved below a new parent.
-
LDIFModifyDNChangeRecord
public LDIFModifyDNChangeRecord(java.lang.String dn, java.lang.String newRDN, boolean deleteOldRDN, java.lang.String newSuperiorDN, java.util.List<Control> controls)
Creates a new LDIF modify DN change record with the provided information.- Parameters:
dn- The current DN for the entry. It must not benull.newRDN- The new RDN value for the entry. It must not benull.deleteOldRDN- Indicates whether to delete the currentRDN value from the entry.newSuperiorDN- The new superior DN for this LDIF modify DN change record. It may benullif the entry is not to be moved below a new parent.controls- The set of controls for this LDIF modify DN change record. It may benullor empty if there are no controls.
-
LDIFModifyDNChangeRecord
public LDIFModifyDNChangeRecord(ModifyDNRequest modifyDNRequest)
Creates a new LDIF modify DN change record from the provided modify DN request.- Parameters:
modifyDNRequest- The modify DN request to use to create this LDIF modify DN change record. It must not benull.
-
-
Method Detail
-
getNewRDN
public java.lang.String getNewRDN()
Retrieves the new RDN value for the entry.- Returns:
- The new RDN value for the entry.
-
getParsedNewRDN
public RDN getParsedNewRDN() throws LDAPException
Retrieves the parsed new RDN value for the entry.- Returns:
- The parsed new RDN value for the entry.
- Throws:
LDAPException- If a problem occurs while trying to parse the new RDN.
-
deleteOldRDN
public boolean deleteOldRDN()
Indicates whether to delete the current RDN value from the entry.- Returns:
trueif the current RDN value should be removed from the entry, orfalseif not.
-
getNewSuperiorDN
public java.lang.String getNewSuperiorDN()
Retrieves the new superior DN for the entry, if applicable.- Returns:
- The new superior DN for the entry, or
nullif the entry is not to be moved below a new parent.
-
getParsedNewSuperiorDN
public DN getParsedNewSuperiorDN() throws LDAPException
Retrieves the parsed new superior DN for the entry, if applicable.- Returns:
- The parsed new superior DN for the entry, or
nullif the entry is not to be moved below a new parent. - Throws:
LDAPException- If a problem occurs while trying to parse the new superior DN.
-
getNewDN
public DN getNewDN() throws LDAPException
Retrieves the DN that the entry should have after the successful completion of the operation.- Returns:
- The DN that the entry should have after the successful completion of the operation.
- Throws:
LDAPException- If a problem occurs while trying to parse the target DN, new RDN, or new superior DN.
-
toModifyDNRequest
public ModifyDNRequest toModifyDNRequest()
Creates a modify DN request from this LDIF modify DN change record. Any change record controls will be included in the request- Returns:
- The modify DN request created from this LDIF modify DN change record.
-
toModifyDNRequest
public ModifyDNRequest toModifyDNRequest(boolean includeControls)
Creates a modify DN request from this LDIF modify DN change record, optionally including any change record controls in the request.- Parameters:
includeControls- Indicates whether to include any controls in the request.- Returns:
- The modify DN request created from this LDIF modify DN change record.
-
getChangeType
public ChangeType getChangeType()
Retrieves the type of operation represented by this LDIF change record.- Specified by:
getChangeTypein classLDIFChangeRecord- Returns:
- The type of operation represented by this LDIF change record.
-
duplicate
public LDIFModifyDNChangeRecord duplicate(Control... controls)
Creates a duplicate of this LDIF change record with the provided set of controls.- Specified by:
duplicatein classLDIFChangeRecord- Parameters:
controls- The set of controls to include in the duplicate change record. It may benullor empty if no controls should be included.- Returns:
- A duplicate of this LDIF change record with the provided set of controls.
-
processChange
public LDAPResult processChange(LDAPInterface connection, boolean includeControls) throws LDAPException
Apply the change represented by this LDIF change record to a directory server using the provided connection, optionally including any change record controls in the request.- Specified by:
processChangein classLDIFChangeRecord- Parameters:
connection- The connection to use to apply the change.includeControls- Indicates whether to include any controls in the request.- Returns:
- An object providing information about the result of the operation.
- Throws:
LDAPException- If an error occurs while processing this change in the associated directory server.
-
toLDIF
public java.lang.String[] toLDIF(int wrapColumn)
Retrieves a string array whose lines contain an LDIF representation of this change record.- Specified by:
toLDIFin interfaceLDIFRecord- Specified by:
toLDIFin classLDIFChangeRecord- Parameters:
wrapColumn- The column at which to wrap long lines. A value that is less than or equal to two indicates that no wrapping should be performed.- Returns:
- A string array whose lines contain an LDIF representation of this change record.
-
toLDIF
public void toLDIF(ByteStringBuffer buffer, int wrapColumn)
Appends an LDIF string representation of this change record to the provided buffer.- Specified by:
toLDIFin interfaceLDIFRecord- Specified by:
toLDIFin classLDIFChangeRecord- Parameters:
buffer- The buffer to which to append an LDIF representation of this change record.wrapColumn- The column at which to wrap long lines. A value that is less than or equal to two indicates that no wrapping should be performed.
-
toLDIFString
public void toLDIFString(java.lang.StringBuilder buffer, int wrapColumn)
Appends an LDIF string representation of this change record to the provided buffer.- Specified by:
toLDIFStringin interfaceLDIFRecord- Specified by:
toLDIFStringin classLDIFChangeRecord- Parameters:
buffer- The buffer to which to append an LDIF representation of this change record.wrapColumn- The column at which to wrap long lines. A value that is less than or equal to two indicates that no wrapping should be performed.
-
hashCode
public int hashCode()
Retrieves a hash code for this change record.- Specified by:
hashCodein classLDIFChangeRecord- Returns:
- A hash code for this change record.
-
equals
public boolean equals(java.lang.Object o)
Indicates whether the provided object is equal to this LDIF change record.- Specified by:
equalsin classLDIFChangeRecord- Parameters:
o- The object for which to make the determination.- Returns:
trueif the provided object is equal to this LDIF change record, orfalseif not.
-
toString
public void toString(java.lang.StringBuilder buffer)
Appends a single-line string representation of this change record to the provided buffer.- Specified by:
toStringin interfaceLDIFRecord- Specified by:
toStringin classLDIFChangeRecord- Parameters:
buffer- The buffer to which the information should be written.
-
-