org.apache.ldap.clients
Class LdapSearch

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

public class LdapSearch
extends LdapBind

Ldap client for the Search operation


Constructor Summary
LdapSearch(java.lang.String[] args)
          Create an instance of the search client and parse the command line arguments
 
Method Summary
static void main(java.lang.String[] args)
          The main will call trhe bind operation first.
 void printAttributeList(javax.naming.NamingEnumeration a_attributeList)
          Print each attribute and the values for each attribute from the list passed into the method.
 void printAttributeNames(javax.naming.NamingEnumeration a_attributeList)
          Print each attribute name only.
 java.lang.String requestToString(SearchRequest a_request)
           
 void search(int id)
          Create the Search Request encoded message and send it to the server, then process each response from the server
 
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

LdapSearch

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

Parameters:
args - Command line arguments
Method Detail

requestToString

public java.lang.String requestToString(SearchRequest a_request)

printAttributeNames

public void printAttributeNames(javax.naming.NamingEnumeration a_attributeList)
Print each attribute name only. This is used when the Types Only mode is selected from the command line options

Parameters:
a_attributeList - NamingEnumeration of Attributes

printAttributeList

public void printAttributeList(javax.naming.NamingEnumeration a_attributeList)
Print each attribute and the values for each attribute from the list passed into the method. Each attribute has an ID, which is the name of the attribute and a list of values. This is the default method for the search client output. Each value of the same attribute will also print the ID, for example an entry with two value for objectclass will look like this: ou=unix,ou=People,dc=fl,dc=wellspringres,dc=com objectClass=top objectClass=organizationalunit ou=unix

Parameters:
a_attributeList - NamingEnumeration of Attributes

search

public void search(int id)
Create the Search Request encoded message and send it to the server, then process each response from the server

Parameters:
id - session message id

main

public static void main(java.lang.String[] args)
The main will call trhe bind operation first. If that is successful, call the search and write the reponse from the server to the console

Parameters:
args - Command line string