Package netscape.ldap
Interface LDAPv3
- All Superinterfaces:
LDAPv2
- All Known Implementing Classes:
LDAPConnection
Specifies additional features available in version 3 of the
LDAP protocol.
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Attribute type that you can specify in the LDAPConnection search method if you want to retrieve all attribute types.static final int
Option specifying the number of results to return at a time.static final int
Option specifying the object containing the method for authenticating to the server.static final int
Option specifying client controls for LDAP operations.static final int
The default port number for LDAP servers.static final int
Option specifying how aliases are dereferenced.static final int
Specifies that aliases are always dereferenced.static final int
Specifies that aliases are dereferenced when finding the starting point for the search (but not when searching under that starting entry).static final int
Specifies that aliases are never dereferenced.static final int
Specifies that aliases are dereferenced when searching the entries beneath the starting point of the search (but not when finding the starting entry).static final String
Attribute type that you can specify in the LDAPConnection search method if you don't want to retrieve any of the attribute types for entries found by the search.static final int
Option specifying the version of the LDAP protocol used by your client when interacting with the LDAP server.static final int
Option specifying whether or not referrals to other LDAP servers are followed automatically.static final int
Option specifying the maximum number of referrals to follow in a sequence when requesting an LDAP operation.static final int
Option specifying the object containing the method for getting authentication information (the distinguished name and password) used during a referral.static final int
Specifies that the scope of a search includes only the base DN (distinguished name).static final int
Specifies that the scope of a search includes only the entries one level below the base DN (distinguished name).static final int
Specifies that the scope of a search includes the base DN (distinguished name) and all entries at all levels beneath that base.static final int
Option specifying the maximum number of milliseconds the server should spend returning search results before aborting the search.static final int
Option specifying server controls for LDAP operations.static final int
Option specifying the maximum number of search results to return.static final int
Option specifying the maximum number of milliseconds to wait for an operation to complete. -
Method Summary
Modifier and TypeMethodDescriptionvoid
authenticate
(int version, String dn, String passwd) Authenticates to the LDAP server (to which the object is currently connected) using the specified name, password, and version of the LDAP protocol.void
Authenticates to the LDAP server (to which the object is currently connected) using the specified name, password, and version of the LDAP protocol.void
Connects and authenticates to the LDAP server using the specified version of the LDAP protocol.Performs an extended operation on the directory.Returns an array of the latest controls (if any) from the server.void
Renames and moves an entry in the directory.void
rename
(String DN, String newRDN, String newParentDN, boolean deleteOldRDN, LDAPConstraints cons) Renames and moves an entry in the directory.
-
Field Details
-
DEFAULT_PORT
static final int DEFAULT_PORTThe default port number for LDAP servers. You can specify this identifier when calling theLDAPConnection.connect
method to connect to an LDAP server.- See Also:
-
DEREF
static final int DEREFOption specifying how aliases are dereferenced.This option can have one of the following values:
- See Also:
-
SIZELIMIT
static final int SIZELIMITOption specifying the maximum number of search results to return.- See Also:
-
TIMELIMIT
static final int TIMELIMITOption specifying the maximum number of milliseconds to wait for an operation to complete.- See Also:
-
SERVER_TIMELIMIT
static final int SERVER_TIMELIMITOption specifying the maximum number of milliseconds the server should spend returning search results before aborting the search.- See Also:
-
REFERRALS
static final int REFERRALSOption specifying whether or not referrals to other LDAP servers are followed automatically.- See Also:
-
REFERRALS_REBIND_PROC
static final int REFERRALS_REBIND_PROCOption specifying the object containing the method for getting authentication information (the distinguished name and password) used during a referral. For example, when referred to another LDAP server, your client uses this object to obtain the DN and password. Your client authenticates to the LDAP server using this DN and password.- See Also:
-
REFERRALS_HOP_LIMIT
static final int REFERRALS_HOP_LIMITOption specifying the maximum number of referrals to follow in a sequence when requesting an LDAP operation.- See Also:
-
BIND
static final int BINDOption specifying the object containing the method for authenticating to the server.- See Also:
-
PROTOCOL_VERSION
static final int PROTOCOL_VERSIONOption specifying the version of the LDAP protocol used by your client when interacting with the LDAP server. If no version is set, the default version is 2. If you are planning to use LDAP v3 features (such as controls or extended operations), you should set this version to 3 or specify version 3 as an argument to theauthenticate
method of theLDAPConnection
object.- See Also:
-
BATCHSIZE
static final int BATCHSIZEOption specifying the number of results to return at a time.- See Also:
-
SCOPE_BASE
static final int SCOPE_BASESpecifies that the scope of a search includes only the base DN (distinguished name).- See Also:
-
SCOPE_ONE
static final int SCOPE_ONESpecifies that the scope of a search includes only the entries one level below the base DN (distinguished name).- See Also:
-
SCOPE_SUB
static final int SCOPE_SUBSpecifies that the scope of a search includes the base DN (distinguished name) and all entries at all levels beneath that base.- See Also:
-
DEREF_NEVER
static final int DEREF_NEVERSpecifies that aliases are never dereferenced.- See Also:
-
DEREF_SEARCHING
static final int DEREF_SEARCHINGSpecifies that aliases are dereferenced when searching the entries beneath the starting point of the search (but not when finding the starting entry).- See Also:
-
DEREF_FINDING
static final int DEREF_FINDINGSpecifies that aliases are dereferenced when finding the starting point for the search (but not when searching under that starting entry).- See Also:
-
DEREF_ALWAYS
static final int DEREF_ALWAYSSpecifies that aliases are always dereferenced.- See Also:
-
CLIENTCONTROLS
static final int CLIENTCONTROLSOption specifying client controls for LDAP operations. These controls are interpreted by the client and are not passed to the LDAP server.- See Also:
-
SERVERCONTROLS
static final int SERVERCONTROLSOption specifying server controls for LDAP operations. These controls are passed to the LDAP server. They may also be returned by the server.- See Also:
-
NO_ATTRS
Attribute type that you can specify in the LDAPConnection search method if you don't want to retrieve any of the attribute types for entries found by the search.- See Also:
-
ALL_USER_ATTRS
Attribute type that you can specify in the LDAPConnection search method if you want to retrieve all attribute types. You can use this if you want to retrieve all attributes in addition to an operational attribute. For example:... String [] MY_ATTRS = { LDAPv3.ALL_USER_ATTRS, "modifiersName", "modifyTimestamp" }; LDAPSearchResults res = ld.search( MY_SEARCHBASE, LDAPConnection.SCOPE_SUB, MY_FILTER, MY_ATTRS, false, cons ); ...
- See Also:
-
-
Method Details
-
connect
Connects and authenticates to the LDAP server using the specified version of the LDAP protocol.- Parameters:
version
- requested version of the LDAP protocol: currently 2 or 3host
- hostname of the LDAP serverport
- port number of the LDAP server. To specify the default port, useDEFAULT_PORT
.dn
- distinguished name to use for authenticationpasswd
- password for authentication- Throws:
LDAPException
- Failed to connect and authenticate to the server.
-
authenticate
Authenticates to the LDAP server (to which the object is currently connected) using the specified name, password, and version of the LDAP protocol. If the server does not support the requested protocol version, an exception is thrown. If the object has been disconnected from an LDAP server, this method attempts to reconnect to the server. If the object had already authenticated, the old authentication is discarded.- Parameters:
version
- requested LDAP protocol version: currently 2 or 3.dn
- if non-null and non-empty, specifies that the connection and all operations through it should authenticate with dn as the distinguished namepasswd
- if non-null and non-empty, specifies that the connection and all operations through it should authenticated with passwd as password- Throws:
LDAPException
- Failed to authenticate to the LDAP server.
-
bind
Authenticates to the LDAP server (to which the object is currently connected) using the specified name, password, and version of the LDAP protocol. If the server does not support the requested version of the protocol, an exception is thrown. If the object has been disconnected from an LDAP server, this method attempts to reconnect to the server. If the object had already authenticated, the old authentication is discarded.- Parameters:
version
- requested LDAP protocol version: currently 2 or 3.dn
- if non-null and non-empty, specifies that the connection and all operations through it should authenticate with dn as the distinguished namepasswd
- if non-null and non-empty, specifies that the connection and all operations through it should authenticate with passwd as password- Throws:
LDAPException
- Failed to authenticate to the LDAP server.
-
extendedOperation
Performs an extended operation on the directory. Extended operations are part of version 3 of the LDAP protocol.- Parameters:
op
- LDAPExtendedOperation object specifying the OID of the extended operation and the data to use in the operation- Returns:
- LDAPExtendedOperation object representing the extended response returned by the server.
- Throws:
LDAPException
- Failed to execute the operation- See Also:
-
rename
void rename(String DN, String newRDN, String newParentDN, boolean deleteOldRDN) throws LDAPException Renames and moves an entry in the directory.- Parameters:
DN
- original distinguished name (DN) for the entrynewRDN
- new relative distinguished name (RDN) for the entrynewParentDN
- distinguished name of the new parent entry of the specified entrydeleteOldRDN
- specifies whether or not to remove the old RDN when renaming and moving the entry. Iftrue
, the old RDN will be deleted.- Throws:
LDAPException
- Failed to rename the specified entry.
-
rename
void rename(String DN, String newRDN, String newParentDN, boolean deleteOldRDN, LDAPConstraints cons) throws LDAPException Renames and moves an entry in the directory.- Parameters:
DN
- original distinguished name (DN) for the entrynewRDN
- new relative distinguished name (RDN) for the entrynewParentDN
- distinguished name of the new parent entry of the specified entrydeleteOldRDN
- specifies whether or not to remove the old RDN when renaming and moving the entry. Iftrue
, the old RDN will be deleted.cons
- the constraints set for the rename operation- Throws:
LDAPException
- Failed to rename the specified entry.
-
getResponseControls
LDAPControl[] getResponseControls()Returns an array of the latest controls (if any) from the server.- Returns:
- an array of the controls returned by an operation,
or
null
if none. - See Also:
-