Package com.unboundid.ldif
Class LDIFModifyChangeRecord
java.lang.Object
com.unboundid.ldif.LDIFChangeRecord
com.unboundid.ldif.LDIFModifyChangeRecord
- All Implemented Interfaces:
LDIFRecord,Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class LDIFModifyChangeRecord
extends LDIFChangeRecord
This class defines an LDIF modify change record, which can be used to
represent an LDAP modify request. See the documentation for the
LDIFChangeRecord class for an example demonstrating the process for
interacting with LDIF change records.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the system property that will be used to indicate whether to always include a trailing dash after the last change in the LDIF representation of a modify change record. -
Constructor Summary
ConstructorsConstructorDescriptionLDIFModifyChangeRecord(ModifyRequest modifyRequest) Creates a new LDIF modify change record from the provided modify request.LDIFModifyChangeRecord(String dn, Modification... modifications) Creates a new LDIF modify change record with the provided DN and set of modifications.LDIFModifyChangeRecord(String dn, Modification[] modifications, List<Control> controls) Creates a new LDIF modify change record with the provided DN and set of modifications.LDIFModifyChangeRecord(String dn, List<Modification> modifications) Creates a new LDIF modify change record with the provided DN and set of modifications.LDIFModifyChangeRecord(String dn, List<Modification> modifications, List<Control> controls) Creates a new LDIF modify change record with the provided DN and set of modifications. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanIndicates whether the LDIF representation of a modify change record should always include a trailing dash after the last (or only) change.Creates a duplicate of this LDIF change record with the provided set of controls.booleanIndicates whether the provided object is equal to this LDIF change record.Retrieves the type of operation represented by this LDIF change record.Retrieves the set of modifications for this modify change record.inthashCode()Retrieves a hash code for this change record.processChange(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.static voidsetAlwaysIncludeTrailingDash(boolean alwaysIncludeTrailingDash) Specifies whether the LDIF representation of a modify change record should always include a trailing dash after the last (or only) change.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(StringBuilder buffer, int wrapColumn) Appends an LDIF string representation of this change record to the provided buffer.Creates a modify request from this LDIF modify change record.toModifyRequest(boolean includeControls) Creates a modify request from this LDIF modify change record, optionally including any change record controls in the request.voidtoString(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
-
Field Details
-
PROPERTY_ALWAYS_INCLUDE_TRAILING_DASH
The name of the system property that will be used to indicate whether to always include a trailing dash after the last change in the LDIF representation of a modify change record. By default, the dash will always be included.- See Also:
-
-
Constructor Details
-
LDIFModifyChangeRecord
Creates a new LDIF modify change record with the provided DN and set of modifications.- Parameters:
dn- The DN for this LDIF add change record. It must not benull.modifications- The set of modifications for this LDIF modify change record. It must not benullor empty.
-
LDIFModifyChangeRecord
public LDIFModifyChangeRecord(@NotNull String dn, @NotNull Modification[] modifications, @Nullable List<Control> controls) Creates a new LDIF modify change record with the provided DN and set of modifications.- Parameters:
dn- The DN for this LDIF add change record. It must not benull.modifications- The set of modifications for this LDIF modify change record. It must not benullor empty.controls- The set of controls for this LDIF modify change record. It may benullor empty if there are no controls.
-
LDIFModifyChangeRecord
Creates a new LDIF modify change record with the provided DN and set of modifications.- Parameters:
dn- The DN for this LDIF add change record. It must not benull.modifications- The set of modifications for this LDIF modify change record. It must not benullor empty.
-
LDIFModifyChangeRecord
public LDIFModifyChangeRecord(@NotNull String dn, @NotNull List<Modification> modifications, @Nullable List<Control> controls) Creates a new LDIF modify change record with the provided DN and set of modifications.- Parameters:
dn- The DN for this LDIF add change record. It must not benull.modifications- The set of modifications for this LDIF modify change record. It must not benullor empty.controls- The set of controls for this LDIF modify change record. It may benullor empty if there are no controls.
-
LDIFModifyChangeRecord
Creates a new LDIF modify change record from the provided modify request.- Parameters:
modifyRequest- The modify request to use to create this LDIF modify change record. It must not benull.
-
-
Method Details
-
alwaysIncludeTrailingDash
Indicates whether the LDIF representation of a modify change record should always include a trailing dash after the last (or only) change.- Returns:
trueif the LDIF representation of a modify change record should always include a trailing dash after the last (or only) change, orfalseif not.
-
setAlwaysIncludeTrailingDash
Specifies whether the LDIF representation of a modify change record should always include a trailing dash after the last (or only) change.- Parameters:
alwaysIncludeTrailingDash- Indicates whether the LDIF representation of a modify change record should always include a trailing dash after the last (or only) change.
-
getModifications
Retrieves the set of modifications for this modify change record.- Returns:
- The set of modifications for this modify change record.
-
toModifyRequest
Creates a modify request from this LDIF modify change record. Any change record controls will be included in the request- Returns:
- The modify request created from this LDIF modify change record.
-
toModifyRequest
Creates a modify request from this LDIF modify 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 request created from this LDIF modify change record.
-
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
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
@NotNull public LDAPResult processChange(@NotNull 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
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
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
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
Retrieves a hash code for this change record.- Specified by:
hashCodein classLDIFChangeRecord- Returns:
- A hash code for this change record.
-
equals
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
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.
-