com.netscape.jndi.ldap
Class ContextEnv

java.lang.Object
  extended by com.netscape.jndi.ldap.common.ShareableEnv
      extended by com.netscape.jndi.ldap.ContextEnv
All Implemented Interfaces:
java.lang.Cloneable

 class ContextEnv
extends ShareableEnv

Context Environment


Nested Class Summary
(package private) static class ContextEnv.ReferralRebindProc
          Implementation for LDAPRebind interface.
 
Field Summary
static java.lang.String DEFAULT_HOST
           
static int DEFAULT_LDAP_VERSION
           
static int DEFAULT_PORT
           
static int DEFAULT_SSL_PORT
           
static java.lang.String P_APPLET
           
static java.lang.String P_ATTRS_ONLY
           
static java.lang.String P_AUTHORITATIVE
           
static java.lang.String P_BATCHSIZE
           
static java.lang.String P_BINARY_ATTRS
           
static java.lang.String P_CIPHER_SUITE
           
static java.lang.String P_CONNECT_CTRLS
           
static java.lang.String P_DELETE_OLDRDN
           
static java.lang.String P_DEREF_ALIASES
           
static java.lang.String P_JNDIREF_SEPARATOR
           
static java.lang.String P_LANGUAGE
           
static java.lang.String P_LDAP_VERSION
           
static java.lang.String P_MAX_RESULTS
           
static java.lang.String P_PROVIDER_URL
           
static java.lang.String P_REFERRAL_HOPLIMIT
           
static java.lang.String P_REFERRAL_MODE
           
static java.lang.String P_SASL_AUTHID
           
static java.lang.String P_SASL_CALLBACK
           
static java.lang.String P_SASL_PKGS
           
static java.lang.String P_SECURITY_AUTHMODE
           
static java.lang.String P_SECURITY_PROTOCOL
           
static java.lang.String P_SOCKET_FACTORY
           
static java.lang.String P_TIME_LIMIT
           
static java.lang.String P_TRACE
           
static java.lang.String P_USER_DN
           
static java.lang.String P_USER_PASSWORD
           
 
Fields inherited from class com.netscape.jndi.ldap.common.ShareableEnv
m_parentEnv, m_parentSharedEnvIdx, m_privateEnv, m_sharedEnv
 
Constructor Summary
ContextEnv(java.util.Hashtable initialEnv)
          Constructor for the root context
ContextEnv(ShareableEnv parent, int parentSharedEnvIdx)
          Constructor for non root Contexts
 
Method Summary
 java.lang.Object clone()
          Clone ShareableEnv The code is the same as in the superclass (ShareableEnv) except that a ContextEnv instance is returned
(package private)  boolean getAttrsOnlyFlag()
          Flag whether search operation should return attribute names only (no values).
(package private)  java.lang.Object getCipherSuite()
          Get cipher suite for the socket factory
(package private)  LDAPControl[] getConnectControls()
          Get controls to be used during a connection request like ProxyAuth
(package private)  boolean getDeleteOldRDNFlag()
          Flag whether rename operation should delete old RDN Read environment property P_ATTRS_ONLY.
(package private)  LDAPUrl getDirectoryServerURL()
          Get the Directory Server URL
(package private)  int getLdapVersion()
          Get Ldap Version.
(package private)  char getRefSeparator()
          A user defined value for the separator for JNDI References.
(package private)  java.lang.String getSaslAuthId()
          Return DN to be used for sasl auth.
(package private)  java.lang.Object getSaslCallback()
          Return the callback object for sasl, if specified
(package private)  java.lang.String[] getSaslMechanisms()
          Check if sasl auth mode is requested.
(package private)  java.util.Hashtable getSaslProps()
          Returned all sasl properties (startwith javax.security.sasl) except AUTHID and CALLBACK, as a Hashtable.
(package private)  java.lang.String getSocketFactory()
          Get full qualified socket factory class name
(package private)  java.lang.String[] getUserDefBinaryAttrs()
          A user defined list of names of binary attributes.
(package private)  java.lang.String getUserDN()
          Get user authenticate name
(package private)  java.lang.String getUserPassword()
          Get user authenticate password
(package private)  boolean ignoreReferralsMode()
          Check if referrals are to be ignored
(package private)  boolean isSSLEnabled()
          Check if SSL mode is enabled
(package private)  void updateBatchSize(LDAPSearchConstraints cons)
          Set the suggested number of result to return at a time during search in the default SearchConstraints for the connection.
(package private)  void updateDerefAliases(LDAPSearchConstraints cons)
          Set how aliases should be dereferenced under default SearchConstraints for the connection.
(package private)  void updateMaxResults(LDAPSearchConstraints cons)
          Set the maximum number of search results to be returned under default SearchConstraints for the connection.
(package private)  java.lang.Object updateProperty(java.lang.String name, java.lang.Object val, LDAPSearchConstraints cons)
          Update property value.
