|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface summarizes the basic functionality available in the Lightweight Directory Access Protocol (LDAP) version 2. (See RFC 1777 for the definition of the protocol.)
In the general model for this protocol, objects exist under a directory in a particular server. Objects are identified by unique, hierarchical names called Distinguished Names, commonly abreviated "DN". An example of a DN:
cn=Barbara Jensen,ou=Product Development,o=Ace Industry,c=usObjects have attributes, of the form
attributeName = attributeValue(s)Attribute names must be Strings, and attribute values can be any 8-bit sequence (Strings or binary values).
Field Summary | |
static int |
BATCHSIZE
Option specifying the number of results to return at a time. |
static int |
BIND
Option specifying the object containing the method for authenticating to the server. |
static int |
DEFAULT_PORT
The default port number for LDAP servers. |
static int |
DEREF
Option specifying how aliases are dereferenced. |
static int |
DEREF_ALWAYS
Specifies that aliases are always dereferenced. |
static int |
DEREF_FINDING
Specifies that aliases are dereferenced when finding the starting point for the search (but not when searching under that starting entry). |
static int |
DEREF_NEVER
Specifies that aliases are never dereferenced. |
static int |
DEREF_SEARCHING
Specifies that aliases are dereferenced when searching the entries beneath the starting point of the search (but not when finding the starting entry). |
static int |
PROTOCOL_VERSION
Option specifying the version of the LDAP protocol used by your client when interacting with the LDAP server. |
static int |
REFERRALS
Option specifying whether or not referrals to other LDAP servers are followed automatically. |
static int |
REFERRALS_HOP_LIMIT
Option specifying the maximum number of referrals to follow in a sequence when requesting an LDAP operation. |
static int |
REFERRALS_REBIND_PROC
Option specifying the object containing the method for getting authentication information (the distinguished name and password) used during a referral. |
static int |
SCOPE_BASE
Specifies that the scope of a search includes only the base DN (distinguished name). |
static int |
SCOPE_ONE
Specifies that the scope of a search includes only the entries one level below the base DN (distinguished name). |
static int |
SCOPE_SUB
Specifies that the scope of a search includes the base DN (distinguished name) and all entries at all levels beneath that base. |
static int |
SERVER_TIMELIMIT
Option specifying the maximum number of milliseconds the server should spend returning search results before aborting the search. |
static int |
SIZELIMIT
Option specifying the maximum number of search results to return. |
static int |
TIMELIMIT
Option specifying the maximum number of milliseconds to wait for an operation to complete. |
Method Summary | |
void |
abandon(LDAPSearchResults results)
Notifies the server to not send additional results associated with this LDAPSearchResults object, and discards any results already
received. |
void |
add(LDAPEntry entry)
Adds an entry to the directory. |
void |
add(LDAPEntry entry,
LDAPConstraints cons)
Adds an entry to the directory. |
void |
authenticate(java.lang.String DN,
java.lang.String passwd)
Authenticates user with the LDAP server. |
void |
bind(java.lang.String DN,
java.lang.String passwd)
Authenticates user with the LDAP server. |
boolean |
compare(java.lang.String DN,
LDAPAttribute attr)
Compares the given entry's attribute value to the specified attribute value. |
boolean |
compare(java.lang.String DN,
LDAPAttribute attr,
LDAPConstraints cons)
Compares the given entry's attribute value to the specified attribute value. |
void |
connect(java.lang.String host,
int port)
Connects to the LDAP server. |
void |
connect(java.lang.String host,
int port,
java.lang.String dn,
java.lang.String passwd)
Connects and authenticates to the LDAP server. |
void |
delete(java.lang.String DN)
Removes an entry from the directory. |
void |
delete(java.lang.String DN,
LDAPConstraints cons)
Removes an entry from the directory. |
void |
disconnect()
Disconnects from the LDAP server. |
java.lang.Object |
getOption(int option)
Retrieves an option that applies to the connection. |
void |
modify(java.lang.String DN,
LDAPModification mod)
Modifies an attribute of a directory entry. |
void |
modify(java.lang.String DN,
LDAPModification mod,
LDAPConstraints cons)
Modifies an attribute of a directory entry. |
void |
modify(java.lang.String DN,
LDAPModificationSet mods)
Modifies the attributes of a directory entry. |
void |
modify(java.lang.String DN,
LDAPModificationSet mods,
LDAPConstraints cons)
Modifies the attributes of a directory entry. |
LDAPEntry |
read(java.lang.String DN)
Read the entry corresponding to the specified distinguished name (DN). |
LDAPEntry |
read(java.lang.String DN,
java.lang.String[] attrs)
Read the entry corresponding to the specified distinguished name (DN), and retrieve only the specified attributes. |
LDAPEntry |
read(java.lang.String DN,
java.lang.String[] attrs,
LDAPSearchConstraints cons)
Read the entry corresponding to the specified distinguished name (DN), and retrieve only the specified attributes. |
void |
rename(java.lang.String DN,
java.lang.String newRDN,
boolean deleteOldRDN)
Changes the name of an entry in the directory. |
void |
rename(java.lang.String DN,
java.lang.String newRDN,
boolean deleteOldRDN,
LDAPConstraints cons)
Changes the name of an entry in the directory. |
LDAPSearchResults |
search(java.lang.String base,
int scope,
java.lang.String filter,
java.lang.String[] attrs,
boolean attrsOnly)
Searches for entries in the directory. |
LDAPSearchResults |
search(java.lang.String base,
int scope,
java.lang.String filter,
java.lang.String[] attrs,
boolean attrsOnly,
LDAPSearchConstraints cons)
Searches for entries in the directory. |
void |
setOption(int option,
java.lang.Object value)
Sets an option that applies to the connection. |
Field Detail |
public static final int DEFAULT_PORT
LDAPConnection.connect
method to connect to an LDAP server.LDAPConnection.connect(java.lang.String, int)
public static final int DEREF
This option can have one of the following values:
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
public static final int SIZELIMIT
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
public static final int TIMELIMIT
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
public static final int SERVER_TIMELIMIT
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
public static final int REFERRALS
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
,
LDAPRebind
,
LDAPRebindAuth
public static final int REFERRALS_REBIND_PROC
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
,
LDAPRebind
,
LDAPRebindAuth
public static final int REFERRALS_HOP_LIMIT
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
public static final int BIND
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
,
LDAPBind
public static final int PROTOCOL_VERSION
authenticate
method of the LDAPConnection
object.LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
,
LDAPConnection.authenticate(int, java.lang.String, java.lang.String)
public static final int BATCHSIZE
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
public static final int SCOPE_BASE
LDAPConnection.search(java.lang.String, int, java.lang.String, java.lang.String[], boolean, netscape.ldap.LDAPSearchConstraints)
public static final int SCOPE_ONE
LDAPConnection.search(java.lang.String, int, java.lang.String, java.lang.String[], boolean, netscape.ldap.LDAPSearchConstraints)
public static final int SCOPE_SUB
LDAPConnection.search(java.lang.String, int, java.lang.String, java.lang.String[], boolean, netscape.ldap.LDAPSearchConstraints)
public static final int DEREF_NEVER
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
public static final int DEREF_SEARCHING
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
public static final int DEREF_FINDING
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
public static final int DEREF_ALWAYS
LDAPConnection.getOption(int)
,
LDAPConnection.setOption(int, java.lang.Object)
Method Detail |
public void connect(java.lang.String host, int port) throws LDAPException
host
- hostname of the LDAP serverport
- port number of the LDAP server. To specify the
default port, use DEFAULT_PORT
.public void connect(java.lang.String host, int port, java.lang.String dn, java.lang.String passwd) throws LDAPException
host
- hostname of the LDAP serverport
- port number of the LDAP server. To specify the
default port, use DEFAULT_PORT
.dn
- distinguished name to use for authenticationpasswd
- password for authenticationpublic void disconnect() throws LDAPException
public void abandon(LDAPSearchResults results) throws LDAPException
LDAPSearchResults
object, and discards any results already
received.results
- LDAPSearchResults object returned from a searchpublic void authenticate(java.lang.String DN, java.lang.String passwd) throws LDAPException
DN
- distinguished name to use for authenticationpasswd
- password for authenticationpublic void bind(java.lang.String DN, java.lang.String passwd) throws LDAPException
DN
- distinguished name to use for authenticationpasswd
- password for authenticationpublic LDAPEntry read(java.lang.String DN) throws LDAPException
DN
- distinguished name of the entry to retrievepublic LDAPEntry read(java.lang.String DN, java.lang.String[] attrs) throws LDAPException
DN
- distinguished name of the entry to retrieveattrs
- names of attributes to retrievepublic LDAPEntry read(java.lang.String DN, java.lang.String[] attrs, LDAPSearchConstraints cons) throws LDAPException
DN
- distinguished name of the entry to retrieveattrs
- names of attributes to retrievecons
- the constraints set for the read operationpublic LDAPSearchResults search(java.lang.String base, int scope, java.lang.String filter, java.lang.String[] attrs, boolean attrsOnly) throws LDAPException
base
- starting point for the search in the directory
(distinguished name)scope
- indicates whether the scope of the search includes
only the base DN (equivalent to a read operation), only the entries
one level below the base DN, or all entries at all levels beneath
the base DN (including the base DN itself)filter
- String which describes the search criteria. The format
of the string is described fully in
RFC 1558.attrs
- names of the attributes to return for each matching
directory entry. If null
, all attributes are returned.attrsOnly
- if true
, the search will return only the names of
the attributes (and not their values)public LDAPSearchResults search(java.lang.String base, int scope, java.lang.String filter, java.lang.String[] attrs, boolean attrsOnly, LDAPSearchConstraints cons) throws LDAPException
base
- starting point for the search in the directory
(distinguished name)scope
- indicates whether the scope of the search includes
only the base DN (equivalent to a read operation), only the entries
one level below the base DN, or all entries at all levels beneath
the base DN (including the base DN itself)filter
- String which describes the search criteria. The format
of the string is described fully in
RFC 1558.attrs
- names of the attributes to return for each matching
directory entry. If null
, all attributes are returned.attrsOnly
- if true
, the search will return only the names of
the attributes (and not their values)cons
- constraints specific to the search (for example, the maximum number
of entries to return or the maximum time to wait for the search operation to complete)public boolean compare(java.lang.String DN, LDAPAttribute attr) throws LDAPException
DN
- distinguished name of the entry that you want compared
against the specified attribute valueattr
- attribute name and value to use in the comparisonpublic boolean compare(java.lang.String DN, LDAPAttribute attr, LDAPConstraints cons) throws LDAPException
DN
- distinguished name of the entry that you want compared
against the specified attribute valueattr
- attribute name and value to use in the comparisoncons
- the constraints set for the compare operationpublic void add(LDAPEntry entry) throws LDAPException
entry
- new entry to add to the directorypublic void add(LDAPEntry entry, LDAPConstraints cons) throws LDAPException
entry
- new entry to add to the directorycons
- the constraints set for the add operationpublic void modify(java.lang.String DN, LDAPModification mod) throws LDAPException
DN
- distinguished name identifying the entry to modifymod
- the modification to makepublic void modify(java.lang.String DN, LDAPModification mod, LDAPConstraints cons) throws LDAPException
DN
- distinguished name identifying the entry to modifymod
- the modification to makecons
- the constraints set for the modify operationpublic void modify(java.lang.String DN, LDAPModificationSet mods) throws LDAPException
DN
- distinguished name identifying the entry to modifymod
- list of the modifications to makepublic void modify(java.lang.String DN, LDAPModificationSet mods, LDAPConstraints cons) throws LDAPException
DN
- distinguished name identifying the entry to modifymod
- list of the modifications to makecons
- the constraints set for the modify operationpublic void delete(java.lang.String DN) throws LDAPException
DN
- distinguished name identifying the entry to removepublic void delete(java.lang.String DN, LDAPConstraints cons) throws LDAPException
DN
- distinguished name identifying the entry to removecons
- the constraints set for the delete operationpublic void rename(java.lang.String DN, java.lang.String newRDN, boolean deleteOldRDN) throws LDAPException
DN
- distinguished name (DN) of entrynewRDN
- the new relative distinguished name (RDN) of the entrydeleteOldRDN
- true
if the original RDN should no longer
be an attribute of the entry; false
if it shouldpublic void rename(java.lang.String DN, java.lang.String newRDN, boolean deleteOldRDN, LDAPConstraints cons) throws LDAPException
DN
- distinguished name (DN) of entrynewRDN
- new relative distinguished name (RDN) of the entrydeleteOldRDN
- specifies whether or not the original RDN remains
as an attribute of the entry. If true
, the original RDN
is no longer an attribute of the entry.cons
- the constraints set for the rename operationpublic java.lang.Object getOption(int option) throws LDAPException
LDAPSearchConstraints
and LDAPConstraints
classes.public void setOption(int option, java.lang.Object value) throws LDAPException
LDAPSearchConstraints
and LDAPConstraints
classes.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |