Package com.unboundid.ldif
Class LDIFAddChangeRecord
- java.lang.Object
-
- com.unboundid.ldif.LDIFChangeRecord
-
- com.unboundid.ldif.LDIFAddChangeRecord
-
- All Implemented Interfaces:
LDIFRecord
,java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class LDIFAddChangeRecord extends LDIFChangeRecord
This class defines an LDIF add change record, which can be used to represent an LDAP add request. See the documentation for theLDIFChangeRecord
class for an example demonstrating the process for interacting with LDIF change records.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LDIFAddChangeRecord(AddRequest addRequest)
Creates a new LDIF add change record from the provided add request.LDIFAddChangeRecord(Entry entry)
Creates a new LDIF add change record from the provided entry.LDIFAddChangeRecord(Entry entry, java.util.List<Control> controls)
Creates a new LDIF add change record from the provided entry.LDIFAddChangeRecord(java.lang.String dn, Attribute... attributes)
Creates a new LDIF add change record with the provided DN and attributes.LDIFAddChangeRecord(java.lang.String dn, Attribute[] attributes, java.util.List<Control> controls)
Creates a new LDIF add change record with the provided DN and attributes.LDIFAddChangeRecord(java.lang.String dn, java.util.List<Attribute> attributes)
Creates a new LDIF add change record with the provided DN and attributes.LDIFAddChangeRecord(java.lang.String dn, java.util.List<Attribute> attributes, java.util.List<Control> controls)
Creates a new LDIF add change record with the provided DN and attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LDIFAddChangeRecord
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.Attribute[]
getAttributes()
Retrieves the set of attributes for this add change record.ChangeType
getChangeType()
Retrieves the type of operation represented by this LDIF change record.Entry
getEntryToAdd()
Retrieves the entry that would be created by this add 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.AddRequest
toAddRequest()
Creates an add request from this LDIF add change record.AddRequest
toAddRequest(boolean includeControls)
Creates an add request from this LDIF add change record, 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.void
toLDIF(ByteStringBuffer buffer, int wrapColumn)
Appends an LDIF string representation of this change record to the provided buffer.void
toLDIFString(java.lang.StringBuilder buffer, int wrapColumn)
Appends an LDIF string representation of this change record to the provided buffer.void
toString(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
-
LDIFAddChangeRecord
public LDIFAddChangeRecord(java.lang.String dn, Attribute... attributes)
Creates a new LDIF add change record with the provided DN and attributes.- Parameters:
dn
- The DN for this LDIF add change record. It must not benull
.attributes
- The set of attributes for this LDIF add change record. It must not benull
or empty.
-
LDIFAddChangeRecord
public LDIFAddChangeRecord(java.lang.String dn, Attribute[] attributes, java.util.List<Control> controls)
Creates a new LDIF add change record with the provided DN and attributes.- Parameters:
dn
- The DN for this LDIF add change record. It must not benull
.attributes
- The set of attributes for this LDIF add change record. It must not benull
or empty.controls
- The set of controls for this LDIF add change record. It may benull
or empty if there are no controls.
-
LDIFAddChangeRecord
public LDIFAddChangeRecord(java.lang.String dn, java.util.List<Attribute> attributes)
Creates a new LDIF add change record with the provided DN and attributes.- Parameters:
dn
- The DN for this LDIF add change record. It must not benull
.attributes
- The set of attributes for this LDIF add change record. It must not benull
or empty.
-
LDIFAddChangeRecord
public LDIFAddChangeRecord(java.lang.String dn, java.util.List<Attribute> attributes, java.util.List<Control> controls)
Creates a new LDIF add change record with the provided DN and attributes.- Parameters:
dn
- The DN for this LDIF add change record. It must not benull
.attributes
- The set of attributes for this LDIF add change record. It must not benull
or empty.controls
- The set of controls for this LDIF add change record. It may benull
or empty if there are no controls.
-
LDIFAddChangeRecord
public LDIFAddChangeRecord(Entry entry)
Creates a new LDIF add change record from the provided entry.- Parameters:
entry
- The entry to use to create this LDIF add change record. It must not benull
.
-
LDIFAddChangeRecord
public LDIFAddChangeRecord(Entry entry, java.util.List<Control> controls)
Creates a new LDIF add change record from the provided entry.- Parameters:
entry
- The entry to use to create this LDIF add change record. It must not benull
.controls
- The set of controls for this LDIF add change record. It may benull
or empty if there are no controls.
-
LDIFAddChangeRecord
public LDIFAddChangeRecord(AddRequest addRequest)
Creates a new LDIF add change record from the provided add request.- Parameters:
addRequest
- The add request to use to create this LDIF add change record. It must not benull
.
-
-
Method Detail
-
getAttributes
public Attribute[] getAttributes()
Retrieves the set of attributes for this add change record.- Returns:
- The set of attributes for this add change record.
-
getEntryToAdd
public Entry getEntryToAdd()
Retrieves the entry that would be created by this add change record.- Returns:
- The entry that would be created by this add change record.
-
toAddRequest
public AddRequest toAddRequest()
Creates an add request from this LDIF add change record. Any controls included in this change record will be included in the request.- Returns:
- The add request created from this LDIF add change record.
-
toAddRequest
public AddRequest toAddRequest(boolean includeControls)
Creates an add request from this LDIF add change record, optionally including any change record controls in the request.- Parameters:
includeControls
- Indicates whether to include any controls in the request.- Returns:
- The add request created from this LDIF add change record.
-
getChangeType
public ChangeType getChangeType()
Retrieves the type of operation represented by this LDIF change record.- Specified by:
getChangeType
in classLDIFChangeRecord
- Returns:
- The type of operation represented by this LDIF change record.
-
duplicate
public LDIFAddChangeRecord duplicate(Control... controls)
Creates a duplicate of this LDIF change record with the provided set of controls.- Specified by:
duplicate
in classLDIFChangeRecord
- Parameters:
controls
- The set of controls to include in the duplicate change record. It may benull
or 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:
processChange
in 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:
toLDIF
in interfaceLDIFRecord
- Specified by:
toLDIF
in 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:
toLDIF
in interfaceLDIFRecord
- Specified by:
toLDIF
in 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:
toLDIFString
in interfaceLDIFRecord
- Specified by:
toLDIFString
in 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:
hashCode
in 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:
equals
in classLDIFChangeRecord
- Parameters:
o
- The object for which to make the determination.- Returns:
true
if the provided object is equal to this LDIF change record, orfalse
if 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:
toString
in interfaceLDIFRecord
- Specified by:
toString
in classLDIFChangeRecord
- Parameters:
buffer
- The buffer to which the information should be written.
-
-