@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class LDIFModifyChangeRecord extends LDIFChangeRecord
LDIFChangeRecord
class for an example demonstrating the process for
interacting with LDIF change records.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
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.
|
Constructor and Description |
---|
LDIFModifyChangeRecord(ModifyRequest modifyRequest)
Creates a new LDIF modify change record from the provided modify request.
|
LDIFModifyChangeRecord(java.lang.String dn,
java.util.List<Modification> modifications)
Creates a new LDIF modify change record with the provided DN and set of
modifications.
|
LDIFModifyChangeRecord(java.lang.String dn,
java.util.List<Modification> modifications,
java.util.List<Control> controls)
Creates a new LDIF modify change record with the provided DN and set of
modifications.
|
LDIFModifyChangeRecord(java.lang.String dn,
Modification... modifications)
Creates a new LDIF modify change record with the provided DN and set of
modifications.
|
LDIFModifyChangeRecord(java.lang.String dn,
Modification[] modifications,
java.util.List<Control> controls)
Creates a new LDIF modify change record with the provided DN and set of
modifications.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
alwaysIncludeTrailingDash()
Indicates whether the LDIF representation of a modify change record should
always include a trailing dash after the last (or only) change.
|
LDIFModifyChangeRecord |
duplicate(Control... controls)
Creates a duplicate of this LDIF change record with the provided set of
controls.
|
boolean |
equals(java.lang.Object o)
Indicates whether the provided object is equal to this LDIF change record.
|
ChangeType |
getChangeType()
Retrieves the type of operation represented by this LDIF change record.
|
Modification[] |
getModifications()
Retrieves the set of modifications for this modify change record.
|
int |
hashCode()
Retrieves a hash code for this change record.
|
LDAPResult |
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 void |
setAlwaysIncludeTrailingDash(boolean alwaysIncludeTrailingDash)
Specifies whether the LDIF representation of a modify change record should
always include a trailing dash after the last (or only) change.
|
void |
toLDIF(ByteStringBuffer buffer,
int wrapColumn)
Appends an LDIF string representation of this change record to the provided
buffer.
|
java.lang.String[] |
toLDIF(int wrapColumn)
Retrieves a string array whose lines contain an LDIF representation of this
change record.
|
void |
toLDIFString(java.lang.StringBuilder buffer,
int wrapColumn)
Appends an LDIF string representation of this change record to the provided
buffer.
|
ModifyRequest |
toModifyRequest()
Creates a modify request from this LDIF modify change record.
|
ModifyRequest |
toModifyRequest(boolean includeControls)
Creates a modify request from this LDIF modify change record, optionally
including any change record controls in the request.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a single-line string representation of this change record to the
provided buffer.
|
getControls, getDN, getParsedDN, processChange, toLDIF, toLDIF, toLDIFString, toLDIFString, toLDIFString, toString
@NotNull public static final java.lang.String PROPERTY_ALWAYS_INCLUDE_TRAILING_DASH
public LDIFModifyChangeRecord(@NotNull java.lang.String dn, @NotNull Modification... modifications)
dn
- The DN for this LDIF add change record. It must not
be null
.modifications
- The set of modifications for this LDIF modify change
record. It must not be null
or empty.public LDIFModifyChangeRecord(@NotNull java.lang.String dn, @NotNull Modification[] modifications, @Nullable java.util.List<Control> controls)
dn
- The DN for this LDIF add change record. It must not
be null
.modifications
- The set of modifications for this LDIF modify change
record. It must not be null
or empty.controls
- The set of controls for this LDIF modify change
record. It may be null
or empty if there
are no controls.public LDIFModifyChangeRecord(@NotNull java.lang.String dn, @NotNull java.util.List<Modification> modifications)
dn
- The DN for this LDIF add change record. It must not
be null
.modifications
- The set of modifications for this LDIF modify change
record. It must not be null
or empty.public LDIFModifyChangeRecord(@NotNull java.lang.String dn, @NotNull java.util.List<Modification> modifications, @Nullable java.util.List<Control> controls)
dn
- The DN for this LDIF add change record. It must not
be null
.modifications
- The set of modifications for this LDIF modify change
record. It must not be null
or empty.controls
- The set of controls for this LDIF modify change
record. It may be null
or empty if there
are no controls.public LDIFModifyChangeRecord(@NotNull ModifyRequest modifyRequest)
modifyRequest
- The modify request to use to create this LDIF modify
change record. It must not be null
.public static boolean alwaysIncludeTrailingDash()
true
if the LDIF representation of a modify change record
should always include a trailing dash after the last (or only)
change, or false
if not.public static void setAlwaysIncludeTrailingDash(boolean alwaysIncludeTrailingDash)
alwaysIncludeTrailingDash
- Indicates whether the LDIF
representation of a modify change record
should always include a trailing dash
after the last (or only) change.@NotNull public Modification[] getModifications()
@NotNull public ModifyRequest toModifyRequest()
@NotNull public ModifyRequest toModifyRequest(boolean includeControls)
includeControls
- Indicates whether to include any controls in the
request.@NotNull public ChangeType getChangeType()
getChangeType
in class LDIFChangeRecord
@NotNull public LDIFModifyChangeRecord duplicate(@Nullable Control... controls)
duplicate
in class LDIFChangeRecord
controls
- The set of controls to include in the duplicate change
record. It may be null
or empty if no controls
should be included.@NotNull public LDAPResult processChange(@NotNull LDAPInterface connection, boolean includeControls) throws LDAPException
processChange
in class LDIFChangeRecord
connection
- The connection to use to apply the change.includeControls
- Indicates whether to include any controls in the
request.LDAPException
- If an error occurs while processing this change
in the associated directory server.@NotNull public java.lang.String[] toLDIF(int wrapColumn)
toLDIF
in interface LDIFRecord
toLDIF
in class LDIFChangeRecord
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.public void toLDIF(@NotNull ByteStringBuffer buffer, int wrapColumn)
toLDIF
in interface LDIFRecord
toLDIF
in class LDIFChangeRecord
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.public void toLDIFString(@NotNull java.lang.StringBuilder buffer, int wrapColumn)
toLDIFString
in interface LDIFRecord
toLDIFString
in class LDIFChangeRecord
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.public int hashCode()
hashCode
in class LDIFChangeRecord
public boolean equals(@Nullable java.lang.Object o)
equals
in class LDIFChangeRecord
o
- The object for which to make the determination.true
if the provided object is equal to this LDIF change
record, or false
if not.public void toString(@NotNull java.lang.StringBuilder buffer)
toString
in interface LDIFRecord
toString
in class LDIFChangeRecord
buffer
- The buffer to which the information should be written.