com.unboundid.ldif
Class LDIFDeleteChangeRecord

java.lang.Object
  extended by com.unboundid.ldif.LDIFChangeRecord
      extended by com.unboundid.ldif.LDIFDeleteChangeRecord
All Implemented Interfaces:
LDIFRecord, java.io.Serializable

public final class LDIFDeleteChangeRecord
extends LDIFChangeRecord

This class defines an LDIF delete change record, which can be used to represent an LDAP delete request. See the documentation for the LDIFChangeRecord class for an example demonstrating the process for interacting with LDIF change records.

See Also:
Serialized Form

Constructor Summary
LDIFDeleteChangeRecord(DeleteRequest deleteRequest)
          Creates a new LDIF delete change record from the provided delete request.
LDIFDeleteChangeRecord(java.lang.String dn)
          Creates a new LDIF delete change record with the provided DN.
LDIFDeleteChangeRecord(java.lang.String dn, java.util.List<Control> controls)
          Creates a new LDIF delete change record with the provided DN.
 
Method Summary
 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.
 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.
 DeleteRequest toDeleteRequest()
          Creates a delete request from this LDIF delete change record.
 DeleteRequest toDeleteRequest(boolean includeControls)
          Creates a delete request from this LDIF delete change record, optionally including any change record controls in the request.
 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.
 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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LDIFDeleteChangeRecord

public LDIFDeleteChangeRecord(java.lang.String dn)
Creates a new LDIF delete change record with the provided DN.

Parameters:
dn - The DN of the entry to delete. It must not be null.

LDIFDeleteChangeRecord

public LDIFDeleteChangeRecord(java.lang.String dn,
                              java.util.List<Control> controls)
Creates a new LDIF delete change record with the provided DN.

Parameters:
dn - The DN of the entry to delete. It must not be null.
controls - The set of controls for this LDIF delete change record. It may be null or empty if there are no controls.

LDIFDeleteChangeRecord

public LDIFDeleteChangeRecord(DeleteRequest deleteRequest)
Creates a new LDIF delete change record from the provided delete request.

Parameters:
deleteRequest - The delete request to use to create this LDIF delete change record. It must not be null.
Method Detail

toDeleteRequest

public DeleteRequest toDeleteRequest()
Creates a delete request from this LDIF delete change record. Any change record controls will be included in the request

Returns:
The delete request created from this LDIF delete change record.

toDeleteRequest

public DeleteRequest toDeleteRequest(boolean includeControls)
Creates a delete request from this LDIF delete change record, optionally including any change record controls in the request.

Parameters:
includeControls - Indicates whether to include any controls in the request.
Returns:
The delete request created from this LDIF delete change record.

getChangeType

public ChangeType getChangeType()
Retrieves the type of operation represented by this LDIF change record.

Specified by:
getChangeType in class LDIFChangeRecord
Returns:
The type of operation represented by this LDIF change record.

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 class LDIFChangeRecord
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 interface LDIFRecord
Specified by:
toLDIF in class LDIFChangeRecord
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 interface LDIFRecord
Specified by:
toLDIF in class LDIFChangeRecord
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 interface LDIFRecord
Specified by:
toLDIFString in class LDIFChangeRecord
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 class LDIFChangeRecord
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 class LDIFChangeRecord
Parameters:
o - The object for which to make the determination.
Returns:
true if the provided object is equal to this LDIF change record, or false 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 interface LDIFRecord
Specified by:
toString in class LDIFChangeRecord
Parameters:
buffer - The buffer to which the information should be written.