Package netscape.ldap

Interface LDAPAsynchronousConnection

  • All Known Implementing Classes:
    LDAPConnection

    public interface LDAPAsynchronousConnection
    Encapsulates a connection to an LDAP server, providing access to the input queue for messages received.
    Version:
    1.0
    • Method Detail

      • add

        LDAPResponseListener add​(LDAPEntry entry,
                                 LDAPResponseListener listener)
                          throws LDAPException
        Adds an entry to the directory.
        Parameters:
        entry - LDAPEntry object specifying the distinguished name and attributes of the new entry
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        Returns:
        LDAPSearchListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        LDAPEntry, LDAPResponseListener
      • add

        LDAPResponseListener add​(LDAPEntry entry,
                                 LDAPResponseListener listener,
                                 LDAPConstraints cons)
                          throws LDAPException
        Adds an entry to the directory and allows you to specify constraints for this LDAP add operation by using an LDAPConstraints object. For example, you can specify whether or not to follow referrals. You can also apply LDAP v3 controls to the operation.

        Parameters:
        entry - LDAPEntry object specifying the distinguished name and attributes of the new entry
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        cons - constraints specific to the operation
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        LDAPEntry, LDAPResponseListener, LDAPConstraints
      • bind

        LDAPResponseListener bind​(java.lang.String dn,
                                  java.lang.String passwd,
                                  LDAPResponseListener listener)
                           throws LDAPException
        Authenticates to the LDAP server (that the object is currently connected to) using the specified name and password. If the object has been disconnected from an LDAP server, this method attempts to reconnect to the server. If the object had already authenticated, the old authentication is discarded.
        Parameters:
        dn - if non-null and non-empty, specifies that the connection and all operations through it should be authenticated with dn as the distinguished name
        passwd - if non-null and non-empty, specifies that the connection and all operations through it should be authenticated with dn as the distinguished name and passwd as password
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        LDAPResponseListener
      • bind

        LDAPResponseListener bind​(java.lang.String dn,
                                  java.lang.String passwd,
                                  LDAPResponseListener listener,
                                  LDAPConstraints cons)
                           throws LDAPException
        Authenticates to the LDAP server (that the object is currently connected to) using the specified name and password and allows you to specify constraints for this LDAP add operation by using an LDAPConstraints object. If the object has been disconnected from an LDAP server, this method attempts to reconnect to the server. If the object had already authenticated, the old authentication is discarded.
        Parameters:
        dn - if non-null and non-empty, specifies that the connection and all operations through it should be authenticated with dn as the distinguished name
        passwd - if non-null and non-empty, specifies that the connection and all operations through it should be authenticated with dn as the distinguished name and passwd as password
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        cons - constraints specific to the operation
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        LDAPResponseListener, LDAPConstraints
      • delete

        LDAPResponseListener delete​(java.lang.String dn,
                                    LDAPResponseListener listener)
                             throws LDAPException
        Deletes the entry for the specified DN from the directory.
        Parameters:
        dn - distinguished name of the entry to delete
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        LDAPResponseListener, LDAPConstraints
      • delete

        LDAPResponseListener delete​(java.lang.String dn,
                                    LDAPResponseListener listener,
                                    LDAPConstraints cons)
                             throws LDAPException
        Deletes the entry for the specified DN from the directory.
        Parameters:
        dn - distinguished name of the entry to delete
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        cons - constraints specific to the operation
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        LDAPResponseListener, LDAPConstraints
      • modify

        LDAPResponseListener modify​(java.lang.String dn,
                                    LDAPModification mod,
                                    LDAPResponseListener listener)
                             throws LDAPException
        Makes a single change to an existing entry in the directory. For example, changes the value of an attribute, adds a new attribute value, or removes an existing attribute value.
        The LDAPModification object specifies both the change to be made and the LDAPAttribute value to be changed.
        Parameters:
        dn - distinguished name of the entry to modify
        mod - a single change to make to an entry
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        LDAPModification, LDAPResponseListener
      • modify

        LDAPResponseListener modify​(java.lang.String dn,
                                    LDAPModification mod,
                                    LDAPResponseListener listener,
                                    LDAPConstraints cons)
                             throws LDAPException
        Makes a single change to an existing entry in the directory. For example, changes the value of an attribute, adds a new attribute value, or removes an existing attribute value.
        The LDAPModification object specifies both the change to be made and the LDAPAttribute value to be changed.
        Parameters:
        dn - distinguished name of the entry to modify
        mod - a single change to make to an entry
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        cons - constraints specific to the operation
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        LDAPModification, LDAPResponseListener, LDAPConstraints
      • modify

        LDAPResponseListener modify​(java.lang.String dn,
                                    LDAPModificationSet mods,
                                    LDAPResponseListener listener)
                             throws LDAPException
        Makes a set of changes to an existing entry in the directory. For example, changes attribute values, adds new attribute values, or removes existing attribute values.

        Parameters:
        dn - distinguished name of the entry to modify
        mods - a set of modifications to make to the entry
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        LDAPModificationSet, LDAPResponseListener
      • modify

        LDAPResponseListener modify​(java.lang.String dn,
                                    LDAPModificationSet mods,
                                    LDAPResponseListener listener,
                                    LDAPConstraints cons)
                             throws LDAPException
        Makes a set of changes to an existing entry in the directory. For example, changes attribute values, adds new attribute values, or removes existing attribute values.
        Parameters:
        dn - distinguished name of the entry to modify
        mods - a set of modifications to make to the entry
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        cons - constraints specific to the operation
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        LDAPModificationSet, LDAPResponseListener, LDAPConstraints
      • rename

        LDAPResponseListener rename​(java.lang.String dn,
                                    java.lang.String newRdn,
                                    boolean deleteOldRdn,
                                    LDAPResponseListener listener)
                             throws LDAPException
        Renames an existing entry in the directory.
        Parameters:
        dn - current distinguished name of the entry
        newRdn - new relative distinguished name for the entry
        deleteOldRdn - if true, the old name is not retained as an attribute value
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        LDAPResponseListener
      • rename

        LDAPResponseListener rename​(java.lang.String dn,
                                    java.lang.String newRdn,
                                    boolean deleteOldRdn,
                                    LDAPResponseListener listener,
                                    LDAPConstraints cons)
                             throws LDAPException
        Renames an existing entry in the directory.
        Parameters:
        dn - current distinguished name of the entry
        newRdn - new relative distinguished name for the entry
        deleteOldRdn - if true, the old name is not retained as an attribute value
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        cons - constraints specific to the operation
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        LDAPResponseListener, LDAPConstraints
      • search

        LDAPSearchListener search​(java.lang.String base,
                                  int scope,
                                  java.lang.String filter,
                                  java.lang.String[] attrs,
                                  boolean typesOnly,
                                  LDAPSearchListener listener)
                           throws LDAPException
        Performs the search specified by the criteria that you enter.

        To abandon the search, use the abandon method.

        Parameters:
        base - the base distinguished name from which to search
        scope - the scope of the entries to search. You can specify one of the following:

        • LDAPv2.SCOPE_BASE (search only the base DN)

        • LDAPv2.SCOPE_ONE (search only those entries that are one level below the base DN)

        • LDAPv2.SCOPE_SUB (search the base DN and all entries within its subtree)

        filter - search filter specifying the search criteria
        attrs - list of attributes to return in the search results
        typesOnly - if true, returns the names but not the values of the attributes found. If false, returns the names and values of the attributes found.
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        Returns:
        LDAPSearchListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        abandon(netscape.ldap.LDAPSearchListener)
      • search

        LDAPSearchListener search​(java.lang.String base,
                                  int scope,
                                  java.lang.String filter,
                                  java.lang.String[] attrs,
                                  boolean typesOnly,
                                  LDAPSearchListener listener,
                                  LDAPSearchConstraints cons)
                           throws LDAPException
        Performs the search specified by the criteria that you enter. This method also allows you to specify constraints for the search (such as the maximum number of entries to find or the maximum time to wait for search results).

        To abandon the search, use the abandon method.

        Parameters:
        base - the base distinguished name from which to search
        scope - the scope of the entries to search. You can specify one of the following:

        • LDAPv2.SCOPE_BASE (search only the base DN)

        • LDAPv2.SCOPE_ONE (search only those entries that are one level below the base DN)

        • LDAPv2.SCOPE_SUB (search the base DN and all entries within its subtree)

        filter - search filter specifying the search criteria
        attrs - list of attributes to return in the search results
        typesOnly - if true, returns the names but not the values of the attributes found. If false, returns the names and values for attributes found.
        listener - handler for messages returned from a server in response to this request. If it is null, a listener object is created internally.
        cons - constraints specific to this search (for example, the maximum number of entries to return)
        Returns:
        LDAPSearchListener handler for messages returned from a server in response to this request.
        Throws:
        LDAPException - Failed to send request.
        See Also:
        abandon(netscape.ldap.LDAPSearchListener)
      • compare

        LDAPResponseListener compare​(java.lang.String dn,
                                     LDAPAttribute attr,
                                     LDAPResponseListener listener)
                              throws LDAPException
        Compares an attribute value with one in the directory. The result is obtained by calling getResultCode on the LDAPResponse from the LDAPResponseListener. The code will be LDAPException.COMPARE_TRUE or LDAPException.COMPARE_FALSE.
        Parameters:
        dn - distinguished name of the entry to compare
        attr - attribute with a value to compare
        listener - handler for messages returned from a server in response to the specified request. If it is null, a listener object is created internally.
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to the specified request.
        Throws:
        LDAPException - Failed to send request.
      • compare

        LDAPResponseListener compare​(java.lang.String dn,
                                     LDAPAttribute attr,
                                     LDAPResponseListener listener,
                                     LDAPConstraints cons)
                              throws LDAPException
        Compares an attribute value with one in the directory. The result is obtained by calling getResultCode on the LDAPResponse from the LDAPResponseListener. The code will be LDAPException.COMPARE_TRUE or LDAPException.COMPARE_FALSE.
        Parameters:
        dn - distinguished name of the entry to compare
        attr - attribute with a value to compare
        listener - handler for messages returned from a server in response to the specified request. If it is null, a listener object is created internally.
        cons - constraints specific to this operation
        Returns:
        LDAPResponseListener handler for messages returned from a server in response to the specified request.
        Throws:
        LDAPException - Failed to send request.
      • abandon

        void abandon​(int id)
              throws LDAPException
        Cancels the ldap request with the specified id and discards any results already received.
        Parameters:
        id - an LDAP request ID
        Throws:
        LDAPException - Failed to send request.
      • abandon

        void abandon​(LDAPSearchListener searchlistener)
              throws LDAPException
        Cancels all outstanding search requests associated with this LDAPSearchListener object and discards any results already received.
        Parameters:
        searchlistener - a search listener returned from a search
        Throws:
        LDAPException - Failed to send request.