Class DirContextAdapter

    • Field Summary

      • Fields inherited from interface javax.naming.Context

        APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
      • Fields inherited from interface javax.naming.directory.DirContext

        ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        DirContextAdapter()
      Default constructor.
        DirContextAdapter​(java.lang.String dnString)
      Create a new DirContextAdapter from the supplied DN String.
        DirContextAdapter​(javax.naming.directory.Attributes attrs, javax.naming.Name dn)
      Create a new adapter from the supplied attributes and dn.
        DirContextAdapter​(javax.naming.directory.Attributes attrs, javax.naming.Name dn, javax.naming.Name base)
      Create a new adapter from the supplied attributes, dn, and base.
        DirContextAdapter​(javax.naming.directory.Attributes attrs, javax.naming.Name dn, javax.naming.Name base, java.lang.String referralUrl)
      Create a new adapter from the supplied attributes, dn, base, and referral url.
        DirContextAdapter​(javax.naming.Name dn)
      Create a new adapter from the supplied dn.
      protected DirContextAdapter​(DirContextAdapter main)
      Constructor for cloning an existing adapter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAttributeValue​(java.lang.String name, java.lang.Object value)
      Add a value to the Attribute with the specified name.
      void addAttributeValue​(java.lang.String name, java.lang.Object value, boolean addIfDuplicateExists)
      Add a value to the Attribute with the specified name.
      java.lang.Object addToEnvironment​(java.lang.String propName, java.lang.Object propVal)
      boolean attributeExists​(java.lang.String name)
      Check if an Object attribute exists, regardless of whether it has a value or not.
      void bind​(java.lang.String name, java.lang.Object obj)
      void bind​(java.lang.String name, java.lang.Object obj, javax.naming.directory.Attributes attrs)
      void bind​(javax.naming.Name name, java.lang.Object obj)
      void bind​(javax.naming.Name name, java.lang.Object obj, javax.naming.directory.Attributes attrs)
      void close()
      java.lang.String composeName​(java.lang.String name, java.lang.String prefix)
      javax.naming.Name composeName​(javax.naming.Name name, javax.naming.Name prefix)
      javax.naming.Context createSubcontext​(java.lang.String name)
      javax.naming.directory.DirContext createSubcontext​(java.lang.String name, javax.naming.directory.Attributes attrs)
      javax.naming.Context createSubcontext​(javax.naming.Name name)
      javax.naming.directory.DirContext createSubcontext​(javax.naming.Name name, javax.naming.directory.Attributes attrs)
      void destroySubcontext​(java.lang.String name)
      void destroySubcontext​(javax.naming.Name name)
      boolean equals​(java.lang.Object o)
      protected boolean exists​(java.lang.String attrId)
      Checks if the attribute exists in this entry, either it was read or it has been added and update() has been called.
      protected boolean exists​(javax.naming.directory.Attribute attr)
      Checks if an entry has a specific attribute.
      javax.naming.directory.Attributes getAttributes()
      Get all attributes.
      javax.naming.directory.Attributes getAttributes​(java.lang.String name)
      javax.naming.directory.Attributes getAttributes​(java.lang.String name, java.lang.String[] attrIds)
      javax.naming.directory.Attributes getAttributes​(javax.naming.Name name)
      javax.naming.directory.Attributes getAttributes​(javax.naming.Name name, java.lang.String[] attrIds)
      java.util.SortedSet<java.lang.String> getAttributeSortedStringSet​(java.lang.String name)
      Get all String values of the attribute as a SortedSet.
      javax.naming.Name getDn()
      Returns the DN relative to the base path.
      java.util.Hashtable<?,​?> getEnvironment()
      javax.naming.directory.ModificationItem[] getModificationItems()
      Creates an array of which attributes have been changed, added or removed since the initialization of this object.
      java.lang.String getNameInNamespace()
      javax.naming.NameParser getNameParser​(java.lang.String name)
      javax.naming.NameParser getNameParser​(javax.naming.Name name)
      java.lang.String[] getNamesOfModifiedAttributes()
      Creates a String array of the names of the attributes which have been changed.
      java.lang.Object getObjectAttribute​(java.lang.String name)
      Get the value of an Object attribute.
      java.lang.Object[] getObjectAttributes​(java.lang.String name)
      Get all values of an Object attribute.
      java.lang.String getReferralUrl()
      If this instance results from a referral, this method returns the url of the referred server.
      javax.naming.directory.DirContext getSchema​(java.lang.String name)
      javax.naming.directory.DirContext getSchema​(javax.naming.Name name)
      javax.naming.directory.DirContext getSchemaClassDefinition​(java.lang.String name)
      javax.naming.directory.DirContext getSchemaClassDefinition​(javax.naming.Name name)
      java.lang.String getStringAttribute​(java.lang.String name)
      Get the value of a String attribute.
      java.lang.String[] getStringAttributes​(java.lang.String name)
      Get all values of a String attribute.
      int hashCode()
      boolean isReferral()
      Checks whether this instance results from a referral.
      boolean isUpdateMode()
      Gets the update mode.
      javax.naming.NamingEnumeration<javax.naming.NameClassPair> list​(java.lang.String name)
      javax.naming.NamingEnumeration<javax.naming.NameClassPair> list​(javax.naming.Name name)
      javax.naming.NamingEnumeration<javax.naming.Binding> listBindings​(java.lang.String name)
      javax.naming.NamingEnumeration<javax.naming.Binding> listBindings​(javax.naming.Name name)
      java.lang.Object lookup​(java.lang.String name)
      java.lang.Object lookup​(javax.naming.Name name)
      java.lang.Object lookupLink​(java.lang.String name)
      java.lang.Object lookupLink​(javax.naming.Name name)
      void modifyAttributes​(java.lang.String name, int modOp, javax.naming.directory.Attributes attrs)
      void modifyAttributes​(java.lang.String name, javax.naming.directory.ModificationItem[] mods)
      void modifyAttributes​(javax.naming.Name name, int modOp, javax.naming.directory.Attributes attrs)
      void modifyAttributes​(javax.naming.Name name, javax.naming.directory.ModificationItem[] mods)
      void rebind​(java.lang.String name, java.lang.Object obj)
      void rebind​(java.lang.String name, java.lang.Object obj, javax.naming.directory.Attributes attrs)
      void rebind​(javax.naming.Name name, java.lang.Object obj)
      void rebind​(javax.naming.Name name, java.lang.Object obj, javax.naming.directory.Attributes attrs)
      void removeAttributeValue​(java.lang.String name, java.lang.Object value)
      Remove a value from the Attribute with the specified name.
      java.lang.Object removeFromEnvironment​(java.lang.String propName)
      void rename​(java.lang.String oldName, java.lang.String newName)
      void rename​(javax.naming.Name oldName, javax.naming.Name newName)
      javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(java.lang.String name, java.lang.String filterExpr, java.lang.Object[] filterArgs, javax.naming.directory.SearchControls cons)
      javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(java.lang.String name, java.lang.String filter, javax.naming.directory.SearchControls cons)
      javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(java.lang.String name, javax.naming.directory.Attributes matchingAttributes)
      javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(java.lang.String name, javax.naming.directory.Attributes matchingAttributes, java.lang.String[] attributesToReturn)
      javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(javax.naming.Name name, java.lang.String filterExpr, java.lang.Object[] filterArgs, javax.naming.directory.SearchControls cons)
      javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(javax.naming.Name name, java.lang.String filter, javax.naming.directory.SearchControls cons)
      javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(javax.naming.Name name, javax.naming.directory.Attributes matchingAttributes)
      javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(javax.naming.Name name, javax.naming.directory.Attributes matchingAttributes, java.lang.String[] attributesToReturn)
      void setAttribute​(javax.naming.directory.Attribute attribute)
      Set the supplied attribute.
      void setAttributeValue​(java.lang.String name, java.lang.Object value)
      Set the with the name name to the value.
      void setAttributeValues​(java.lang.String name, java.lang.Object[] values)
      Sets a multivalue attribute, disregarding the order of the values.
      void setAttributeValues​(java.lang.String name, java.lang.Object[] values, boolean orderMatters)
      Sets a multivalue attribute.
      void setDn​(javax.naming.Name dn)
      Set the dn of this entry.
      void setUpdateMode​(boolean mode)
      Sets the update mode.
      java.lang.String toString()
      void unbind​(java.lang.String name)
      void unbind​(javax.naming.Name name)
      void update()
      Update the attributes.This will mean that the getters ( getStringAttribute methods) will return the updated values, and the modifications will be forgotten (i.e.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DirContextAdapter

        public DirContextAdapter()
        Default constructor.
      • DirContextAdapter

        public DirContextAdapter​(java.lang.String dnString)
        Create a new DirContextAdapter from the supplied DN String.
        Parameters:
        dnString - the DN string. Must be syntactically correct, or an exception will be thrown.
      • DirContextAdapter

        public DirContextAdapter​(javax.naming.Name dn)
        Create a new adapter from the supplied dn.
        Parameters:
        dn - the dn.
      • DirContextAdapter

        public DirContextAdapter​(javax.naming.directory.Attributes attrs,
                                 javax.naming.Name dn)
        Create a new adapter from the supplied attributes and dn.
        Parameters:
        attrs - the attributes.
        dn - the dn.
      • DirContextAdapter

        public DirContextAdapter​(javax.naming.directory.Attributes attrs,
                                 javax.naming.Name dn,
                                 javax.naming.Name base)
        Create a new adapter from the supplied attributes, dn, and base.
        Parameters:
        attrs - the attributes.
        dn - the dn.
        base - the base name.
      • DirContextAdapter

        public DirContextAdapter​(javax.naming.directory.Attributes attrs,
                                 javax.naming.Name dn,
                                 javax.naming.Name base,
                                 java.lang.String referralUrl)
        Create a new adapter from the supplied attributes, dn, base, and referral url.
        Parameters:
        attrs - the attributes.
        dn - the dn.
        base - the base.
        referralUrl - the referral url (if this instance results from a referral).
      • DirContextAdapter

        protected DirContextAdapter​(DirContextAdapter main)
        Constructor for cloning an existing adapter.
        Parameters:
        main - The adapter to be copied.
    • Method Detail

      • setUpdateMode

        public void setUpdateMode​(boolean mode)
        Sets the update mode. The update mode should be false for a new entry and true for an existing entry that is being updated.
        Parameters:
        mode - Update mode.
      • getNamesOfModifiedAttributes

        public java.lang.String[] getNamesOfModifiedAttributes()
        Creates a String array of the names of the attributes which have been changed. If this is a new entry, all set entries will be in the list. If this is an updated entry, only changed and removed entries will be in the array.
        Specified by:
        getNamesOfModifiedAttributes in interface DirContextOperations
        Returns:
        Array of String
      • getModificationItems

        public javax.naming.directory.ModificationItem[] getModificationItems()
        Creates an array of which attributes have been changed, added or removed since the initialization of this object.
        Specified by:
        getModificationItems in interface AttributeModificationsAware
        Returns:
        an array of modification items.
      • exists

        protected final boolean exists​(javax.naming.directory.Attribute attr)
        Checks if an entry has a specific attribute. This method simply calls exists(String) with the attribute name.
        Parameters:
        attr - the attribute to check.
        Returns:
        true if attribute exists in entry.
      • exists

        protected final boolean exists​(java.lang.String attrId)
        Checks if the attribute exists in this entry, either it was read or it has been added and update() has been called.
        Parameters:
        attrId - id of the attribute to check.
        Returns:
        true if the attribute exists in the entry.
      • getStringAttribute

        public java.lang.String getStringAttribute​(java.lang.String name)
        Get the value of a String attribute. If more than one attribute value exists for the specified attribute, only the first one will be returned. If an attribute has no value, null will be returned.
        Specified by:
        getStringAttribute in interface LdapDataEntry
        Parameters:
        name - name of the attribute.
        Returns:
        the value of the attribute if it exists, or null if the attribute doesn't exist or if it exists but with no value.
      • getObjectAttribute

        public java.lang.Object getObjectAttribute​(java.lang.String name)
        Get the value of an Object attribute. If more than one attribute value exists for the specified attribute, only the first one will be returned. If an attribute has no value, null will be returned.
        Specified by:
        getObjectAttribute in interface LdapDataEntry
        Parameters:
        name - name of the attribute.
        Returns:
        the attribute value as an object if it exists, or null if the attribute doesn't exist or if it exists but with no value.
      • attributeExists

        public boolean attributeExists​(java.lang.String name)
        Check if an Object attribute exists, regardless of whether it has a value or not.
        Specified by:
        attributeExists in interface LdapDataEntry
        Parameters:
        name - name of the attribute
        Returns:
        true if the attribute exists, false otherwise
      • setAttributeValue

        public void setAttributeValue​(java.lang.String name,
                                      java.lang.Object value)
        Set the with the name name to the value. If the value is a Name instance, equality for Distinguished Names will be used for calculating attribute modifications.
        Specified by:
        setAttributeValue in interface LdapDataEntry
        Parameters:
        name - name of the attribute.
        value - value to set the attribute to.
      • addAttributeValue

        public void addAttributeValue​(java.lang.String name,
                                      java.lang.Object value)
        Add a value to the Attribute with the specified name. If the Attribute doesn't exist it will be created. This method makes sure that the there will be no duplicates of an added value - it the value exists it will not be added again. If the value is a Name instance, equality for Distinguished Names will be used for calculating attribute modifications.
        Specified by:
        addAttributeValue in interface LdapDataEntry
        Parameters:
        name - the name of the Attribute to which the specified value should be added.
        value - the Attribute value to add.
      • addAttributeValue

        public void addAttributeValue​(java.lang.String name,
                                      java.lang.Object value,
                                      boolean addIfDuplicateExists)
        Add a value to the Attribute with the specified name. If the Attribute doesn't exist it will be created. The addIfDuplicateExists parameter controls the handling of duplicates. It false, this method makes sure that the there will be no duplicates of an added value - it the value exists it will not be added again. If the value is a Name instance, equality for Distinguished Names will be used for calculating attribute modifications.
        Specified by:
        addAttributeValue in interface LdapDataEntry
        Parameters:
        name - the name of the Attribute to which the specified value should be added.
        value - the Attribute value to add.
        addIfDuplicateExists - true will add the value regardless of whether there is an identical value already, allowing for duplicate attribute values; false will not add the value if it already exists.
      • removeAttributeValue

        public void removeAttributeValue​(java.lang.String name,
                                         java.lang.Object value)
        Remove a value from the Attribute with the specified name. If the Attribute doesn't exist, do nothing. If the value is a Name instance, equality for Distinguished Names will be used for calculating attribute modifications.
        Specified by:
        removeAttributeValue in interface LdapDataEntry
        Parameters:
        name - the name of the Attribute from which the specified value should be removed.
        value - the value to remove.
      • setAttributeValues

        public void setAttributeValues​(java.lang.String name,
                                       java.lang.Object[] values)
        Sets a multivalue attribute, disregarding the order of the values. If value is null or value.length == 0 then the attribute will be removed. If update mode, changes will be made only if the array has more or less objects or if one or more object has changed. Reordering the objects will not cause an update. If the values are Name instances, equality for Distinguished Names will be used for calculating attribute modifications.
        Specified by:
        setAttributeValues in interface LdapDataEntry
        Parameters:
        name - The id of the attribute.
        values - Attribute values.
      • setAttributeValues

        public void setAttributeValues​(java.lang.String name,
                                       java.lang.Object[] values,
                                       boolean orderMatters)
        Sets a multivalue attribute. If value is null or value.length == 0 then the attribute will be removed. If update mode, changes will be made if the array has more or less objects or if one or more string has changed. Reordering the objects will only cause an update if orderMatters is set to true. If the values are Name instances, equality for Distinguished Names will be used for calculating attribute modifications.
        Specified by:
        setAttributeValues in interface LdapDataEntry
        Parameters:
        name - The id of the attribute.
        values - Attribute values.
        orderMatters - If true, it will be changed even if data was just reordered.
      • getStringAttributes

        public java.lang.String[] getStringAttributes​(java.lang.String name)
        Get all values of a String attribute.
        Specified by:
        getStringAttributes in interface LdapDataEntry
        Parameters:
        name - name of the attribute.
        Returns:
        a (possibly empty) array containing all registered values of the attribute as Strings if the attribute is defined or null otherwise.
      • getObjectAttributes

        public java.lang.Object[] getObjectAttributes​(java.lang.String name)
        Get all values of an Object attribute.
        Specified by:
        getObjectAttributes in interface LdapDataEntry
        Parameters:
        name - name of the attribute.
        Returns:
        a (possibly empty) array containing all registered values of the attribute if the attribute is defined or null otherwise.
      • getAttributeSortedStringSet

        public java.util.SortedSet<java.lang.String> getAttributeSortedStringSet​(java.lang.String name)
        Get all String values of the attribute as a SortedSet.
        Specified by:
        getAttributeSortedStringSet in interface LdapDataEntry
        Parameters:
        name - name of the attribute.
        Returns:
        a SortedSet containing all values of the attribute, or null if the attribute does not exist.
      • setAttribute

        public void setAttribute​(javax.naming.directory.Attribute attribute)
        Set the supplied attribute.
        Parameters:
        attribute - the attribute to set.
      • getAttributes

        public javax.naming.directory.Attributes getAttributes()
        Get all attributes.
        Specified by:
        getAttributes in interface LdapDataEntry
        Returns:
        all attributes.
      • getAttributes

        public javax.naming.directory.Attributes getAttributes​(javax.naming.Name name)
                                                        throws javax.naming.NamingException
        Specified by:
        getAttributes in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • getAttributes

        public javax.naming.directory.Attributes getAttributes​(java.lang.String name)
                                                        throws javax.naming.NamingException
        Specified by:
        getAttributes in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • getAttributes

        public javax.naming.directory.Attributes getAttributes​(javax.naming.Name name,
                                                               java.lang.String[] attrIds)
                                                        throws javax.naming.NamingException
        Specified by:
        getAttributes in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • getAttributes

        public javax.naming.directory.Attributes getAttributes​(java.lang.String name,
                                                               java.lang.String[] attrIds)
                                                        throws javax.naming.NamingException
        Specified by:
        getAttributes in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • modifyAttributes

        public void modifyAttributes​(javax.naming.Name name,
                                     int modOp,
                                     javax.naming.directory.Attributes attrs)
                              throws javax.naming.NamingException
        Specified by:
        modifyAttributes in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • modifyAttributes

        public void modifyAttributes​(java.lang.String name,
                                     int modOp,
                                     javax.naming.directory.Attributes attrs)
                              throws javax.naming.NamingException
        Specified by:
        modifyAttributes in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • modifyAttributes

        public void modifyAttributes​(javax.naming.Name name,
                                     javax.naming.directory.ModificationItem[] mods)
                              throws javax.naming.NamingException
        Specified by:
        modifyAttributes in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • modifyAttributes

        public void modifyAttributes​(java.lang.String name,
                                     javax.naming.directory.ModificationItem[] mods)
                              throws javax.naming.NamingException
        Specified by:
        modifyAttributes in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • bind

        public void bind​(javax.naming.Name name,
                         java.lang.Object obj,
                         javax.naming.directory.Attributes attrs)
                  throws javax.naming.NamingException
        Specified by:
        bind in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • bind

        public void bind​(java.lang.String name,
                         java.lang.Object obj,
                         javax.naming.directory.Attributes attrs)
                  throws javax.naming.NamingException
        Specified by:
        bind in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • rebind

        public void rebind​(javax.naming.Name name,
                           java.lang.Object obj,
                           javax.naming.directory.Attributes attrs)
                    throws javax.naming.NamingException
        Specified by:
        rebind in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • rebind

        public void rebind​(java.lang.String name,
                           java.lang.Object obj,
                           javax.naming.directory.Attributes attrs)
                    throws javax.naming.NamingException
        Specified by:
        rebind in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • createSubcontext

        public javax.naming.directory.DirContext createSubcontext​(javax.naming.Name name,
                                                                  javax.naming.directory.Attributes attrs)
                                                           throws javax.naming.NamingException
        Specified by:
        createSubcontext in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • createSubcontext

        public javax.naming.directory.DirContext createSubcontext​(java.lang.String name,
                                                                  javax.naming.directory.Attributes attrs)
                                                           throws javax.naming.NamingException
        Specified by:
        createSubcontext in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • getSchema

        public javax.naming.directory.DirContext getSchema​(javax.naming.Name name)
                                                    throws javax.naming.NamingException
        Specified by:
        getSchema in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • getSchema

        public javax.naming.directory.DirContext getSchema​(java.lang.String name)
                                                    throws javax.naming.NamingException
        Specified by:
        getSchema in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • getSchemaClassDefinition

        public javax.naming.directory.DirContext getSchemaClassDefinition​(javax.naming.Name name)
                                                                   throws javax.naming.NamingException
        Specified by:
        getSchemaClassDefinition in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • getSchemaClassDefinition

        public javax.naming.directory.DirContext getSchemaClassDefinition​(java.lang.String name)
                                                                   throws javax.naming.NamingException
        Specified by:
        getSchemaClassDefinition in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • search

        public javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(javax.naming.Name name,
                                                                                          javax.naming.directory.Attributes matchingAttributes,
                                                                                          java.lang.String[] attributesToReturn)
                                                                                   throws javax.naming.NamingException
        Specified by:
        search in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • search

        public javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(java.lang.String name,
                                                                                          javax.naming.directory.Attributes matchingAttributes,
                                                                                          java.lang.String[] attributesToReturn)
                                                                                   throws javax.naming.NamingException
        Specified by:
        search in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • search

        public javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(javax.naming.Name name,
                                                                                          javax.naming.directory.Attributes matchingAttributes)
                                                                                   throws javax.naming.NamingException
        Specified by:
        search in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • search

        public javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(java.lang.String name,
                                                                                          javax.naming.directory.Attributes matchingAttributes)
                                                                                   throws javax.naming.NamingException
        Specified by:
        search in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • search

        public javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(javax.naming.Name name,
                                                                                          java.lang.String filter,
                                                                                          javax.naming.directory.SearchControls cons)
                                                                                   throws javax.naming.NamingException
        Specified by:
        search in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • search

        public javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(java.lang.String name,
                                                                                          java.lang.String filter,
                                                                                          javax.naming.directory.SearchControls cons)
                                                                                   throws javax.naming.NamingException
        Specified by:
        search in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • search

        public javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(javax.naming.Name name,
                                                                                          java.lang.String filterExpr,
                                                                                          java.lang.Object[] filterArgs,
                                                                                          javax.naming.directory.SearchControls cons)
                                                                                   throws javax.naming.NamingException
        Specified by:
        search in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • search

        public javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> search​(java.lang.String name,
                                                                                          java.lang.String filterExpr,
                                                                                          java.lang.Object[] filterArgs,
                                                                                          javax.naming.directory.SearchControls cons)
                                                                                   throws javax.naming.NamingException
        Specified by:
        search in interface javax.naming.directory.DirContext
        Throws:
        javax.naming.NamingException
      • lookup

        public java.lang.Object lookup​(javax.naming.Name name)
                                throws javax.naming.NamingException
        Specified by:
        lookup in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • lookup

        public java.lang.Object lookup​(java.lang.String name)
                                throws javax.naming.NamingException
        Specified by:
        lookup in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • bind

        public void bind​(javax.naming.Name name,
                         java.lang.Object obj)
                  throws javax.naming.NamingException
        Specified by:
        bind in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • bind

        public void bind​(java.lang.String name,
                         java.lang.Object obj)
                  throws javax.naming.NamingException
        Specified by:
        bind in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • rebind

        public void rebind​(javax.naming.Name name,
                           java.lang.Object obj)
                    throws javax.naming.NamingException
        Specified by:
        rebind in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • rebind

        public void rebind​(java.lang.String name,
                           java.lang.Object obj)
                    throws javax.naming.NamingException
        Specified by:
        rebind in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • unbind

        public void unbind​(javax.naming.Name name)
                    throws javax.naming.NamingException
        Specified by:
        unbind in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • unbind

        public void unbind​(java.lang.String name)
                    throws javax.naming.NamingException
        Specified by:
        unbind in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • rename

        public void rename​(javax.naming.Name oldName,
                           javax.naming.Name newName)
                    throws javax.naming.NamingException
        Specified by:
        rename in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • rename

        public void rename​(java.lang.String oldName,
                           java.lang.String newName)
                    throws javax.naming.NamingException
        Specified by:
        rename in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • list

        public javax.naming.NamingEnumeration<javax.naming.NameClassPair> list​(javax.naming.Name name)
                                                                        throws javax.naming.NamingException
        Specified by:
        list in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • list

        public javax.naming.NamingEnumeration<javax.naming.NameClassPair> list​(java.lang.String name)
                                                                        throws javax.naming.NamingException
        Specified by:
        list in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • listBindings

        public javax.naming.NamingEnumeration<javax.naming.Binding> listBindings​(javax.naming.Name name)
                                                                          throws javax.naming.NamingException
        Specified by:
        listBindings in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • listBindings

        public javax.naming.NamingEnumeration<javax.naming.Binding> listBindings​(java.lang.String name)
                                                                          throws javax.naming.NamingException
        Specified by:
        listBindings in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • destroySubcontext

        public void destroySubcontext​(javax.naming.Name name)
                               throws javax.naming.NamingException
        Specified by:
        destroySubcontext in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • destroySubcontext

        public void destroySubcontext​(java.lang.String name)
                               throws javax.naming.NamingException
        Specified by:
        destroySubcontext in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • createSubcontext

        public javax.naming.Context createSubcontext​(javax.naming.Name name)
                                              throws javax.naming.NamingException
        Specified by:
        createSubcontext in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • createSubcontext

        public javax.naming.Context createSubcontext​(java.lang.String name)
                                              throws javax.naming.NamingException
        Specified by:
        createSubcontext in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • lookupLink

        public java.lang.Object lookupLink​(javax.naming.Name name)
                                    throws javax.naming.NamingException
        Specified by:
        lookupLink in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • lookupLink

        public java.lang.Object lookupLink​(java.lang.String name)
                                    throws javax.naming.NamingException
        Specified by:
        lookupLink in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • getNameParser

        public javax.naming.NameParser getNameParser​(javax.naming.Name name)
                                              throws javax.naming.NamingException
        Specified by:
        getNameParser in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • getNameParser

        public javax.naming.NameParser getNameParser​(java.lang.String name)
                                              throws javax.naming.NamingException
        Specified by:
        getNameParser in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • composeName

        public javax.naming.Name composeName​(javax.naming.Name name,
                                             javax.naming.Name prefix)
                                      throws javax.naming.NamingException
        Specified by:
        composeName in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • composeName

        public java.lang.String composeName​(java.lang.String name,
                                            java.lang.String prefix)
                                     throws javax.naming.NamingException
        Specified by:
        composeName in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • addToEnvironment

        public java.lang.Object addToEnvironment​(java.lang.String propName,
                                                 java.lang.Object propVal)
                                          throws javax.naming.NamingException
        Specified by:
        addToEnvironment in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • removeFromEnvironment

        public java.lang.Object removeFromEnvironment​(java.lang.String propName)
                                               throws javax.naming.NamingException
        Specified by:
        removeFromEnvironment in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • getEnvironment

        public java.util.Hashtable<?,​?> getEnvironment()
                                                      throws javax.naming.NamingException
        Specified by:
        getEnvironment in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • close

        public void close()
                   throws javax.naming.NamingException
        Specified by:
        close in interface javax.naming.Context
        Throws:
        javax.naming.NamingException
      • getNameInNamespace

        public java.lang.String getNameInNamespace()
        Specified by:
        getNameInNamespace in interface javax.naming.Context
        Specified by:
        getNameInNamespace in interface DirContextOperations
      • getDn

        public javax.naming.Name getDn()
        Returns the DN relative to the base path. NB: as of version 2.0 the returned name will be an LdapName instance.
        Specified by:
        getDn in interface LdapDataEntry
        Returns:
        The distinguished name of the current context.
        See Also:
        getNameInNamespace()
      • setDn

        public final void setDn​(javax.naming.Name dn)
        Set the dn of this entry.
        Specified by:
        setDn in interface DirContextOperations
        Parameters:
        dn - the dn.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getReferralUrl

        public java.lang.String getReferralUrl()
        If this instance results from a referral, this method returns the url of the referred server.
        Specified by:
        getReferralUrl in interface DirContextOperations
        Returns:
        The url of the referred server, e.g. ldap://localhost:389, or the empty string if this is not a referral.
      • isReferral

        public boolean isReferral()
        Checks whether this instance results from a referral.
        Specified by:
        isReferral in interface DirContextOperations
        Returns:
        true if this instance results from a referral, false otherwise.