Save This Page
Home » openjdk-7 » com.sun.jndi » ldap » [javadoc | source]
com.sun.jndi.ldap
public final class: LdapClient [javadoc | source]
java.lang.Object
   com.sun.jndi.ldap.LdapClient

All Implemented Interfaces:
    PooledConnection

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

Field Summary
static final  boolean caseIgnore     
 boolean isLdapv3     
 int referenceCount     
 Connection conn     
static final  int SCOPE_BASE_OBJECT     
static final  int SCOPE_ONE_LEVEL     
static final  int SCOPE_SUBTREE     
static final  int ADD     
static final  int DELETE     
static final  int REPLACE     
static final  int LDAP_VERSION3_VERSION2     
static final  int LDAP_VERSION2     
static final  int LDAP_VERSION3     
static final  int LDAP_VERSION     
static final  int LDAP_REF_FOLLOW     
static final  int LDAP_REF_THROW     
static final  int LDAP_REF_IGNORE     
static final  String LDAP_URL     
static final  String LDAPS_URL     
static final  int LBER_BOOLEAN     
static final  int LBER_INTEGER     
static final  int LBER_BITSTRING     
static final  int LBER_OCTETSTRING     
static final  int LBER_NULL     
static final  int LBER_ENUMERATED     
static final  int LBER_SEQUENCE     
static final  int LBER_SET     
static final  int LDAP_SUPERIOR_DN     
static final  int LDAP_REQ_BIND     
static final  int LDAP_REQ_UNBIND     
static final  int LDAP_REQ_SEARCH     
static final  int LDAP_REQ_MODIFY     
static final  int LDAP_REQ_ADD     
static final  int LDAP_REQ_DELETE     
static final  int LDAP_REQ_MODRDN     
static final  int LDAP_REQ_COMPARE     
static final  int LDAP_REQ_ABANDON     
static final  int LDAP_REQ_EXTENSION     
static final  int LDAP_REP_BIND     
static final  int LDAP_REP_SEARCH     
static final  int LDAP_REP_SEARCH_REF     
static final  int LDAP_REP_RESULT     
static final  int LDAP_REP_MODIFY     
static final  int LDAP_REP_ADD     
static final  int LDAP_REP_DELETE     
static final  int LDAP_REP_MODRDN     
static final  int LDAP_REP_COMPARE     
static final  int LDAP_REP_EXTENSION     
static final  int LDAP_REP_REFERRAL     
static final  int LDAP_REP_EXT_OID     
static final  int LDAP_REP_EXT_VAL     
static final  int LDAP_CONTROLS     
static final  String LDAP_CONTROL_MANAGE_DSA_IT     
static final  String LDAP_CONTROL_PREFERRED_LANG     
static final  String LDAP_CONTROL_PAGED_RESULTS     
static final  String LDAP_CONTROL_SERVER_SORT_REQ     
static final  String LDAP_CONTROL_SERVER_SORT_RES     
static final  int LDAP_SUCCESS     
static final  int LDAP_OPERATIONS_ERROR     
static final  int LDAP_PROTOCOL_ERROR     
static final  int LDAP_TIME_LIMIT_EXCEEDED     
static final  int LDAP_SIZE_LIMIT_EXCEEDED     
static final  int LDAP_COMPARE_FALSE     
static final  int LDAP_COMPARE_TRUE     
static final  int LDAP_AUTH_METHOD_NOT_SUPPORTED     
static final  int LDAP_STRONG_AUTH_REQUIRED     
static final  int LDAP_PARTIAL_RESULTS     
static final  int LDAP_REFERRAL     
static final  int LDAP_ADMIN_LIMIT_EXCEEDED     
static final  int LDAP_UNAVAILABLE_CRITICAL_EXTENSION     
static final  int LDAP_CONFIDENTIALITY_REQUIRED     
static final  int LDAP_SASL_BIND_IN_PROGRESS     
static final  int LDAP_NO_SUCH_ATTRIBUTE     
static final  int LDAP_UNDEFINED_ATTRIBUTE_TYPE     
static final  int LDAP_INAPPROPRIATE_MATCHING     
static final  int LDAP_CONSTRAINT_VIOLATION     
static final  int LDAP_ATTRIBUTE_OR_VALUE_EXISTS     
static final  int LDAP_INVALID_ATTRIBUTE_SYNTAX     
static final  int LDAP_NO_SUCH_OBJECT     
static final  int LDAP_ALIAS_PROBLEM     
static final  int LDAP_INVALID_DN_SYNTAX     
static final  int LDAP_IS_LEAF     
static final  int LDAP_ALIAS_DEREFERENCING_PROBLEM     
static final  int LDAP_INAPPROPRIATE_AUTHENTICATION     
static final  int LDAP_INVALID_CREDENTIALS     
static final  int LDAP_INSUFFICIENT_ACCESS_RIGHTS     
static final  int LDAP_BUSY     
static final  int LDAP_UNAVAILABLE     
static final  int LDAP_UNWILLING_TO_PERFORM     
static final  int LDAP_LOOP_DETECT     
static final  int LDAP_NAMING_VIOLATION     
static final  int LDAP_OBJECT_CLASS_VIOLATION     
static final  int LDAP_NOT_ALLOWED_ON_NON_LEAF     
static final  int LDAP_NOT_ALLOWED_ON_RDN     
static final  int LDAP_ENTRY_ALREADY_EXISTS     
static final  int LDAP_OBJECT_CLASS_MODS_PROHIBITED     
static final  int LDAP_AFFECTS_MULTIPLE_DSAS     
static final  int LDAP_OTHER     
static final  String[] ldap_error_message     
Constructor:
 LdapClient(String host,
    int port,
    String socketFactory,
    int connectTimeout,
    int readTimeout,
    OutputStream trace,
    PoolCallback pcb) throws NamingException 