(package private)  void updateReferralHopLimit(LDAPSearchConstraints cons)
          Set maximal number of referral hops under default SearchConstraints for the connection.
(package private)  void updateReferralMode(LDAPSearchConstraints cons)
          Set referral parameters for the default SearchConstraints for the connection.
(package private)  void updateSearchCons(LDAPSearchConstraints cons)
          Initialize LDAPSearchConstraints with environment properties
(package private)  void updateTimeLimit(LDAPSearchConstraints cons)
          Set the maximum number of miliseconds to wait for any operation under default SearchConstraints for the connection.
 
Methods inherited from class com.netscape.jndi.ldap.common.ShareableEnv
freezeUpdates, getAllProperties, getProperty, main, removeProperty, setProperty, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_HOST

public static final java.lang.String DEFAULT_HOST
See Also:
Constant Field Values

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values

DEFAULT_SSL_PORT

public static final int DEFAULT_SSL_PORT
See Also:
Constant Field Values

DEFAULT_LDAP_VERSION

public static final int DEFAULT_LDAP_VERSION
See Also:
Constant Field Values

P_PROVIDER_URL

public static final java.lang.String P_PROVIDER_URL
See Also:
Constant Field Values

P_SECURITY_PROTOCOL

public static final java.lang.String P_SECURITY_PROTOCOL
See Also:
Constant Field Values

P_SECURITY_AUTHMODE

public static final java.lang.String P_SECURITY_AUTHMODE
See Also:
Constant Field Values

P_USER_DN

public static final java.lang.String P_USER_DN
See Also:
Constant Field Values

P_USER_PASSWORD

public static final java.lang.String P_USER_PASSWORD
See Also:
Constant Field Values

P_APPLET

public static final java.lang.String P_APPLET
See Also:
Constant Field Values

P_AUTHORITATIVE

public static final java.lang.String P_AUTHORITATIVE
See Also:
Constant Field Values

P_LANGUAGE

public static final java.lang.String P_LANGUAGE
See Also:
Constant Field Values

P_BATCHSIZE

public static final java.lang.String P_BATCHSIZE
See Also:
Constant Field Values

P_REFERRAL_MODE

public static final java.lang.String P_REFERRAL_MODE
See Also:
Constant Field Values

P_CONNECT_CTRLS

public static final java.lang.String P_CONNECT_CTRLS
See Also:
Constant Field Values

P_BINARY_ATTRS

public static final java.lang.String P_BINARY_ATTRS
See Also:
Constant Field Values

P_ATTRS_ONLY

public static final java.lang.String P_ATTRS_ONLY
See Also:
Constant Field Values

P_DELETE_OLDRDN

public static final java.lang.String P_DELETE_OLDRDN
See Also:
Constant Field Values

P_SOCKET_FACTORY

public static final java.lang.String P_SOCKET_FACTORY
See Also:
Constant Field Values

P_CIPHER_SUITE

public static final java.lang.String P_CIPHER_SUITE
See Also:
Constant Field Values

P_TIME_LIMIT

public static final java.lang.String P_TIME_LIMIT
See Also:
Constant Field Values

P_MAX_RESULTS

public static final java.lang.String P_MAX_RESULTS
See Also:
Constant Field Values

P_DEREF_ALIASES

public static final java.lang.String P_DEREF_ALIASES
See Also:
Constant Field Values

P_REFERRAL_HOPLIMIT

public static final java.lang.String P_REFERRAL_HOPLIMIT
See Also:
Constant Field Values

P_LDAP_VERSION

public static final java.lang.String P_LDAP_VERSION
See Also:
Constant Field Values

P_JNDIREF_SEPARATOR

public static final java.lang.String P_JNDIREF_SEPARATOR
See Also:
Constant Field Values

P_SASL_AUTHID

public static final java.lang.String P_SASL_AUTHID
See Also:
Constant Field Values

P_SASL_CALLBACK

public static final java.lang.String P_SASL_CALLBACK
See Also:
Constant Field Values

P_SASL_PKGS

public static final java.lang.String P_SASL_PKGS
See Also:
Constant Field Values

P_TRACE

public static final java.lang.String P_TRACE
See Also:
Constant Field Values
Constructor Detail

ContextEnv

public ContextEnv(ShareableEnv parent,
                  int parentSharedEnvIdx)
Constructor for non root Contexts

Parameters:
parent - A reference to the parent context environment
parentSharedEnvIdx - index into parent's shared environemnt list

ContextEnv

public ContextEnv(java.util.Hashtable initialEnv)
Constructor for the root context

Parameters:
initialEnv - a hashtable with environemnt properties
Method Detail

clone

public java.lang.Object clone()
Clone ShareableEnv The code is the same as in the superclass (ShareableEnv) except that a ContextEnv instance is returned

Overrides:
clone in class ShareableEnv
Returns:
A "clone" of the current context environment

