Java Reference
In-Depth Information
The next important piece of information is the search scope. This also is an attribute to the
class, and is defaulted to perform subtree searches.
The search method requires two pieces of information. The first is an array of strings that spec-
ify which attributes should be returned from the search. Here you must provide exactly which
attributes should be returned for each object that meets your search criteria. The second para-
meter to the search method is the search filter for this particular search.
After you have results from your search, you transfer them into a container object called
LDAPObject . This is not a standard object, just a simple container that makes it easier to return
the information to the client. The full listing of this class is in Listing 11.1.
import java.util.Hashtable;
public class LDAPObject {
protected String dn = null;
protected Hashtable attributes = new Hashtable();
public LDAPObject() {
public String getDn() {
return dn;
public void setDn(String dn) {
this.dn = dn;
public Object getAttribute(String attName) {
return (String)attributes.get(attName);
public void setAttribute(String attName, Object attValue) {
attributes.put(attName, attValue);
Search WWH ::

Custom Search