| java.lang.Object com.sun.jndi.ldap.LdapClient
LdapClient | final public class LdapClient implements PooledConnection(Code) | | LDAP (RFC-1777) and LDAPv3 (RFC-2251) compliant client
This class represents a connection to an LDAP client.
Callers interact with this class at an LDAP operation level.
That is, the caller invokes a method to do a SEARCH or MODRDN
operation and gets back the result.
The caller uses the constructor to create a connection to the server.
It then needs to use authenticate() to perform an LDAP BIND.
Note that for v3, BIND is optional so authenticate() might not
actually send a BIND. authenticate() can be used later on to issue
a BIND, for example, for a v3 client that wants to change the connection's
credentials.
Multiple LdapCtx might share the same LdapClient. For example, contexts
derived from the same initial context would share the same LdapClient
until changes to a context's properties necessitates its own LdapClient.
LdapClient methods that access shared data are thread-safe (i.e., caller
does not have to sync).
Fields:
isLdapv3 - no sync; initialized and updated within sync authenticate();
always updated when connection is "quiet" and not shared;
read access from outside LdapClient not sync
referenceCount - sync within LdapClient; exception is forceClose() which
is used by Connection thread to close connection upon receiving
an Unsolicited Notification.
access from outside LdapClient must sync;
conn - no sync; Connection takes care of its own sync
unsolicited - sync Vector; multiple operations sync'ed
author: Vincent Ryan author: Jagane Sundar author: Rosanna Lee |
Method Summary | |
LdapResult | add(LdapEntry entry, Control[] reqCtls) | void | addUnsolicited(LdapCtx ctx) | synchronized LdapResult | authenticate(boolean initial, String name, Object pw, int version, String authMechanism, Control[] ctls, Hashtable env) | synchronized boolean | authenticateCalled() | void | clearSearchReply(LdapResult res, Control[] ctls) | synchronized void | close(Control[] reqCtls, boolean hardClose) | public synchronized void | closeConnection() | LdapResult | compare(String DN, String type, String value, Control[] reqCtls) | LdapResult | delete(String DN, Control[] reqCtls) | static void | encodeControls(BerEncoder ber, Control[] reqCtls) | LdapResult | extendedOp(String id, byte[] request, Control[] reqCtls, boolean pauseAfterReceipt) | protected void | finalize() | static String | getErrorMessage(int errorCode, String errorMessage) | static LdapClient | getInstance(boolean usePool, String hostname, int port, String factory, int connectTimeout, int readTimeout, OutputStream trace, int version, String authMechanism, Control[] ctls, String protocol, String user, Object passwd, Hashtable env) | LdapResult | getSearchReply(int batchSize, LdapResult res, Hashtable binaryAttrs) | synchronized void | incRefCount() | public synchronized LdapResult | ldapBind(String dn, byte[] toServer, Control[] bindCtls, String auth, boolean pauseAfterReceipt) Sends an LDAP Bind request.
Cannot be private; called by LdapSasl
Parameters: dn - The possibly null DN to use in the BIND request. | LdapResult | moddn(String DN, String newrdn, boolean deleteOldRdn, String newSuperior, Control[] reqCtls) | LdapResult | modify(String dn, int operations, Attribute attrs, Control[] reqCtls) | static Vector | parseControls(BerDecoder replyBer) | static void | parseResult(BerDecoder replyBer, LdapResult res, boolean isLdapv3) | void | processConnectionClosure() Called by Connection.cleanup(). | void | processUnsolicited(BerDecoder ber) | void | removeUnsolicited(LdapCtx ctx) | LdapResult | search(String dn, int scope, int deref, int sizeLimit, int timeLimit, boolean attrsOnly, String attrs, String filter, int batchSize, Control[] reqCtls, Hashtable binaryAttrs, boolean waitFirstReply) | boolean | usingSaslStreams() Determines whether SASL encryption/integrity is in progress.
This check is made prior to reauthentication. |
DELETE | final static int DELETE(Code) | | |
LBER_BITSTRING | final static int LBER_BITSTRING(Code) | | |
LBER_BOOLEAN | final static int LBER_BOOLEAN(Code) | | |
LBER_ENUMERATED | final static int LBER_ENUMERATED(Code) | | |
LBER_INTEGER | final static int LBER_INTEGER(Code) | | |
LBER_NULL | final static int LBER_NULL(Code) | | |
LBER_OCTETSTRING | final static int LBER_OCTETSTRING(Code) | | |
LBER_SEQUENCE | final static int LBER_SEQUENCE(Code) | | |
LBER_SET | final static int LBER_SET(Code) | | |
LDAP_ADMIN_LIMIT_EXCEEDED | final static int LDAP_ADMIN_LIMIT_EXCEEDED(Code) | | |
LDAP_AFFECTS_MULTIPLE_DSAS | final static int LDAP_AFFECTS_MULTIPLE_DSAS(Code) | | |
LDAP_ALIAS_DEREFERENCING_PROBLEM | final static int LDAP_ALIAS_DEREFERENCING_PROBLEM(Code) | | |
LDAP_ALIAS_PROBLEM | final static int LDAP_ALIAS_PROBLEM(Code) | | |
LDAP_ATTRIBUTE_OR_VALUE_EXISTS | final static int LDAP_ATTRIBUTE_OR_VALUE_EXISTS(Code) | | |
LDAP_AUTH_METHOD_NOT_SUPPORTED | final static int LDAP_AUTH_METHOD_NOT_SUPPORTED(Code) | | |
LDAP_BUSY | final static int LDAP_BUSY(Code) | | |
LDAP_COMPARE_FALSE | final static int LDAP_COMPARE_FALSE(Code) | | |
LDAP_COMPARE_TRUE | final static int LDAP_COMPARE_TRUE(Code) | | |
LDAP_CONFIDENTIALITY_REQUIRED | final static int LDAP_CONFIDENTIALITY_REQUIRED(Code) | | |
LDAP_CONSTRAINT_VIOLATION | final static int LDAP_CONSTRAINT_VIOLATION(Code) | | |
LDAP_CONTROLS | final static int LDAP_CONTROLS(Code) | | |
LDAP_CONTROL_MANAGE_DSA_IT | final static String LDAP_CONTROL_MANAGE_DSA_IT(Code) | | |
LDAP_CONTROL_PAGED_RESULTS | final static String LDAP_CONTROL_PAGED_RESULTS(Code) | | |
LDAP_CONTROL_PREFERRED_LANG | final static String LDAP_CONTROL_PREFERRED_LANG(Code) | | |
LDAP_CONTROL_SERVER_SORT_REQ | final static String LDAP_CONTROL_SERVER_SORT_REQ(Code) | | |
LDAP_CONTROL_SERVER_SORT_RES | final static String LDAP_CONTROL_SERVER_SORT_RES(Code) | | |
LDAP_ENTRY_ALREADY_EXISTS | final static int LDAP_ENTRY_ALREADY_EXISTS(Code) | | |
LDAP_INAPPROPRIATE_AUTHENTICATION | final static int LDAP_INAPPROPRIATE_AUTHENTICATION(Code) | | |
LDAP_INAPPROPRIATE_MATCHING | final static int LDAP_INAPPROPRIATE_MATCHING(Code) | | |
LDAP_INSUFFICIENT_ACCESS_RIGHTS | final static int LDAP_INSUFFICIENT_ACCESS_RIGHTS(Code) | | |
LDAP_INVALID_ATTRIBUTE_SYNTAX | final static int LDAP_INVALID_ATTRIBUTE_SYNTAX(Code) | | |
LDAP_INVALID_CREDENTIALS | final static int LDAP_INVALID_CREDENTIALS(Code) | | |
LDAP_INVALID_DN_SYNTAX | final static int LDAP_INVALID_DN_SYNTAX(Code) | | |
LDAP_IS_LEAF | final static int LDAP_IS_LEAF(Code) | | |
LDAP_LOOP_DETECT | final static int LDAP_LOOP_DETECT(Code) | | |
LDAP_NAMING_VIOLATION | final static int LDAP_NAMING_VIOLATION(Code) | | |
LDAP_NOT_ALLOWED_ON_NON_LEAF | final static int LDAP_NOT_ALLOWED_ON_NON_LEAF(Code) | | |
LDAP_NOT_ALLOWED_ON_RDN | final static int LDAP_NOT_ALLOWED_ON_RDN(Code) | | |
LDAP_NO_SUCH_ATTRIBUTE | final static int LDAP_NO_SUCH_ATTRIBUTE(Code) | | |
LDAP_NO_SUCH_OBJECT | final static int LDAP_NO_SUCH_OBJECT(Code) | | |
LDAP_OBJECT_CLASS_MODS_PROHIBITED | final static int LDAP_OBJECT_CLASS_MODS_PROHIBITED(Code) | | |
LDAP_OBJECT_CLASS_VIOLATION | final static int LDAP_OBJECT_CLASS_VIOLATION(Code) | | |
LDAP_OPERATIONS_ERROR | final static int LDAP_OPERATIONS_ERROR(Code) | | |
LDAP_OTHER | final static int LDAP_OTHER(Code) | | |
LDAP_PARTIAL_RESULTS | final static int LDAP_PARTIAL_RESULTS(Code) | | |
LDAP_PROTOCOL_ERROR | final static int LDAP_PROTOCOL_ERROR(Code) | | |
LDAP_REFERRAL | final static int LDAP_REFERRAL(Code) | | |
LDAP_REF_FOLLOW | final static int LDAP_REF_FOLLOW(Code) | | |
LDAP_REF_IGNORE | final static int LDAP_REF_IGNORE(Code) | | |
LDAP_REF_THROW | final static int LDAP_REF_THROW(Code) | | |
LDAP_REP_ADD | final static int LDAP_REP_ADD(Code) | | |
LDAP_REP_BIND | final static int LDAP_REP_BIND(Code) | | |
LDAP_REP_COMPARE | final static int LDAP_REP_COMPARE(Code) | | |
LDAP_REP_DELETE | final static int LDAP_REP_DELETE(Code) | | |
LDAP_REP_EXTENSION | final static int LDAP_REP_EXTENSION(Code) | | |
LDAP_REP_EXT_OID | final static int LDAP_REP_EXT_OID(Code) | | |
LDAP_REP_EXT_VAL | final static int LDAP_REP_EXT_VAL(Code) | | |
LDAP_REP_MODIFY | final static int LDAP_REP_MODIFY(Code) | | |
LDAP_REP_MODRDN | final static int LDAP_REP_MODRDN(Code) | | |
LDAP_REP_REFERRAL | final static int LDAP_REP_REFERRAL(Code) | | |
LDAP_REP_RESULT | final static int LDAP_REP_RESULT(Code) | | |
LDAP_REP_SEARCH | final static int LDAP_REP_SEARCH(Code) | | |
LDAP_REP_SEARCH_REF | final static int LDAP_REP_SEARCH_REF(Code) | | |
LDAP_REQ_ABANDON | final static int LDAP_REQ_ABANDON(Code) | | |
LDAP_REQ_ADD | final static int LDAP_REQ_ADD(Code) | | |
LDAP_REQ_BIND | final static int LDAP_REQ_BIND(Code) | | |
LDAP_REQ_COMPARE | final static int LDAP_REQ_COMPARE(Code) | | |
LDAP_REQ_DELETE | final static int LDAP_REQ_DELETE(Code) | | |
LDAP_REQ_EXTENSION | final static int LDAP_REQ_EXTENSION(Code) | | |
LDAP_REQ_MODIFY | final static int LDAP_REQ_MODIFY(Code) | | |
LDAP_REQ_MODRDN | final static int LDAP_REQ_MODRDN(Code) | | |
LDAP_REQ_SEARCH | final static int LDAP_REQ_SEARCH(Code) | | |
LDAP_REQ_UNBIND | final static int LDAP_REQ_UNBIND(Code) | | |
LDAP_SASL_BIND_IN_PROGRESS | final static int LDAP_SASL_BIND_IN_PROGRESS(Code) | | |
LDAP_SIZE_LIMIT_EXCEEDED | final static int LDAP_SIZE_LIMIT_EXCEEDED(Code) | | |
LDAP_STRONG_AUTH_REQUIRED | final static int LDAP_STRONG_AUTH_REQUIRED(Code) | | |
LDAP_SUCCESS | final static int LDAP_SUCCESS(Code) | | |
LDAP_SUPERIOR_DN | final static int LDAP_SUPERIOR_DN(Code) | | |
LDAP_TIME_LIMIT_EXCEEDED | final static int LDAP_TIME_LIMIT_EXCEEDED(Code) | | |
LDAP_UNAVAILABLE | final static int LDAP_UNAVAILABLE(Code) | | |
LDAP_UNAVAILABLE_CRITICAL_EXTENSION | final static int LDAP_UNAVAILABLE_CRITICAL_EXTENSION(Code) | | |
LDAP_UNDEFINED_ATTRIBUTE_TYPE | final static int LDAP_UNDEFINED_ATTRIBUTE_TYPE(Code) | | |
LDAP_UNWILLING_TO_PERFORM | final static int LDAP_UNWILLING_TO_PERFORM(Code) | | |
LDAP_VERSION | final static int LDAP_VERSION(Code) | | |
LDAP_VERSION2 | final static int LDAP_VERSION2(Code) | | |
LDAP_VERSION3 | final static int LDAP_VERSION3(Code) | | |
LDAP_VERSION3_VERSION2 | final static int LDAP_VERSION3_VERSION2(Code) | | |
REPLACE | final static int REPLACE(Code) | | |
SCOPE_BASE_OBJECT | final static int SCOPE_BASE_OBJECT(Code) | | |
SCOPE_ONE_LEVEL | final static int SCOPE_ONE_LEVEL(Code) | | |
SCOPE_SUBTREE | final static int SCOPE_SUBTREE(Code) | | |
caseIgnore | final static boolean caseIgnore(Code) | | |
isLdapv3 | boolean isLdapv3(Code) | | |
ldap_error_message | final static String[] ldap_error_message(Code) | | |
referenceCount | int referenceCount(Code) | | |
authenticateCalled | synchronized boolean authenticateCalled()(Code) | | |
close | synchronized void close(Control[] reqCtls, boolean hardClose)(Code) | | |
closeConnection | public synchronized void closeConnection()(Code) | | |
finalize | protected void finalize()(Code) | | |
getInstance | static LdapClient getInstance(boolean usePool, String hostname, int port, String factory, int connectTimeout, int readTimeout, OutputStream trace, int version, String authMechanism, Control[] ctls, String protocol, String user, Object passwd, Hashtable env) throws NamingException(Code) | | |
incRefCount | synchronized void incRefCount()(Code) | | |
ldapBind | public synchronized LdapResult ldapBind(String dn, byte[] toServer, Control[] bindCtls, String auth, boolean pauseAfterReceipt) throws java.io.IOException, NamingException(Code) | | Sends an LDAP Bind request.
Cannot be private; called by LdapSasl
Parameters: dn - The possibly null DN to use in the BIND request. null if anonymous. Parameters: toServer - The possibly null array of bytes to send to the server. Parameters: auth - The authentication mechanism |
processConnectionClosure | void processConnectionClosure()(Code) | | Called by Connection.cleanup(). LdapClient should
notify any unsolicited listeners and removing itself from any pool.
This is almost like forceClose(), except it doesn't call
Connection.cleanup() (because this is called from cleanup()).
|
search | LdapResult search(String dn, int scope, int deref, int sizeLimit, int timeLimit, boolean attrsOnly, String attrs, String filter, int batchSize, Control[] reqCtls, Hashtable binaryAttrs, boolean waitFirstReply) throws IOException, NamingException(Code) | | |
usingSaslStreams | boolean usingSaslStreams()(Code) | | Determines whether SASL encryption/integrity is in progress.
This check is made prior to reauthentication. You cannot reauthenticate
over an encrypted/integrity-protected SASL channel. You must
close the channel and open a new one.
|
|
|