updateProperty

java.lang.Object updateProperty(java.lang.String name,
                                java.lang.Object val,
                                LDAPSearchConstraints cons)
                          throws javax.naming.NamingException
Update property value. Properties that pertain to LDAPSearchConstraints are immediately propagated. To take effect of properties that are connection related, (like user name/password, ssl mode) the context mujst be reconnected after the change of environment

Throws:
javax.naming.NamingException

updateSearchCons

void updateSearchCons(LDAPSearchConstraints cons)
                throws javax.naming.NamingException
Initialize LDAPSearchConstraints with environment properties

Throws:
javax.naming.NamingException

updateBatchSize

void updateBatchSize(LDAPSearchConstraints cons)
Set the suggested number of result to return at a time during search in the default SearchConstraints for the connection. Specified with the env property java.naming.batchsize


updateTimeLimit

void updateTimeLimit(LDAPSearchConstraints cons)
Set the maximum number of miliseconds to wait for any operation under default SearchConstraints for the connection. Specified with the env property java.naming.ldap.timelimit Note: sun ldap does not have this property


updateMaxResults

void updateMaxResults(LDAPSearchConstraints cons)
Set the maximum number of search results to be returned under default SearchConstraints for the connection. Specified with the env property java.naming.ldap.maxresults Note: sun ldap does not have this property


updateDerefAliases

final void updateDerefAliases(LDAPSearchConstraints cons)
                       throws java.lang.IllegalArgumentException
Set how aliases should be dereferenced under default SearchConstraints for the connection. Specified with the env property java.naming.ldap.derefAliases

Throws:
java.lang.IllegalArgumentException

updateReferralMode

void updateReferralMode(LDAPSearchConstraints cons)
Set referral parameters for the default SearchConstraints for the connection. Specified with the env property java.naming.referral


ignoreReferralsMode

boolean ignoreReferralsMode()
Check if referrals are to be ignored


updateReferralHopLimit

void updateReferralHopLimit(LDAPSearchConstraints cons)
                      throws java.lang.IllegalArgumentException
Set maximal number of referral hops under default SearchConstraints for the connection. Specified with the env property java.naming.referral.limit

Throws:
java.lang.IllegalArgumentException

isSSLEnabled

boolean isSSLEnabled()
               throws javax.naming.NamingException
Check if SSL mode is enabled

Throws:
javax.naming.NamingException

getDirectoryServerURL

LDAPUrl getDirectoryServerURL()
                        throws javax.naming.NamingException
Get the Directory Server URL

Throws:
javax.naming.NamingException

getLdapVersion

int getLdapVersion()
             throws javax.naming.NamingException
Get Ldap Version. If not specified the default is version 3

Throws:
javax.naming.NamingException

getUserDN

java.lang.String getUserDN()
Get user authenticate name


getUserPassword

java.lang.String getUserPassword()
Get user authenticate password


getSocketFactory

java.lang.String getSocketFactory()
Get full qualified socket factory class name


getCipherSuite

java.lang.Object getCipherSuite()
Get cipher suite for the socket factory


getConnectControls

LDAPControl[] getConnectControls()
                           throws javax.naming.NamingException
Get controls to be used during a connection request like ProxyAuth

Throws:
javax.naming.NamingException

getAttrsOnlyFlag

boolean getAttrsOnlyFlag()
Flag whether search operation should return attribute names only (no values). Read environment property P_ATTRS_ONLY. If not defined FALSE is returned (return attribute values by default)


getDeleteOldRDNFlag

boolean getDeleteOldRDNFlag()
Flag whether rename operation should delete old RDN Read environment property P_ATTRS_ONLY. If not defined TRUE is returned (delete old RDN by default)


getRefSeparator

char getRefSeparator()
               throws javax.naming.NamingException
A user defined value for the separator for JNDI References. The default value is '#'. Read environment property P_JNDIREF_SEPARATOR.

Throws:
javax.naming.NamingException

getUserDefBinaryAttrs

java.lang.String[] getUserDefBinaryAttrs()
A user defined list of names of binary attributes. This list augments the default list of well-known binary attributes. List entries are space separated Read environment property P_BINARY_ATTRS.


getSaslMechanisms

java.lang.String[] getSaslMechanisms()
Check if sasl auth mode is requested. If the value of auth property is neither of (null, none, or simple) then assume it is a space separated list of sasl mechanis names


getSaslProps

java.util.Hashtable getSaslProps()
Returned all sasl properties (startwith javax.security.sasl) except AUTHID and CALLBACK, as a Hashtable. AUTHID and CALLBACK as used directly as parameters to authenticate()


getSaslAuthId

java.lang.String getSaslAuthId()
Return DN to be used for sasl auth. Check first the P_SASL_AUTHID property, then fallback to P_USERDN if not defined.


getSaslCallback

java.lang.Object getSaslCallback()
Return the callback object for sasl, if specified