org.opends.server.tools
Class LDAPDelete

java.lang.Object
  extended by org.opends.server.tools.LDAPDelete

public class LDAPDelete
extends java.lang.Object

This class provides a tool that can be used to issue delete requests to the Directory Server.


Constructor Summary
LDAPDelete(java.util.concurrent.atomic.AtomicInteger nextMessageID, java.io.PrintStream out, java.io.PrintStream err)
          Constructor for the LDAPDelete object.
 
Method Summary
static void main(java.lang.String[] args)
          The main method for LDAPDelete tool.
static int mainDelete(java.lang.String[] args)
          Parses the provided command-line arguments and uses that information to run the ldapdelete tool.
static int mainDelete(java.lang.String[] args, boolean initializeServer, java.io.OutputStream outStream, java.io.OutputStream errStream)
          Parses the provided command-line arguments and uses that information to run the ldapdelete tool.
 void readAndExecute(LDAPConnection connection, java.util.ArrayList<java.lang.String> lines, LDAPDeleteOptions deleteOptions)
          Execute the delete request on the specified list of DNs.
 void readAndExecute(LDAPConnection connection, java.io.Reader reader, LDAPDeleteOptions deleteOptions)
          Read the specified DNs from the given reader (file or stdin) and execute the given delete request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDAPDelete

public LDAPDelete(java.util.concurrent.atomic.AtomicInteger nextMessageID,
                  java.io.PrintStream out,
                  java.io.PrintStream err)
Constructor for the LDAPDelete object.

Parameters:
nextMessageID - The next message ID to use for requests.
out - The print stream to use for standard output.
err - The print stream to use for standard error.
Method Detail

readAndExecute

public void readAndExecute(LDAPConnection connection,
                           java.util.ArrayList<java.lang.String> lines,
                           LDAPDeleteOptions deleteOptions)
                    throws java.io.IOException,
                           LDAPException
Execute the delete request on the specified list of DNs.

Parameters:
connection - The connection to use to execute the request.
lines - The list of DNs to delete.
deleteOptions - The constraints to use for this request.
Throws:
java.io.IOException - If a problem occurs while attempting to communicate with the Directory Server.
LDAPException - If the Directory Server returns an error response.

readAndExecute

public void readAndExecute(LDAPConnection connection,
                           java.io.Reader reader,
                           LDAPDeleteOptions deleteOptions)
                    throws java.io.IOException,
                           LDAPException
Read the specified DNs from the given reader (file or stdin) and execute the given delete request.

Parameters:
connection - The connection to use to execute the request.
reader - The reader to read the list of DNs from.
deleteOptions - The constraints to use for this request.
Throws:
java.io.IOException - If a problem occurs while attempting to communicate with the Directory Server.
LDAPException - If the Directory Server returns an error response.

main

public static void main(java.lang.String[] args)
The main method for LDAPDelete tool.

Parameters:
args - The command-line arguments provided to this program.

mainDelete

public static int mainDelete(java.lang.String[] args)
Parses the provided command-line arguments and uses that information to run the ldapdelete tool.

Parameters:
args - The command-line arguments provided to this program.
Returns:
The error code.

mainDelete

public static int mainDelete(java.lang.String[] args,
                             boolean initializeServer,
                             java.io.OutputStream outStream,
                             java.io.OutputStream errStream)
Parses the provided command-line arguments and uses that information to run the ldapdelete tool.

Parameters:
args - The command-line arguments provided to this program.
initializeServer - Indicates whether to initialize the server.
outStream - The output stream to use for standard output, or null if standard output is not needed.
errStream - The output stream to use for standard error, or null if standard error is not needed.
Returns:
The error code.