Class ContextEnv

All Implemented Interfaces:
Cloneable

class ContextEnv extends ShareableEnv
Context Environment
  • Field Details

  • Constructor Details

    • 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(Hashtable<Object,Object> initialEnv)
      Constructor for the root context
      Parameters:
      initialEnv - a hashtable with environemnt properties
  • Method Details

    • clone

      public 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

      Object updateProperty(String name, Object val, LDAPSearchConstraints cons) throws 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:
      NamingException
    • updateSearchCons

      void updateSearchCons(LDAPSearchConstraints cons) throws NamingException
      Initialize LDAPSearchConstraints with environment properties
      Throws:
      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 milliseconds 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 IllegalArgumentException
      Set how aliases should be dereferenced under default SearchConstraints for the connection. Specified with the env property java.naming.ldap.derefAliases
      Throws:
      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 IllegalArgumentException
      Set maximal number of referral hops under default SearchConstraints for the connection. Specified with the env property java.naming.referral.limit
      Throws:
      IllegalArgumentException
    • isSSLEnabled

      boolean isSSLEnabled() throws NamingException
      Check if SSL mode is enabled
      Throws:
      NamingException
    • getDirectoryServerURL

      LDAPUrl getDirectoryServerURL() throws NamingException
      Get the Directory Server URL
      Throws:
      NamingException
    • getLdapVersion

      int getLdapVersion() throws NamingException
      Get Ldap Version. If not specified the default is version 3
      Throws:
      NamingException
    • getUserDN

      String getUserDN()
      Get user authenticate name
    • getUserPassword

      String getUserPassword()
      Get user authenticate password
    • getSocketFactory

      String getSocketFactory()
      Get full qualified socket factory class name
    • getCipherSuite

      Object getCipherSuite()
      Get cipher suite for the socket factory
    • getConnectControls

      LDAPControl[] getConnectControls() throws NamingException
      Get controls to be used during a connection request like ProxyAuth
      Throws:
      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 NamingException
      A user defined value for the separator for JNDI References. The default value is '#'. Read environment property P_JNDIREF_SEPARATOR.
      Throws:
      NamingException
    • getUserDefBinaryAttrs

      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

      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

      Hashtable<Object,Object> 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

      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

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