Package netscape.ldap

Interface LDAPv2

All Known Subinterfaces:
LDAPv3
All Known Implementing Classes:
LDAPConnection

@Deprecated(since="5.2.0", forRemoval=true) public interface LDAPv2
Deprecated, for removal: This API element is subject to removal in a future version.
Use netscape.ldap.LDAPConnection instead.
This interface summarizes the basic functionality available in the Lightweight Directory Access Protocol (LDAP) version 2. (See RFC 1777 for the definition of the protocol.)

In the general model for this protocol, objects exist under a directory in a particular server. Objects are identified by unique, hierarchical names called Distinguished Names, commonly abreviated "DN". An example of a DN:

  cn=Barbara Jensen,ou=Product Development,o=Ace Industry,c=us
 
Objects have attributes, of the form
  attributeName = attributeValue(s)
 
Attribute names must be Strings, and attribute values can be any 8-bit sequence (Strings or binary values).
Version:
1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Option specifying the number of results to return at a time.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Option specifying the object containing the method for authenticating to the server.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    The default port number for LDAP servers.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Option specifying how aliases are dereferenced.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Specifies that aliases are always dereferenced.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Specifies that aliases are dereferenced when finding the starting point for the search (but not when searching under that starting entry).
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Specifies that aliases are never dereferenced.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Specifies that aliases are dereferenced when searching the entries beneath the starting point of the search (but not when finding the starting entry).
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Option specifying the version of the LDAP protocol used by your client when interacting with the LDAP server.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Option specifying whether or not referrals to other LDAP servers are followed automatically.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Option specifying the maximum number of referrals to follow in a sequence when requesting an LDAP operation.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Option specifying the object containing the method for getting authentication information (the distinguished name and password) used during a referral.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Specifies that the scope of a search includes only the base DN (distinguished name).
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Specifies that the scope of a search includes only the entries one level below the base DN (distinguished name).
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Specifies that the scope of a search includes the base DN (distinguished name) and all entries at all levels beneath that base.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Option specifying the maximum number of milliseconds the server should spend returning search results before aborting the search.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Option specifying the maximum number of search results to return.
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Option specifying the maximum number of milliseconds to wait for an operation to complete.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Notifies the server to not send additional results associated with this LDAPSearchResults object, and discards any results already received.
    void
    add(LDAPEntry entry)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds an entry to the directory.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds an entry to the directory.
    void
    authenticate(String DN, String passwd)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Authenticates user with the LDAP server.
    void
    bind(String DN, String passwd)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Authenticates user with the LDAP server.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Compares the given entry's attribute value to the specified attribute value.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Compares the given entry's attribute value to the specified attribute value.
    void
    connect(String host, int port)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Connects to the LDAP server.
    void
    connect(String host, int port, String dn, String passwd)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Connects and authenticates to the LDAP server.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes an entry from the directory.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes an entry from the directory.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Disconnects from the LDAP server.
    getOption(int option)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Retrieves an option that applies to the connection.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Modifies an attribute of a directory entry.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Modifies an attribute of a directory entry.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Modifies the attributes of a directory entry.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Modifies the attributes of a directory entry.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Read the entry corresponding to the specified distinguished name (DN).
    read(String DN, String[] attrs)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Read the entry corresponding to the specified distinguished name (DN), and retrieve only the specified attributes.
    read(String DN, String[] attrs, LDAPSearchConstraints cons)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Read the entry corresponding to the specified distinguished name (DN), and retrieve only the specified attributes.
    void
    rename(String DN, String newRDN, boolean deleteOldRDN)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Changes the name of an entry in the directory.
    void
    rename(String DN, String newRDN, boolean deleteOldRDN, LDAPConstraints cons)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Changes the name of an entry in the directory.
    search(String base, int scope, String filter, String[] attrs, boolean attrsOnly)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Searches for entries in the directory.
    search(String base, int scope, String filter, String[] attrs, boolean attrsOnly, LDAPSearchConstraints cons)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Searches for entries in the directory.
    void
    setOption(int option, Object value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets an option that applies to the connection.
  • Field Details

  • Method Details

    • connect

      void connect(String host, int port) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Connects to the LDAP server.
      Parameters:
      host - hostname of the LDAP server
      port - port number of the LDAP server. To specify the default port, use DEFAULT_PORT.
      Throws:
      LDAPException - Failed to connect to the server.
    • connect

      void connect(String host, int port, String dn, String passwd) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Connects and authenticates to the LDAP server.
      Parameters:
      host - hostname of the LDAP server
      port - port number of the LDAP server. To specify the default port, use DEFAULT_PORT.
      dn - distinguished name to use for authentication
      passwd - password for authentication
      Throws:
      LDAPException - Failed to connect and authenticate to the server.
    • disconnect

      void disconnect() throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Disconnects from the LDAP server. Subsequent operational calls will first try to re-establish the connection to the same LDAP server.
      Throws:
      LDAPException - Failed to disconnect from the server.
    • abandon

      void abandon(LDAPSearchResults results) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Notifies the server to not send additional results associated with this LDAPSearchResults object, and discards any results already received.
      Parameters:
      results - LDAPSearchResults object returned from a search
      Throws:
      LDAPException - Failed to notify the server.
    • authenticate

      void authenticate(String DN, String passwd) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Authenticates user with the LDAP server.
      Parameters:
      DN - distinguished name to use for authentication
      passwd - password for authentication
      Throws:
      LDAPException - Failed to authenticate to the server.
    • bind

      void bind(String DN, String passwd) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Authenticates user with the LDAP server.
      Parameters:
      DN - distinguished name to use for authentication
      passwd - password for authentication
      Throws:
      LDAPException - Failed to authenticate to the server.
    • read

      LDAPEntry read(String DN) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Read the entry corresponding to the specified distinguished name (DN).
      Parameters:
      DN - distinguished name of the entry to retrieve
      Throws:
      LDAPException - Failed to retrieve the specified entry.
    • read

      LDAPEntry read(String DN, String[] attrs) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Read the entry corresponding to the specified distinguished name (DN), and retrieve only the specified attributes.
      Parameters:
      DN - distinguished name of the entry to retrieve
      attrs - names of attributes to retrieve
      Throws:
      LDAPException - Failed to retrieve the specified entry.
    • read

      LDAPEntry read(String DN, String[] attrs, LDAPSearchConstraints cons) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Read the entry corresponding to the specified distinguished name (DN), and retrieve only the specified attributes.
      Parameters:
      DN - distinguished name of the entry to retrieve
      attrs - names of attributes to retrieve
      cons - the constraints set for the read operation
      Throws:
      LDAPException - Failed to retrieve the specified entry.
    • search

      LDAPSearchResults search(String base, int scope, String filter, String[] attrs, boolean attrsOnly) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Searches for entries in the directory.
      Parameters:
      base - starting point for the search in the directory (distinguished name)
      scope - indicates whether the scope of the search includes only the base DN (equivalent to a read operation), only the entries one level below the base DN, or all entries at all levels beneath the base DN (including the base DN itself)
      filter - String which describes the search criteria. The format of the string is described fully in RFC 1558.
      attrs - names of the attributes to return for each matching directory entry. If null, all attributes are returned.
      attrsOnly - if true, the search will return only the names of the attributes (and not their values)
      Throws:
      LDAPException - Failed to complete the requested search.
    • search

      LDAPSearchResults search(String base, int scope, String filter, String[] attrs, boolean attrsOnly, LDAPSearchConstraints cons) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Searches for entries in the directory.
      Parameters:
      base - starting point for the search in the directory (distinguished name)
      scope - indicates whether the scope of the search includes only the base DN (equivalent to a read operation), only the entries one level below the base DN, or all entries at all levels beneath the base DN (including the base DN itself)
      filter - String which describes the search criteria. The format of the string is described fully in RFC 1558.
      attrs - names of the attributes to return for each matching directory entry. If null, all attributes are returned.
      attrsOnly - if true, the search will return only the names of the attributes (and not their values)
      cons - constraints specific to the search (for example, the maximum number of entries to return or the maximum time to wait for the search operation to complete)
      Throws:
      LDAPException - Failed to complete the requested search.
    • compare

      boolean compare(String DN, LDAPAttribute attr) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Compares the given entry's attribute value to the specified attribute value.
      Parameters:
      DN - distinguished name of the entry that you want compared against the specified attribute value
      attr - attribute name and value to use in the comparison
      Throws:
      LDAPException - Failed to perform the comparison.
    • compare

      boolean compare(String DN, LDAPAttribute attr, LDAPConstraints cons) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Compares the given entry's attribute value to the specified attribute value.
      Parameters:
      DN - distinguished name of the entry that you want compared against the specified attribute value
      attr - attribute name and value to use in the comparison
      cons - the constraints set for the compare operation
      Throws:
      LDAPException - Failed to perform the comparison.
    • add

      void add(LDAPEntry entry) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds an entry to the directory.
      Parameters:
      entry - new entry to add to the directory
      Throws:
      LDAPException - Failed to add the entry to the directory.
    • add

      void add(LDAPEntry entry, LDAPConstraints cons) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds an entry to the directory.
      Parameters:
      entry - new entry to add to the directory
      cons - the constraints set for the add operation
      Throws:
      LDAPException - Failed to add the entry to the directory.
    • modify

      void modify(String DN, LDAPModification mod) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Modifies an attribute of a directory entry.
      Parameters:
      DN - distinguished name identifying the entry to modify
      mod - the modification to make
      Throws:
      LDAPException - Failed to modify the specified entry.
    • modify

      void modify(String DN, LDAPModification mod, LDAPConstraints cons) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Modifies an attribute of a directory entry.
      Parameters:
      DN - distinguished name identifying the entry to modify
      mod - the modification to make
      cons - the constraints set for the modify operation
      Throws:
      LDAPException - Failed to modify the specified entry.
    • modify

      void modify(String DN, LDAPModificationSet mods) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Modifies the attributes of a directory entry.
      Parameters:
      DN - distinguished name identifying the entry to modify
      mods - list of the modifications to make
      Throws:
      LDAPException - Failed to modify the specified entry.
    • modify

      void modify(String DN, LDAPModificationSet mods, LDAPConstraints cons) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Modifies the attributes of a directory entry.
      Parameters:
      DN - distinguished name identifying the entry to modify
      mods - list of the modifications to make
      cons - the constraints set for the modify operation
      Throws:
      LDAPException - Failed to modify the specified entry.
    • delete

      void delete(String DN) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes an entry from the directory.
      Parameters:
      DN - distinguished name identifying the entry to remove
      Throws:
      LDAPException - Failed to remove the entry from the directory.
    • delete

      void delete(String DN, LDAPConstraints cons) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes an entry from the directory.
      Parameters:
      DN - distinguished name identifying the entry to remove
      cons - the constraints set for the delete operation
      Throws:
      LDAPException - Failed to remove the entry from the directory.
    • rename

      void rename(String DN, String newRDN, boolean deleteOldRDN) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Changes the name of an entry in the directory.
      Parameters:
      DN - distinguished name (DN) of entry
      newRDN - the new relative distinguished name (RDN) of the entry
      deleteOldRDN - true if the original RDN should no longer be an attribute of the entry; false if it should
      Throws:
      LDAPException - Failed to rename the entry in the directory.
    • rename

      void rename(String DN, String newRDN, boolean deleteOldRDN, LDAPConstraints cons) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Changes the name of an entry in the directory.
      Parameters:
      DN - distinguished name (DN) of entry
      newRDN - new relative distinguished name (RDN) of the entry
      deleteOldRDN - specifies whether or not the original RDN remains as an attribute of the entry. If true, the original RDN is no longer an attribute of the entry.
      cons - the constraints set for the rename operation
      Throws:
      LDAPException - Failed to rename the entry in the directory.
    • getOption

      Object getOption(int option) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Retrieves an option that applies to the connection. The particular meaning may be implementation-dependent. The standard options are the options described by the LDAPSearchConstraints and LDAPConstraints classes.
      Throws:
      LDAPException - Failed to retrieve the value of the specified option.
    • setOption

      void setOption(int option, Object value) throws LDAPException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets an option that applies to the connection. The particular meaning may be implementation-dependent. The standard options are the options described by the LDAPSearchConstraints and LDAPConstraints classes.
      Throws:
      LDAPException - Failed to set the specified option.