org.apache.ldap.clients
Class LdapAdd

java.lang.Object
  extended by org.apache.ldap.clients.LdapBind
      extended by org.apache.ldap.clients.LdapAdd

public class LdapAdd
extends LdapBind

Ldap client for the ADD operation


Constructor Summary
LdapAdd(java.lang.String[] args)
          Create the instance of the add client and parse the command line arguments
 
Method Summary
 void add(java.lang.StringBuffer buf, int msgId)
          Prepare the LDIF entry and send it to the encoder, then wait for a reponse from the LDAP server on the results of the operation.
 java.io.InputStream getStream()
          Get the inputStream to read the LDIF entries from.
static void main(java.lang.String[] args)
          The main method of the Modify client.
 void parseInput(java.io.InputStream inputStream)
          Parse the input from the InputStream.
 
Methods inherited from class org.apache.ldap.clients.LdapBind
bind, connect, disconnect, enableLogging, getDecoder, getEncoder, getIn, getLog, getModule, getOpts, getOut, getSocket, setDecoder, setEncoder, setIn, setLog, setModule, setOpts, setOut, setSocket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapAdd

public LdapAdd(java.lang.String[] args)
Create the instance of the add client and parse the command line arguments

Parameters:
args - Command line arguments
Method Detail

getStream

public java.io.InputStream getStream()
Get the inputStream to read the LDIF entries from. This will either be a file or STDIN based in the command line arguments

Returns:
returns The inputStream to read LDIF entries from

parseInput

public void parseInput(java.io.InputStream inputStream)
Parse the input from the InputStream. For each LDIF entry found pass it to the modify method for processing. This will only segragate different entries, it won't breakdown the individual entries. There is a separate LDIF parsing class for that.

Parameters:
stream - The input stream to read the LDIF entries from

add

public void add(java.lang.StringBuffer buf,
                int msgId)
Prepare the LDIF entry and send it to the encoder, then wait for a reponse from the LDAP server on the results of the operation.

Parameters:
a_buf - The string buffer that contain the LDIF entry
msgId - message id number

main

public static void main(java.lang.String[] args)
The main method of the Modify client.

Parameters:
a_args - Command line arguments