Method from com.sun.jndi.ldap.LdapClient Summary:
add,   addUnsolicited,   authenticate,   authenticateCalled,   clearSearchReply,   close,   closeConnection,   compare,   delete,   encodeControls,   extendedOp,   finalize,   getErrorMessage,   getInstance,   getSearchReply,   incRefCount,   ldapBind,   moddn,   modify,   parseControls,   parseResult,   processConnectionClosure,   processUnsolicited,   removeUnsolicited,   search,   usingSaslStreams
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.jndi.ldap.LdapClient Detail:
 LdapResult add(LdapEntry entry,
    Control[] reqCtls) throws NamingException, IOException 
  void addUnsolicited(LdapCtx ctx) 
 synchronized LdapResult authenticate(boolean initial,
    String name,
    Object pw,
    int version,
    String authMechanism,
    Control[] ctls,
    Hashtable env) throws NamingException 
 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) throws NamingException, IOException 
 LdapResult delete(String DN,
    Control[] reqCtls) throws NamingException, IOException 
 static  void encodeControls(BerEncoder ber,
    Control[] reqCtls) throws IOException 
 LdapResult extendedOp(String id,
    byte[] request,
    Control[] reqCtls,
    boolean pauseAfterReceipt) throws NamingException, IOException 
 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) throws NamingException 
 LdapResult getSearchReply(int batchSize,
    LdapResult res,
    Hashtable binaryAttrs) throws NamingException, IOException 
 synchronized  void incRefCount() 
 public synchronized LdapResult ldapBind(String dn,
    byte[] toServer,
    Control[] bindCtls,
    String auth,
    boolean pauseAfterReceipt) throws NamingException, IOException 
    Sends an LDAP Bind request. Cannot be private; called by LdapSasl
 LdapResult moddn(String DN,
    String newrdn,
    boolean deleteOldRdn,
    String newSuperior,
    Control[] reqCtls) throws NamingException, IOException 
 LdapResult modify(String dn,
    int[] operations,
    Attribute[] attrs,
    Control[] reqCtls) throws NamingException, IOException 
 static Vector parseControls(BerDecoder replyBer) throws IOException 
 static  void parseResult(BerDecoder replyBer,
    LdapResult res,
    boolean isLdapv3) throws IOException 
  void processConnectionClosure() 
    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()).
  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) throws NamingException, IOException 
 boolean usingSaslStreams() 
    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.