home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_a_c / draft-ietf-asid-ldap-java-api-00.txt < prev    next >
Text File  |  1997-07-25  |  111KB  |  3,828 lines

  1.  
  2. Network Working Group                                         Rob Weltman
  3. INTERNET-DRAFT                              Netscape Communications Corp.
  4.                                                                 Tim Howes
  5.                                             Netscape Communications Corp.
  6.                                                                Mark Smith
  7.                                             Netscape Communications Corp.
  8.                                                             July 24, 1997
  9.  
  10.  
  11.               The Java LDAP Application Program Interface
  12.                   draft-ietf-asid-ldap-java-api-00.txt
  13.  
  14.  
  15. Status of this Memo
  16.  
  17. This document is an Internet-Draft.  Internet-Drafts are working docu-
  18. ments of the Internet Engineering Task Force (IETF), its areas, and its
  19. working groups.  Note that other groups may also distribute working
  20. documents as Internet-Drafts.
  21.  
  22. Internet-Drafts are draft documents valid for a maximum of six months
  23. and may be updated, replaced, or obsoleted by other documents at any
  24. time.  It is inappropriate to use Internet-Drafts as reference material
  25. or to cite them other than as ``work in progress.''
  26.  
  27. To learn the current status of any Internet-Draft, please check the
  28. ``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow
  29. Directories on ds.internic.net (US East Coast), nic.nordu.net (Europe),
  30. ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific Rim).
  31.  
  32. Abstract
  33.  
  34. This document defines a java language application program interface to
  35. the lightweight directory access protocol (LDAP), in the form of a class
  36. library. It complements but does not replace RFC 1823 ([9]), which
  37. describes a C language application program interface. It updates and
  38. replaces draft-weltman-java-ldap-01.txt [12], in adding support for ver-
  39. sion 3 of the LDAP protocol. Other additions and corrections are listed
  40. in the appendix.
  41.  
  42.  
  43. 1.  Introduction
  44.  
  45. The LDAP class library is designed to provide powerful, yet simple,
  46. access to a LDAP directory services.  It defines a synchronous interface
  47. to LDAP, with support for partial results on searching, to suit a wide
  48. variety of applications. This document gives a brief overview of the
  49. LDAP model, then an overview of the constituents of the class library.
  50.  
  51.  
  52.  
  53. Expires 1/98                                                    [Page 1]
  54.  
  55.  
  56.  
  57.  
  58.  
  59. JAVA LDAP API                                                  July 1997
  60.  
  61.  
  62. The public class methods are described in detail, followed by an appen-
  63. dix that provides some example code demonstrating the use of the
  64. classes, and an appendix listing changes from draft-weltman-java-ldap-
  65. 00.txt.
  66.  
  67. 2.  Overview of the LDAP model
  68.  
  69. LDAP is the lightweight directory access protocol, described in [2] and
  70. [7]. It defines a lightweight access mechanism in which clients send
  71. requests to and receive responses from LDAP servers.
  72.  
  73. The LDAP information model comes from X.500 [1] and is based on the
  74. entry, which contains information about some object (e.g., a person).
  75. Entries are composed of attributes, which have a type and one or more
  76. values. Each attribute has a syntax that determines what kinds of values
  77. are allowed in the attribute (e.g., ASCII characters, a jpeg photograph,
  78. etc.) and how those values behave during directory operations (e.g., is
  79. case significant during comparisons).
  80.  
  81. Entries may be organized in a tree structure, usually based on politi-
  82. cal, geographical, and organizational boundaries. Other structures are
  83. possible, including a flat namespace. Each entry is uniquely named rela-
  84. tive to its sibling entries by its relative distinguished name (RDN)
  85. consisting of one or more distinguished attribute values from the entry.
  86. At most one value from each attribute may be used in the RDN. For exam-
  87. ple, the entry for the person Babs Jensen might be named with the "Bar-
  88. bara Jensen" value from the commonName attribute.
  89.  
  90. A globally unique name for an entry, called a distinguished name or DN,
  91. is constructed by concatenating the sequence of RDNs from the entry up
  92. to the root of the tree. For example, if Babs worked for the University
  93. of Michigan, the DN of her U-M entry might be "cn=Barbara Jensen,
  94. o=University of Michigan, c=US". The DN format used by LDAP is defined
  95. in [4].
  96.  
  97. Operations are provided to authenticate, search for and retrieve infor-
  98. mation, modify information, and add and delete entries from the tree.
  99.  
  100. An LDAP server may return referrals if it cannot completely service a
  101. request, for example if the request specifies a directory base outside
  102. of the tree managed by the server. The LDAP class library offers the
  103. programmer the option of catching such referrals as exceptions and
  104. explicitly issuing new requests to the referred-to servers, or having
  105. referrals followed automatically by the library. In the latter case, the
  106. programmer may also provide a reauthentication object, allowing
  107. automatic referrals to proceed with appropriate (non-anonymous) creden-
  108. tials for each referred-to server.
  109.  
  110.  
  111.  
  112.  
  113. Expires 1/98                                                    [Page 2]
  114.  
  115.  
  116.  
  117.  
  118.  
  119. JAVA LDAP API                                                  July 1997
  120.  
  121.  
  122. String values are converted from java's 16-bit Unicode format to UTF-8
  123. before encoding and transferring from the client to a server, and con-
  124. verted back to 16-bit Unicode on receiving from a server. The integrity
  125. of double-byte and other non-ASCII character sets is fully preserved.
  126.  
  127. The next sections give an overview of how the class library is used and
  128. detailed descriptions of the LDAP class methods that implement all of
  129. these functions.
  130.  
  131. 3.  Overview of the LDAP classes
  132.  
  133. The central LDAP class is LDAPConnection. It provides methods to estab-
  134. lish an authenticated or anonymous connection to an LDAP server, and
  135. then to search for, modify, compare, and delete entries in the direc-
  136. tory. An LDAPConnection object can be cloned, allowing objects to share
  137. a single network connection but use different settings (using
  138. LDAPConnection.setOption()).
  139.  
  140. To support extensions of the LDAP protocol, and to allow determining at
  141. run-time if a particular LDAPConnection object supports a particular
  142. LDAP protocol level, LDAPConnection implements a protocol interface,
  143. currently LDAPv3.
  144.  
  145. A search conducted by an LDAPConnection object returns results in an
  146. LDAPSearchResults, which can be enumerated to access the entries found.
  147. Each entry - LDAPEntry - provides access to the attributes - LDAPAttri-
  148. bute - returned for that entry. Each attribute can produce the values
  149. found as byte arrays or as Strings.
  150.  
  151.  
  152. 3.1.  Interfaces
  153.  
  154.  
  155. LDAPEntryComparator   An interface to support arbitrary sorting algo-
  156.                       rithms for entries returned by a search operation.
  157.                       At least one implementation must be provided:
  158.                       LDAPCompareAttrNames, to sort in ascending order
  159.                       based on one or more attribute names.
  160.  
  161.  
  162. LDAPRebind            A programmer desiring reauthentication on automat-
  163.                       ically following referrals must implement this
  164.                       interface. Without it, automatically followed
  165.                       referrals will use anonymous authentication.
  166.                       Referrals of any type other to an LDAP server
  167.                       (i.e. a referral URL other than ldap://something)
  168.                       are ignored on automatic referral following.
  169.  
  170.  
  171.  
  172.  
  173. Expires 1/98                                                    [Page 3]
  174.  
  175.  
  176.  
  177.  
  178.  
  179. JAVA LDAP API                                                  July 1997
  180.  
  181.  
  182. LDAPSocketFactory     Programmers needing to provide or use specialized
  183.                       socket connections, including Transport Layer
  184.                       Security (TLS) based ones, can provide an object
  185.                       constructor to implement them using this inter-
  186.                       face.
  187.  
  188.  
  189. LDAPv2                This interface defines the functionality of the
  190.                       LDAP version 2 protocol. It is implemented by
  191.                       LDAPConnection.
  192.  
  193.  
  194. LDAPv3                This interface extends LDAPv2, adding the func-
  195.                       tionality of the LDAP version 3 protocol. It is
  196.                       implemented by LDAPConnection.
  197.  
  198.  
  199. 3.2.  Classes
  200.  
  201.  
  202. LDAPAttribute         Represents the name and values of one attribute of
  203.                       a directory entry.
  204.  
  205.  
  206. LDAPAttributeSet      A collection of LDAPAttributes.
  207.  
  208.  
  209. LDAPCompareAttrNames  An implementation of LDAPEntryComparator, to sup-
  210.                       port sorting of search results by one or more
  211.                       attributes.
  212.  
  213.  
  214. LDAPConnection        Implements LDAPv3 and is the central point for
  215.                       interactions with a directory.
  216.  
  217.  
  218. LDAPControl           Sets additional parameters or constraints for an
  219.                       LDAP operation, either on the server or on the
  220.                       client.
  221.  
  222.  
  223. LDAPDN                A utility class to facilitate composition and
  224.                       decomposition of distinguished names (DNs).
  225.  
  226.  
  227. LDAPEntry             Represents a single entry in a directory.
  228.  
  229.  
  230.  
  231.  
  232.  
  233. Expires 1/98                                                    [Page 4]
  234.  
  235.  
  236.  
  237.  
  238.  
  239. JAVA LDAP API                                                  July 1997
  240.  
  241.  
  242. LDAPExtendedOperation Encapsulates the ID and data associated with the
  243.                       sending or receiving of an extended operation (an
  244.                       LDAPv3 feature).
  245.  
  246.  
  247. LDAPModification      A single add/delete/replace operation to an
  248.                       LDAPAttribute.
  249.  
  250.  
  251. LDAPModificationSet   A collection of LDAPModifications
  252.  
  253.  
  254. LDAPRebindAuth        An implementation of LDAPRebind must be able to
  255.                       provide an LDAPRebindAuth at the time of a refer-
  256.                       ral. The class encapsulates reauthentication
  257.                       credentials. See the Appendix for open issues con-
  258.                       cerning this interface.
  259.  
  260.  
  261. LDAPSearchConstraints Defines the options controlling search operations.
  262.  
  263.  
  264. LDAPSearchResults     The enumerable results of a search operation.
  265.  
  266.  
  267. LDAPUrl               Encapsulates parameters of an LDAP Url query, as
  268.                       defined in [8].
  269.  
  270.  
  271. 3.3.  Exceptions
  272.  
  273.  
  274. LDAPException         General exception, comprising a code and textual
  275.                       context.
  276.  
  277.  
  278. LDAPReferralException Derived from LDAPException, contains a list of
  279.                       LDAPUrls corresponding to referrals received on an
  280.                       LDAP operation.
  281.  
  282.  
  283. LDAPSecurityException Derived from LDAPException, thrown on security
  284.                       mismatches.
  285.  
  286.  
  287. 4.  Overview of LDAP API use
  288.  
  289. An application generally uses the LDAP API in four steps.
  290.  
  291.  
  292.  
  293. Expires 1/98                                                    [Page 5]
  294.  
  295.  
  296.  
  297.  
  298.  
  299. JAVA LDAP API                                                  July 1997
  300.  
  301.  
  302. -    Construct an LDAPConnection.  Initialize an LDAP session with a
  303.      directory server. The LDAPConnection.connect() call establishes a
  304.      handle to the session, allowing multiple sessions to be open at
  305.      once, on different instances of LDAPConnection.
  306.  
  307. -    Authenticate to the LDAP server with LDAPConnection.authenticate().
  308.  
  309. -    Perform some LDAP operations and obtain some results.
  310.      LDAPConnection.search() returns an LDAPSearchResults, which can be
  311.      enumerated to access all entries found. LDAPConnection.read()
  312.      returns a single entry.
  313.  
  314. -    Close the connection. The LDAPConnection.disconnect() call closes
  315.      the connection.
  316.  
  317. All operations are synchronous - they do not return until the operation
  318. has completed. In the java environment, it is appropriate to create a
  319. thread for the operation rather than providing parallel synchronous and
  320. asynchronous operations, as is the case in the C language API described
  321. in [9]. A special accomodation is made for providing intermediate
  322. results on searching, to facilitate user feedback: the number of entries
  323. to return at a time can be specified.
  324.  
  325. Standard java Enumerations are used to parse search results. Errors
  326. result in the throwing of an LDAPException, with a specific error code
  327. and context-specific textual information available.  The following sec-
  328. tions describe the LDAP classes in more detail.
  329.  
  330. 5.  The java LDAP classes
  331.  
  332.  
  333. 5.1.  public class LDAPAttribute extends Object
  334.  
  335. The LDAPAttribute class represents the name and values of an attribute.
  336. It is used to specify an attribute to be added to, deleted from, or
  337. modified in a Directory entry. It is also returned on a search of a
  338. Directory.
  339.  
  340.  
  341. 5.1.1.  Constructors
  342.  
  343.    public LDAPAttribute(String attrName)
  344.  
  345.    Constructs an attribute with no values.
  346.  
  347.  
  348.    public LDAPAttribute(String attrName,
  349.                         byte attrBytes[])
  350.  
  351.  
  352.  
  353. Expires 1/98                                                    [Page 6]
  354.  
  355.  
  356.  
  357.  
  358.  
  359. JAVA LDAP API                                                  July 1997
  360.  
  361.  
  362.    Constructs an attribute with a byte-formatted value.
  363.  
  364.  
  365.    public LDAPAttribute(String attrName,
  366.                         String attrString)
  367.  
  368.    Constructs an attribute that has a single string value.
  369.  
  370.  
  371.    public LDAPAttribute(String attrName,
  372.                         String attrStrings[])
  373.  
  374.    Constructs an attribute that has an array of string values.
  375.  
  376.    Parameters are:
  377.  
  378.    attrName        Name of the attribute.
  379.  
  380.    attrBytes       Value of the attribute as raw bytes.
  381.  
  382.    attrString      Value of the attribute as a String.
  383.  
  384.    attrStrings     Array of values as Strings.
  385.  
  386.    attrBytesArray  Array of values as raw byte arrays.
  387.  
  388.  
  389. 5.1.2.  addValue
  390.  
  391.    public synchronized void addValue(String attrString)
  392.  
  393.    Adds a string value to the attribute.
  394.  
  395.  
  396.    public synchronized void addValue(byte attrBytes[])
  397.  
  398.    Adds a byte[]-formatted value to the attribute.
  399.  
  400.    Parameters are:
  401.  
  402.    attrString      Value of the attribute as a String.
  403.  
  404.    attrBytes       Value of the attribute as raw bytes.
  405.  
  406.  
  407. 5.1.3.  getByteValues
  408.  
  409.    public Enumeration getByteValues()
  410.  
  411.  
  412.  
  413. Expires 1/98                                                    [Page 7]
  414.  
  415.  
  416.  
  417.  
  418.  
  419. JAVA LDAP API                                                  July 1997
  420.  
  421.  
  422.    Returns an enumerator for the values of the attribute in byte[] for-
  423.    mat.
  424.  
  425.  
  426. 5.1.4.  getStringValues
  427.  
  428.    public Enumeration getStringValues()
  429.  
  430.    Returns an enumerator for the string values of an attribute.
  431.  
  432.  
  433. 5.1.5.  getName
  434.  
  435.    public String getName()
  436.  
  437.    Returns the name of the attribute.
  438.  
  439.  
  440. 5.1.6.  removeValue
  441.  
  442.    public synchronized void removeValue(String attrString)
  443.  
  444.    Removes a string value from the attribute.
  445.  
  446.  
  447.    public synchronized void removeValue(byte attrValue[])
  448.  
  449.    Removes a byte[]-formatted value from the attribute.
  450.  
  451.    Parameters are:
  452.  
  453.    attrString      Value of the attribute as a String.
  454.  
  455.    attrBytes       Value of the attribute as raw bytes.
  456.  
  457.  
  458. 5.1.7.  size
  459.  
  460.    public int size()
  461.  
  462.    Returns the number of values of the attribute.
  463.  
  464.  
  465. 5.2.  public class LDAPAttributeSet extends Object
  466.  
  467. An LDAPAttributeSet is a collection of LDAPAttributes, as returned in an
  468. entry on a search or read operation, or used to construct an entry to be
  469. added to a directory.
  470.  
  471.  
  472.  
  473. Expires 1/98                                                    [Page 8]
  474.  
  475.  
  476.  
  477.  
  478.  
  479. JAVA LDAP API                                                  July 1997
  480.  
  481.  
  482. 5.2.1.  Constructors
  483.  
  484.    public LDAPAttributeSet()
  485.  
  486.    Constructs a new set of attributes. This set is initially empty.
  487.  
  488.  
  489. 5.2.2.  add
  490.  
  491.    public synchronized void add(LDAPAttribute attr)
  492.  
  493.    Adds the specified attribute to this attribute set.
  494.  
  495.    Parameters are:
  496.  
  497.    attr            Attribute to add to this set.
  498.  
  499.  
  500. 5.2.3.  elementAt
  501.  
  502.    public LDAPAttribute elementAt(int index)
  503.                                throws ArrayIndexOutOfBoundsException
  504.  
  505.    Returns the attribute at the position specified by the index.  The
  506.    index is 0-based.
  507.  
  508.    Parameters are:
  509.  
  510.    index           Index of the attribute to get.
  511.  
  512.  
  513. 5.2.4.  getAttribute
  514.  
  515.    public LDAPAttribute[] getAttribute(String attrName)
  516.                                        throws LDAPException
  517.  
  518.    Returns one or more subtypes of a particular attribute of the entry.
  519.    LDAP version 3 allows adding a subtype specification to an attribute
  520.    name. "cn;lang-ja", for example, indicates a Japanese language sub-
  521.    type of the "cn" attribute. This feature may be used to provide mul-
  522.    tiple localizations in the same Directory.  getAttribute(attrName)
  523.    returns all subtypes that match the specification of "attrName". If
  524.    there are multiple subtypes named in attrName, e.g. "cn;binary;lang-
  525.    ja", only attributes with all of those subtypes are returned. If no
  526.    subtypes are specified, e.g. "cn", both non-subtyped and all subtyped
  527.    variants of the attribute are returned. If there are no matching
  528.    attributes, an LDAPException is thrown.
  529.  
  530.  
  531.  
  532.  
  533. Expires 1/98                                                    [Page 9]
  534.  
  535.  
  536.  
  537.  
  538.  
  539. JAVA LDAP API                                                  July 1997
  540.  
  541.  
  542.    Parameters are:
  543.  
  544.    attrName        The name of an attribute to retrieve, with or without
  545.                    subtype specification(s). "cn", "cn;lang-ja", and
  546.                    "cn;binary;lang-ja" are valid attribute names.
  547.  
  548.  
  549. 5.2.5.  getBaseAttribute
  550.  
  551.    public LDAPAttribute getBaseAttribute(String attrName)
  552.                                          throws LDAPException
  553.  
  554.    Returns the basic attribute (no subtypes) corresponding to attrName.
  555.    For example, specify "givenname" to return the "givenname" attribute.
  556.    If there is no "givenname" attribute in the entry, or e.g. only a
  557.    subtyped attribute such as "givenname;lang-sp", an LDAPException is
  558.    thrown.
  559.  
  560.    Parameters are:
  561.  
  562.    attrName        The name of an attribute to retrieve, with no subtype
  563.                    specification(s). "cn" and "givenname" are valid
  564.                    attribute names.
  565.  
  566.  
  567. 5.2.6.  getAttributes
  568.  
  569.    public Enumeration getAttributes()
  570.  
  571.    Returns an enumeration of the attributes in this attribute set.
  572.  
  573. 5.2.7.  remove
  574.  
  575.    public synchronized void remove(String name)
  576.  
  577.    Removes the specified attribute from the set.
  578.  
  579.    Parameters are:
  580.  
  581.    name            Name of the attribute to remove from this set. To
  582.                    remove an LDAPAttribute by object, the
  583.                    LDAPAttribute.getName method can be used:
  584.  
  585.                    LDAPAttributeSet.remove( attr.getName() );
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593. Expires 1/98                                                   [Page 10]
  594.  
  595.  
  596.  
  597.  
  598.  
  599. JAVA LDAP API                                                  July 1997
  600.  
  601.  
  602. 5.2.8.  removeElementAt
  603.  
  604.    public void removeElementAt(int index)
  605.                                throws ArrayIndexOutOfBoundsException
  606.  
  607.    Removes the attribute at the position specified by the index.  The
  608.    index is 0-based.
  609.  
  610.    Parameters are:
  611.  
  612.    index           Index of the attribute to remove.
  613.  
  614.  
  615. 5.2.9.  size
  616.  
  617.    public int size()
  618.  
  619.    Returns the number of attributes in this set.
  620.  
  621.  
  622. 5.3.  public class LDAPCompareAttrNames extends Object implements
  623. LDAPEntryComparator
  624.  
  625. An object of this class supports sorting search results by attribute
  626. name, in ascending or descending order.
  627.  
  628.  
  629. 5.3.1.  Constructors
  630.  
  631.    public LDAPCompareAttrNames(String attrName)
  632.  
  633.    Constructs an object that will sort results by a single attribute, in
  634.    ascending order.
  635.  
  636.  
  637.    public LDAPCompareAttrNames(String attrName,
  638.                                boolean ascendingFlag)
  639.  
  640.    Constructs an object that will sort results by a single attribute, in
  641.    either ascending or descending order.
  642.  
  643.  
  644.    public LDAPCompareAttrNames(String[] attrNames)
  645.  
  646.    Constructs an object that will sort by one or more attributes, in the
  647.    order provided, in ascending order.
  648.  
  649.  
  650.  
  651.  
  652.  
  653. Expires 1/98                                                   [Page 11]
  654.  
  655.  
  656.  
  657.  
  658.  
  659. JAVA LDAP API                                                  July 1997
  660.  
  661.  
  662.    public LDAPCompareAttrNames(String[] attrNames,
  663.                                boolean[] ascendingFlags)
  664.                                throws LDAPException
  665.  
  666.    Constructs an object that will sort by one or more attributes, in the
  667.    order provided, in either ascending or descending order for each
  668.    attribute.
  669.  
  670.    Parameters are:
  671.  
  672.    attrName        Name of an attribute to sort by.
  673.  
  674.    attrNames       Array of names of attributes to sort by.
  675.  
  676.    ascendingFlag   true to sort in ascending order, false for descending
  677.                    order.
  678.  
  679.    ascendingFlags  Array of flags, one for each attrName, where each one
  680.                    is true to sort in ascending order, false for des-
  681.                    cending order. An LDAPException is thrown if the
  682.                    length of ascendingFlags is not greater than or equal
  683.                    to the length of attrNames.
  684.  
  685.  
  686. 5.3.2.  isGreater
  687.  
  688.    public boolean isGreater (LDAPEntry e1, LDAPEntry e2)
  689.  
  690.    Returns true if entry1 is to be considered greater than entry2, for
  691.    the purpose of sorting, based on the attribute name or names provided
  692.    on object construction.
  693.  
  694.    Parameters are:
  695.  
  696.    entry1          Target entry for comparison.
  697.  
  698.    entry2          Entry to be compared to.
  699.  
  700.  
  701. 5.4.  public class LDAPConnection extends Object implements LDAPv3,
  702. Cloneable
  703.  
  704. LDAPConnection is the central class that encapsulates the connection to
  705. a Directory Server through the LDAP protocol. It implements the LDAPv2
  706. and LDAPv3 interfaces. An LDAPConnection object is not connected on con-
  707. struction, and may only be connected to one server at one port. Multiple
  708. threads may share this single connection, and an application may have
  709. more than one LDAPConnection object, connected to the same or different
  710.  
  711.  
  712.  
  713. Expires 1/98                                                   [Page 12]
  714.  
  715.  
  716.  
  717.  
  718.  
  719. JAVA LDAP API                                                  July 1997
  720.  
  721.  
  722. Directory Servers.
  723.  
  724. Besides the methods described for LDAPv2 above, LDAPConnection provides
  725. the following methods.
  726.  
  727. 5.4.1.  Constructors
  728.  
  729.    public LDAPConnection()
  730.  
  731.    Constructs a new LDAPConnection object, which represents a connection
  732.    to an LDAP server.
  733.  
  734.    Calling the constructor does not actually establish the connection.
  735.    To connect to the LDAP server, use the connect method.
  736.  
  737.  
  738.    public LDAPConnection(LDAPSocketFactory factory)
  739.  
  740.    Constructs a new LDAPConnection object, which will use the supplied
  741.    class factory to construct a socket connection during
  742.    LDAPConnection.connect().
  743.  
  744.  
  745. 5.4.2.  clone
  746.  
  747.    public LDAPConnection clone()
  748.  
  749.    Returns a copy of the object with a private context, but sharing the
  750.    network connection if there is one. The network connection remains
  751.    open until all clones have disconnected or gone out of scope. Any
  752.    connection opened after cloning is private to the object making the
  753.    connection.
  754.  
  755.  
  756. 5.4.3.  getAuthenticationDN
  757.  
  758.    public String getAuthenticationDN()
  759.  
  760.    Returns the distinguished name (DN) used for authentication by this
  761.    object.
  762.  
  763.  
  764. 5.4.4.  getAuthenticationPassword
  765.  
  766.    public String getAuthenticationPassword()
  767.  
  768.    Returns the password used for simple authentication by this object.
  769.  
  770.  
  771.  
  772.  
  773. Expires 1/98                                                   [Page 13]
  774.  
  775.  
  776.  
  777.  
  778.  
  779. JAVA LDAP API                                                  July 1997
  780.  
  781.  
  782. 5.4.5.  getHost
  783.  
  784.    public String getHost()
  785.  
  786.    Returns the host name of the LDAP server to which the object is or
  787.    was last connected, in the format originally specified.
  788.  
  789.  
  790. 5.4.6.  getPort
  791.  
  792.    public int getPort()
  793.  
  794.    Returns the port number of the LDAP server to which the object is or
  795.    was last connected.
  796.  
  797.  
  798. 5.4.7.  getProperty
  799.  
  800.    public Object getProperty(String name) throws LDAPException
  801.  
  802.    Gets a property of a connection object.
  803.  
  804.    The following read-only properties are available for any given con-
  805.    nection:
  806.  
  807.  
  808.       LDAP_PROPERTY_SDK             The version of this SDK, as a Float
  809.                                     data type.
  810.  
  811.  
  812.       LDAP_PROPERTY_PROTOCOL        The highest supported version of the
  813.                                     LDAP protocol, as a Float data type.
  814.  
  815.  
  816.       LDAP_PROPERTY_SECURITY        A comma-separated list of the types
  817.                                     of authentication supported, as a
  818.                                     String.
  819.  
  820.    Other properties may be available in particular implementations of
  821.    the class, and used to modify operations such as search.
  822.  
  823.    An LDAPException is thrown if the requested property is not avail-
  824.    able.
  825.  
  826. 5.4.8.  getSearchConstraints
  827.  
  828.    public LDAPSearchConstraints getSearchConstraints()
  829.  
  830.  
  831.  
  832.  
  833. Expires 1/98                                                   [Page 14]
  834.  
  835.  
  836.  
  837.  
  838.  
  839. JAVA LDAP API                                                  July 1997
  840.  
  841.  
  842.    Returns the set of search constraints that apply to all searches per-
  843.    formed through this connection (unless a different set of search con-
  844.    straints is specified when calling the search method).
  845.  
  846.    Note that the getOption method can be used to get individual con-
  847.    straints (rather than getting the entire set of constraints).
  848.  
  849.    Typically, the getSearchConstraints method is used to create a
  850.    slightly different set of search constraints to apply to a particular
  851.    search.
  852.  
  853.  
  854. 5.4.9.  getSocketFactory
  855.  
  856.    public static LDAPSocketFactory getSocketFactory()
  857.  
  858.    Returns the default LDAPSocketFactory used to establish a connection
  859.    to a server.
  860.  
  861.  
  862. 5.4.10.  isAuthenticated
  863.  
  864.    public boolean isAthenticated()
  865.  
  866.    Indicates whether the object has authenticated to the connected LDAP
  867.    server.
  868.  
  869.  
  870. 5.4.11.  isConnected
  871.  
  872.    public boolean isConnected()
  873.  
  874.    Indicates whether the connection represented by this object is open
  875.    at this time.
  876.  
  877.  
  878. 5.4.12.  read
  879.  
  880.    public static LDAPEntry read(LDAPUrl toGet) throws LDAPException
  881.  
  882.    Reads the entry specified by the LDAP URL.
  883.  
  884.    When this method is called, a new connection is created automati-
  885.    cally, using the host and port specified in the URL. After finding
  886.    the entry, the method closes the connection (in other words, it
  887.    disconnects from the LDAP server).
  888.  
  889.    If the URL specifies a filter and scope, these are not used. Of the
  890.  
  891.  
  892.  
  893. Expires 1/98                                                   [Page 15]
  894.  
  895.  
  896.  
  897.  
  898.  
  899. JAVA LDAP API                                                  July 1997
  900.  
  901.  
  902.    information specified in the URL, this method only uses the LDAP host
  903.    name and port number, the base distinguished name (DN), and the list
  904.    of attributes to return.
  905.  
  906.    The method returns the entry specified by the base DN.
  907.  
  908.    Parameters are:
  909.  
  910.    toGet           LDAP URL specifying the entry to read.
  911.  
  912.  
  913. 5.4.13.  search
  914.  
  915.    public static LDAPSearchResults search(LDAPUrl toGet) throws LDAPEx-
  916.    ception
  917.  
  918.    Performs the search specified by the LDAP URL, returning an enumer-
  919.    able LDAPSearchResults object.
  920.  
  921.  
  922.    public static LDAPSearchResults search(LDAPUrl toGet,
  923.                                           LDAPSearchConstraints cons)
  924.                                           throws LDAPException
  925.  
  926.    Perfoms the search specified by the LDAP URL. This method also allows
  927.    specifying constraints for the search (such as the maximum number of
  928.    entries to find or the maximum time to wait for search results).
  929.  
  930.    As part of the search constraints, a choice can be made as to whether
  931.    to have the results delivered all at once or in smaller batches. If
  932.    the results are to be delivered in smaller batches, each iteration
  933.    blocks only until the next batch of results is returned.
  934.  
  935.    Parameters are:
  936.  
  937.    toGet           LDAP URL specifying the entry to read.
  938.  
  939.  
  940. 5.4.14.  setOption
  941.  
  942.    public void setOption(int option,
  943.                          Object value)
  944.                          throws LDAPException
  945.  
  946.    Sets the value of the specified option for this LDAPConnection
  947.    object.
  948.  
  949.    These options represent the default search constraints for the
  950.  
  951.  
  952.  
  953. Expires 1/98                                                   [Page 16]
  954.  
  955.  
  956.  
  957.  
  958.  
  959. JAVA LDAP API                                                  July 1997
  960.  
  961.  
  962.    current connection. Some of these options are also propagated through
  963.    the LDAPSearchConstraints, which can be obtained from the connection
  964.    object with the getSearchConstraints method.
  965.  
  966.    The option that is set here applies to all subsequent searches per-
  967.    formed through the current connection, unless it is overridden with
  968.    an LDAPSearchConstraints at the time of search.
  969.  
  970.    To set a constraint only for a particular search, create an LDAPSear-
  971.    chConstraints object with the new constraints and pass it to the
  972.    LDAPConnection.search method.
  973.  
  974.    Parameters are:
  975.  
  976.  
  977.    option          One of the following options:
  978.  
  979.  
  980.       Option                        Type        Description
  981.  
  982.  
  983.       LDAPv2.DEREF                  Integer     Specifies under what
  984.                                                 circumstances the object
  985.                                                 dereferences aliases.
  986.                                                 By default, the value of
  987.                                                 this option is
  988.                                                 LDAPv2.DEREF_NEVER.
  989.  
  990.             Legal values for this option are:
  991.  
  992.             LDAPv2.DEREF_NEVER       Aliases are never dereferenced.
  993.  
  994.  
  995.             LDAPv2.DEREF_FINDING     aliases are dereferenced when find-
  996.                                      ing the starting point for the
  997.                                      search (but not when searching
  998.                                      under that starting entry).
  999.  
  1000.  
  1001.             LDAPv2.DEREF_SEARCHING   Aliases are dereferenced when
  1002.                                      searching the entries beneath the
  1003.                                      starting point of the search (but
  1004.                                      not when finding the starting
  1005.                                      entry).
  1006.  
  1007.  
  1008.             LDAPv2.DEREF_ALWAYS      Aliases are always dereferenced
  1009.                                      (both when finding the starting
  1010.  
  1011.  
  1012.  
  1013. Expires 1/98                                                   [Page 17]
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019. JAVA LDAP API                                                  July 1997
  1020.  
  1021.  
  1022.                                      point for the search and when
  1023.                                      searching under that starting
  1024.                                      entry).
  1025.  
  1026.  
  1027.       LDAPv2.SIZELIMIT              Integer     Specifies the maximum
  1028.                                                 number of search results
  1029.                                                 to return. If this
  1030.                                                 option is set to 0,
  1031.                                                 there is no maximum
  1032.                                                 limit.
  1033.  
  1034.                                                 By default, the value of
  1035.                                                 this option is 1000.
  1036.  
  1037.  
  1038.       LDAPv2.TIMELIMIT              Integer     Specifies the maximum
  1039.                                                 number of milliseconds
  1040.                                                 to wait for results
  1041.                                                 before timing out. If
  1042.                                                 this option is set to 0,
  1043.                                                 there is no maximum time
  1044.                                                 limit. The actual granu-
  1045.                                                 larity of the timeout
  1046.                                                 depends on the implemen-
  1047.                                                 tation.
  1048.  
  1049.                                                 By default, the value of
  1050.                                                 this option is 0.
  1051.  
  1052.  
  1053.       LDAPv2.REFERRALS              Boolean     Specifies whether or not
  1054.                                                 the client follows
  1055.                                                 referrals automatically.
  1056.                                                 If true, the client fol-
  1057.                                                 lows referrals automati-
  1058.                                                 cally.  If false, an
  1059.                                                 LDAPReferralException is
  1060.                                                 raised when a referral
  1061.                                                 is detected.
  1062.  
  1063.                                                 Referrals of any type
  1064.                                                 other to an LDAP server
  1065.                                                 (i.e. a referral URL
  1066.                                                 other than
  1067.                                                 ldap://something) are
  1068.                                                 ignored on automatic
  1069.                                                 referral following.
  1070.  
  1071.  
  1072.  
  1073. Expires 1/98                                                   [Page 18]
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079. JAVA LDAP API                                                  July 1997
  1080.  
  1081.  
  1082.                                                 By default, the value of
  1083.                                                 this option is false.
  1084.  
  1085.  
  1086.       LDAPv2.REFERRALS_REBIND_PROC  LDAPRebind  Specifies an object that
  1087.                                                 implements the LDAPRe-
  1088.                                                 bind interface.  A user
  1089.                                                 of the class library
  1090.                                                 must define this class
  1091.                                                 and the getRebindAuthen-
  1092.                                                 tication method that
  1093.                                                 will be used to get the
  1094.                                                 distinguished name and
  1095.                                                 password to use for
  1096.                                                 authentication. If this
  1097.                                                 value is null and REFER-
  1098.                                                 RALS is true, referrals
  1099.                                                 will be followed with
  1100.                                                 anonymous (= no) authen-
  1101.                                                 tication.
  1102.  
  1103.                                                 By default, the value of
  1104.                                                 this option is null.
  1105.  
  1106.  
  1107.       LDAPv2.REFERRALS_HOP_LIMIT     Integer    Specifies the maximum
  1108.                                                 number of referrals in a
  1109.                                                 sequence that the client
  1110.                                                 will follow. For exam-
  1111.                                                 ple, if
  1112.                                                 REFERRALS_HOP_LIMIT is
  1113.                                                 5, the client will fol-
  1114.                                                 low no more than 5
  1115.                                                 referrals in a row when
  1116.                                                 resolving a single LDAP
  1117.                                                 request.
  1118.  
  1119.                                                 The default value of
  1120.                                                 this option is 10.
  1121.  
  1122.  
  1123.       LDAPv2.BATCHSIZE               Integer    Specifies the number of
  1124.                                                 search results to return
  1125.                                                 at a time. For example,
  1126.                                                 if BATCHSIZE is 1,
  1127.                                                 enumerating an LDAPSear-
  1128.                                                 chResults will block
  1129.                                                 only until one entry is
  1130.  
  1131.  
  1132.  
  1133. Expires 1/98                                                   [Page 19]
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139. JAVA LDAP API                                                  July 1997
  1140.  
  1141.  
  1142.                                                 available. If it is 0,
  1143.                                                 enumerating will block
  1144.                                                 until all entries have
  1145.                                                 been retrieved from the
  1146.                                                 server.
  1147.  
  1148.                                                 The default value of
  1149.                                                 this option is 1.
  1150.  
  1151.  
  1152.    value           The value to assign to the option. The value must be
  1153.                    the java.lang object wrapper for the appropriate
  1154.                    parameter (e.g. boolean->Boolean, int->Integer) .
  1155.  
  1156.  
  1157. 5.4.15.  setProperty
  1158.  
  1159.    public void setProperty(String name, Object value)
  1160.  
  1161.    Sets a property of a connection object.
  1162.  
  1163.    No property names have been defined at this time, but the mechanism
  1164.    is in place in order to support revisional as well as dynamic exten-
  1165.    sions to operation modifiers.
  1166.  
  1167. 5.4.16.  setSocketFactory
  1168.  
  1169.    public static void setSocketFactory(LDAPSocketFactory factory)
  1170.  
  1171.    Establishes the default LDAPSocketFactory used to establish a connec-
  1172.    tion to a server.
  1173.  
  1174.    This method is implemented as once-only. It is useful to be able to
  1175.    change the run-time connection behavior of a whole application with a
  1176.    single instruction, but the results would be confusing, and the
  1177.    side-effects dangerous, if the global default factory could be
  1178.    changed at arbitrary times by different threads. It should be called
  1179.    before the first connect().
  1180.  
  1181.    A typical usage would be:
  1182.  
  1183.        if (usingTLS) {
  1184.            LDAPConnection.setSocketFactory(myTLSFactory);
  1185.        }
  1186.        ...
  1187.        LDAPConnection conn = new LDAPConnection();
  1188.        conn.connect(myHost, myPort);
  1189.  
  1190.  
  1191.  
  1192.  
  1193. Expires 1/98                                                   [Page 20]
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199. JAVA LDAP API                                                  July 1997
  1200.  
  1201.  
  1202.    In this example, connections are constructed with the default LDAP-
  1203.    SocketFactory.  At application start-up time, the default may be set
  1204.    to use a particular provided TLS socket factory.
  1205.  
  1206.    Parameters are:
  1207.  
  1208.    factory         A factory object which can construct socket connec-
  1209.                    tions for an LDAPConnection.
  1210.  
  1211.  
  1212. 5.5.  public class LDAPControl implements Cloneable
  1213.  
  1214. An LDAPControl encapsulates optional additional parameters or con-
  1215. straints to be applied to LDAP operations. If set as a Server Control,
  1216. it is sent to the server along with operation requests. If set as a
  1217. Client Control, it is not sent to the server, but rather interpreted
  1218. locally by the client. LDAPControl is an LDAPv3 extension, and is not
  1219. supported in an LDAPv2 environment.
  1220.  
  1221.  
  1222. 5.5.1.  Constructors
  1223.  
  1224.    public LDAPControl(String id,
  1225.                       boolean critical,
  1226.                       byte vals[])
  1227.  
  1228.    Parameters are:
  1229.  
  1230.    id              The type of the Control, as a string.
  1231.  
  1232.    critical        True if the LDAP operation should be discarded if the
  1233.                    server does not support this Control.
  1234.  
  1235.    vals            Control-specific data.
  1236.  
  1237.  
  1238. 5.5.2.  getID
  1239.  
  1240.    public String getID()
  1241.  
  1242.    Returns the identifier of the control.
  1243.  
  1244.  
  1245. 5.5.3.  isCritical
  1246.  
  1247.    public boolean isCritical()
  1248.  
  1249.    Returns true if the control must be supported for an associated
  1250.  
  1251.  
  1252.  
  1253. Expires 1/98                                                   [Page 21]
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259. JAVA LDAP API                                                  July 1997
  1260.  
  1261.  
  1262.    operation to be executed.
  1263.  
  1264.  
  1265. 5.5.4.  getValue
  1266.  
  1267.    public byte[] getValue()
  1268.  
  1269.    Returns the control-specific data of the object.
  1270.  
  1271.  
  1272. 5.6.  public class LDAPDN extends Object
  1273.  
  1274. A utility class representing a distinguished name (DN).
  1275.  
  1276.  
  1277. 5.6.1.  explodeDN
  1278.  
  1279.    public static String[] explodeDN(String dn,
  1280.                                     boolean noTypes)
  1281.  
  1282.    Returns the individual components of a distinguished name (DN).
  1283.  
  1284.    Parameters are:
  1285.  
  1286.    dn              Distinguished name, e.g. "cn=Babs
  1287.                    Jensen,ou=Accounting,o=Acme,c=us"
  1288.  
  1289.    noTypes         If true, returns only the values of the components,
  1290.                    and not the names, e.g. "Babs Jensen", "Accounting",
  1291.                    "Acme", "us" - instead of "cn=Babs Jensen",
  1292.                    "ou=Accounting", "o=Acme", and "c=us".
  1293.  
  1294.  
  1295. 5.6.2.  explodeRDN
  1296.  
  1297.    public static String[] explodeRDN(String rdn,
  1298.                                      boolean noTypes)
  1299.  
  1300.    Returns the individual components of a relative distinguished name
  1301.    (RDN).
  1302.  
  1303.    Parameters are:
  1304.  
  1305.    rdn             Relative distinguished name, i.e. the left-most com-
  1306.                    ponent of a distinguished name.
  1307.  
  1308.    noTypes         If true, returns only the values of the components,
  1309.                    and not the names.
  1310.  
  1311.  
  1312.  
  1313. Expires 1/98                                                   [Page 22]
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319. JAVA LDAP API                                                  July 1997
  1320.  
  1321.  
  1322. 5.7.  public class LDAPEntry extends Object
  1323.  
  1324. An LDAPEntry represents a single entry in a directory, consisting of a
  1325. distinguished name (DN) and zero or more attributes. An instance of
  1326. LDAPEntry is created in order to add an entry to a Directory, and
  1327. instances are returned on a search by enumerating an LDAPSearchResults.
  1328.  
  1329.  
  1330. 5.7.1.  Constructors
  1331.  
  1332.    public LDAPEntry()
  1333.  
  1334.    Constructs an empty entry.
  1335.  
  1336.  
  1337.    public LDAPEntry(String dn)
  1338.  
  1339.    Constructs a new entry with the specified distinguished name and with
  1340.    an empty attribute set.
  1341.  
  1342.  
  1343.    public LDAPEntry(String dn
  1344.                     LDAPAttributeSet attrs)
  1345.  
  1346.    Constructs a new entry with the specified distinguished name and set
  1347.    of attributes.
  1348.  
  1349.    Parameters are:
  1350.  
  1351.    dn              The distinguished name of the new entry.
  1352.  
  1353.    attrs           The initial set of attributes assigned to the entry.
  1354.  
  1355.  
  1356. 5.7.2.  getAttribute
  1357.  
  1358.    public LDAPAttribute[] getAttribute(String attrName)
  1359.                                        throws LDAPException
  1360.  
  1361.    Returns one or more subtypes of a particular attribute of the entry.
  1362.    LDAP version 3 allows adding a subtype specification to an attribute
  1363.    name. "cn;lang-ja", for example, indicates a Japanese language sub-
  1364.    type of the "cn" attribute. This feature may be used to provide mul-
  1365.    tiple localizations in the same Directory.  getAttribute(attrName)
  1366.    returns all subtypes that match the specification of "attrName". If
  1367.    there are multiple subtypes named in attrName, e.g. "cn;binary;lang-
  1368.    ja", only attributes with all of those subtypes are returned. If no
  1369.    subtypes are specified, e.g. "cn", both non-subtyped and all subtyped
  1370.  
  1371.  
  1372.  
  1373. Expires 1/98                                                   [Page 23]
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379. JAVA LDAP API                                                  July 1997
  1380.  
  1381.  
  1382.    variants of the attribute are returned. If there are no matching
  1383.    attributes, an LDAPException is thrown.
  1384.  
  1385.    Parameters are:
  1386.  
  1387.    attrName        The name of an attribute to retrieve, with or without
  1388.                    subtype specification(s). "cn", "cn;lang-ja", and
  1389.                    "cn;binary;lang-ja" are valid attribute names.
  1390.  
  1391.  
  1392. 5.7.3.  getBaseAttribute
  1393.  
  1394.    public LDAPAttribute getBaseAttribute(String attrName)
  1395.                                          throws LDAPException
  1396.  
  1397.    Returns the basic attribute (no subtypes) corresponding to attrName.
  1398.    For example, specify "givenname" to return the "givenname" attribute.
  1399.    If there is no "givenname" attribute in the entry, or e.g. only a
  1400.    subtyped attribute such as "givenname;lang-sp", an LDAPException is
  1401.    thrown.
  1402.  
  1403.    Parameters are:
  1404.  
  1405.    attrName        The name of an attribute to retrieve, with no subtype
  1406.                    specification(s). "cn" and "givenname" are valid
  1407.                    attribute names.
  1408.  
  1409.  
  1410. 5.7.4.  getAttributeSet
  1411.  
  1412.    public LDAPAttributeSet getAttributeSet()
  1413.  
  1414.    Returns the attribute set of the entry. All base and subtype variants
  1415.    of all attributes are returned. The LDAPAttributeSet returned may be
  1416.    empty if there are no attributes in the entry.
  1417.  
  1418.  
  1419.    public LDAPAttributeSet getAttributeSet(String subtype)
  1420.  
  1421.    Returns an attribute set from the entry, consisting of only those
  1422.    attributes matching the specified subtype(s). This may be used to
  1423.    extract only a particular language variant subtype of each attribute,
  1424.    if it exists. "subtype" may be, for example, "lang-ja", "binary", or
  1425.    "lang-ja;phonetic". If more than one subtype is specified, separated
  1426.    with a semicolon, only those attributes with all of the named sub-
  1427.    types will be returned.  The LDAPAttributeSet returned may be empty
  1428.    if there are no matching attributes in the entry.
  1429.  
  1430.  
  1431.  
  1432.  
  1433. Expires 1/98                                                   [Page 24]
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439. JAVA LDAP API                                                  July 1997
  1440.  
  1441.  
  1442.    Parameters are:
  1443.  
  1444.    subtype         One or more subtype specification(s), separated with
  1445.                    semicolons.  "lang-ja" and "lang-en;phonetic" are
  1446.                    valid subtype specifications.
  1447.  
  1448.  
  1449. 5.7.5.  getDN
  1450.  
  1451.    public String getDN()
  1452.  
  1453.    Returns the distinguished name of the entry.
  1454.  
  1455.  
  1456. 5.8.  public class LDAPExtendedOperation extends Object
  1457.  
  1458. An LDAPExtendedOperation encapsulates an ID which uniquely identifies a
  1459. particular extended operation, known to a particular server, and the
  1460. data associated with the operation.
  1461.  
  1462.  
  1463. 5.8.1.  Constructors
  1464.  
  1465.    public LDAPExtendedOperation(String oid,
  1466.                                 byte[] vals)
  1467.  
  1468.    Constructs a new object with the specified object ID and data.
  1469.  
  1470.    Parameters are:
  1471.  
  1472.    oid             The unique identifier of the operation.
  1473.  
  1474.    vals            The operation-specific data of the operation/
  1475.  
  1476.  
  1477. 5.8.2.  getID
  1478.  
  1479.    public String getID()
  1480.  
  1481.    Returns the unique identifier of the operation.
  1482.  
  1483.  
  1484.  
  1485. 5.8.3.  getValue
  1486.  
  1487.    public byte[] getValue()
  1488.  
  1489.    Returns the operation-specific data (not a copy, a reference).
  1490.  
  1491.  
  1492.  
  1493. Expires 1/98                                                   [Page 25]
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499. JAVA LDAP API                                                  July 1997
  1500.  
  1501.  
  1502. 5.9.  public interface LDAPEntryComparator
  1503.  
  1504. An object of this class can implement arbitrary sorting algorithms for
  1505. search results.
  1506.  
  1507.  
  1508. 5.9.1.  isGreater
  1509.  
  1510.    public boolean isGreater(LDAPEntry entry1, LDAPEntry entry2)
  1511.  
  1512.    Returns true if entry1 is to be considered greater than or equal to
  1513.    entry2, for the purpose of sorting.
  1514.  
  1515.    Parameters are:
  1516.  
  1517.    entry1          Target entry for comparison.
  1518.  
  1519.    entry2          Entry to be compared to.
  1520.  
  1521.  
  1522. 5.10.  public class LDAPException extends Exception
  1523.  
  1524. Thrown to indicate that an error has occurred. An LDAPException can
  1525. result from physical problems (such as network errors) as well as prob-
  1526. lems with LDAP operations (for example, if the LDAP add operation fails
  1527. because of duplicate entry).
  1528.  
  1529. Most errors that occur throw this type of exception.  The
  1530. getLDAPResultCode() method returns the specific result code, which can
  1531. be compared against standard LDAP result codes as defined in [11], sec-
  1532. tion 4.
  1533.  
  1534.  
  1535. 5.10.1.  Constructors
  1536.  
  1537.    public LDAPException()
  1538.  
  1539.    Constructs a default exception with no specific error information.
  1540.  
  1541.  
  1542.    public LDAPException(String message)
  1543.  
  1544.    Constructs a default exception with a specified string as additional
  1545.    information. This form is used for lower-level errors.
  1546.  
  1547.  
  1548.    public LDAPException(String message,
  1549.                         int resultCode,
  1550.  
  1551.  
  1552.  
  1553. Expires 1/98                                                   [Page 26]
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559. JAVA LDAP API                                                  July 1997
  1560.  
  1561.  
  1562.                         String serverMessage)
  1563.  
  1564.    Constructs a default exception with a specified string as additional
  1565.    information. This form is used for higher-level LDAP operational
  1566.    errors.
  1567.  
  1568.    Parameters are:
  1569.  
  1570.    message         The additional error information.
  1571.  
  1572.    resultCode      The result code returned
  1573.  
  1574.    serverMessage   Error message specifying additional information from
  1575.                    the server.
  1576.  
  1577.  
  1578. 5.10.2.  getLDAPErrorMessage
  1579.  
  1580.    public String getLDAPErrorMessage()
  1581.  
  1582.    Returns the error message from the last error, if this message is
  1583.    available (that is, if this message was set). If the message was not
  1584.    set, this method returns null.
  1585.  
  1586.  
  1587. 5.10.3.  getLDAPResultCode
  1588.  
  1589.    public int getLDAPResultCode()
  1590.  
  1591.    Returns the result code from the last error. The codes are defined as
  1592.    public final static int members of this class. Note that this value
  1593.    is not always valid; -1 indicates this situation.
  1594.  
  1595. 5.10.4.  getMatchedDN
  1596.  
  1597.    public String getMatchedDN()
  1598.  
  1599.    Returns the part of a submitted distinguished name which could be
  1600.    matched by the server. This value is an empty String except when the
  1601.    result of the operation was one of the following:
  1602.  
  1603.       NO_SUCH_OBJECT
  1604.       ALIAS_PROBLEM
  1605.       INVALID_DN_SYNTAX
  1606.       ALIAS_DEREFERENCING_PROBLEM
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613. Expires 1/98                                                   [Page 27]
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619. JAVA LDAP API                                                  July 1997
  1620.  
  1621.  
  1622. 5.10.5.  Error codes
  1623.  
  1624. See [11] and [7] for a discussion of the meanings of the codes.
  1625.  
  1626.      ADMIN_LIMIT_EXCEEDED
  1627.      AFFECTS_MULTIPLE_DSAS
  1628.      ALIAS_DEREFERENCING_PROBLEM
  1629.      ALIAS_PROBLEM
  1630.      ATTRIBUTE_OR_VALUE_EXISTS
  1631.      AUTH_METHOD_NOT_SUPPORTED
  1632.      BUSY
  1633.      COMPARE_FALSE
  1634.      COMPARE_TRUE
  1635.      CONFIDENTIALITY_REQUIRED
  1636.      CONSTRAINT_VIOLATION
  1637.      ENTRY_ALREADY_EXISTS
  1638.      INAPPROPRIATE_AUTHENTICATION
  1639.      INAPPROPRIATE_MATCHING
  1640.      INSUFFICIENT_ACCESS_RIGHTS
  1641.      INVALID_ATTRIBUTE_SYNTAX
  1642.      INVALID_CREDENTIALS
  1643.      INVALID_DN_SYNTAX
  1644.      IS_LEAF
  1645.      LDAP_PARTIAL_RESULTS
  1646.      LOOP_DETECT
  1647.      NAMING_VIOLATION
  1648.      NO_SUCH_ATTRIBUTE
  1649.      NO_SUCH_OBJECT
  1650.      NOT_ALLOWED_ON_NONLEAF
  1651.      NOT_ALLOWED_ON_RDN
  1652.      OBJECT_CLASS_MODS_PROHIBITED
  1653.      OBJECT_CLASS_VIOLATION
  1654.      OPERATIONS_ERROR
  1655.      OTHER
  1656.      PROTOCOL_ERROR
  1657.      REFERRAL
  1658.      SIZE_LIMIT_EXCEEDED
  1659.      STRONG_AUTH_NOT_SUPPORTED
  1660.      STRONG_AUTH_REQUIRED
  1661.      SUCCESS
  1662.      TIME_LIMIT_EXCEEDED
  1663.      UNAVAILABLE
  1664.      UNAVAILABLE_CRITICAL_EXTENSION
  1665.      UNDEFINED_ATTRIBUTE_TYPE
  1666.      UNWILLING_TO_PERFORM
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673. Expires 1/98                                                   [Page 28]
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679. JAVA LDAP API                                                  July 1997
  1680.  
  1681.  
  1682. 5.11.  public class LDAPModification extends Object
  1683.  
  1684. A single change specification for an LDAPAttribute.
  1685.  
  1686.  
  1687. 5.11.1.  Constructors
  1688.  
  1689.    public LDAPModification(int op,
  1690.                            LDAPAttribute attr)
  1691.  
  1692.    Specifies a modification to be made to an attribute.
  1693.  
  1694.    Parameters are:
  1695.  
  1696.    op              The type of modification to make, which can be one of
  1697.                    the following:
  1698.  
  1699.       LDAPModification.ADD     The value should be added to the attri-
  1700.                                bute
  1701.  
  1702.       LDAPModification.DELETE  The value should be removed from the
  1703.                                attribute
  1704.  
  1705.       LDAPModification.REPLACE The value should replace all existing
  1706.                                values of the attribute
  1707.  
  1708.    attr            The attribute (possibly with values) to be modified.
  1709.  
  1710.  
  1711. 5.11.2.  getAttribute
  1712.  
  1713.    public LDAPAttribute getAttribute()
  1714.  
  1715.    Returns the attribute (possibly with values) to be modified.
  1716.  
  1717.  
  1718. 5.11.3.  getOp
  1719.  
  1720.    public int getOp()
  1721.  
  1722.    Returns the type of modification specified by this object.
  1723.  
  1724.  
  1725. 5.12.  public class LDAPModificationSet extends Object
  1726.  
  1727. A collection of modifications to be made to the attributes of a single
  1728. entry.
  1729.  
  1730.  
  1731.  
  1732.  
  1733. Expires 1/98                                                   [Page 29]
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739. JAVA LDAP API                                                  July 1997
  1740.  
  1741.  
  1742. 5.12.1.  Constructors
  1743.  
  1744.    public LDAPModificationSet()
  1745.  
  1746.    Constructs a new, empty set of modifications.
  1747.  
  1748.  
  1749. 5.12.2.  add
  1750.  
  1751.    public synchronized void add(int op,
  1752.                                 LDAPAttribute attr)
  1753.  
  1754.    Specifies another modification to be added to the set of modifica-
  1755.    tions.
  1756.  
  1757.    Parameters are:
  1758.  
  1759.    op              The type of modification to make, as described for
  1760.                    LDAPModification.
  1761.  
  1762.    attr            The attribute (possibly with values) to be modified.
  1763.  
  1764.  
  1765. 5.12.3.  elementAt
  1766.  
  1767.    public LDAPModification elementAt(int index)
  1768.                                throws ArrayIndexOutOfBoundsException
  1769.  
  1770.    Retrieves a particular LDAPModification object at the position speci-
  1771.    fied by the index.
  1772.  
  1773.    Parameters are:
  1774.  
  1775.    index           Index of the modification to get.
  1776.  
  1777.  
  1778. 5.12.4.  remove
  1779.  
  1780.    public synchronized void remove(String name)
  1781.  
  1782.    Removes the first attribute with the specified name in the set of
  1783.    modifications.
  1784.  
  1785.    Parameters are:
  1786.  
  1787.    name            Name of the attribute to be removed.
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793. Expires 1/98                                                   [Page 30]
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799. JAVA LDAP API                                                  July 1997
  1800.  
  1801.  
  1802. 5.12.5.  removeElementAt
  1803.  
  1804.    public void removeElementAt(int index)
  1805.                                throws ArrayIndexOutOfBoundsException
  1806.  
  1807.    Removes a particular LDAPModification object at the position speci-
  1808.    fied by the index.
  1809.  
  1810.  
  1811. index           Index of the modification to remove.
  1812.  
  1813.  
  1814. 5.12.6.  size
  1815.  
  1816.    public int size()
  1817.  
  1818.    Retrieves the number of LDAPModification objects in this set.
  1819.  
  1820.  
  1821. 5.13.  public class LDAPRebindAuth extends Object
  1822.  
  1823. Represents information used to authenticate the client in cases where
  1824. the client follows referrals automatically.
  1825.  
  1826.  
  1827. 5.13.1.  Constructors
  1828.  
  1829.    public LDAPRebindAuth(String dn,
  1830.                          String password)
  1831.  
  1832.    Constructs information that is used by the client for authentication
  1833.    when following referrals automatically.
  1834.  
  1835.  
  1836. 5.13.2.  getDN
  1837.  
  1838.    public String getDN()
  1839.  
  1840.    Returns the distinguished name to be used for reauthentication on
  1841.    automatic referral following.
  1842.  
  1843.  
  1844. 5.13.3.  getPassword
  1845.  
  1846.    public String getPassword()
  1847.  
  1848.    Returns the password to be used for reauthentication on automatic
  1849.    referral following.
  1850.  
  1851.  
  1852.  
  1853. Expires 1/98                                                   [Page 31]
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859. JAVA LDAP API                                                  July 1997
  1860.  
  1861.  
  1862. 5.14.  public class LDAPReferralException extends LDAPException
  1863.  
  1864. This exception, derived from LDAPException, is thrown when a server
  1865. returns a referral and automatic referral following has not been
  1866. enabled.
  1867.  
  1868.  
  1869. 5.14.1.  Constructors
  1870.  
  1871.    public LDAPReferralException()
  1872.  
  1873.    Constructs a default exception with no specific error information.
  1874.  
  1875.  
  1876.    public LDAPReferralException(String message)
  1877.  
  1878.    Constructs a default exception with a specified string as additional
  1879.    information. This form is used for lower-level errors.
  1880.  
  1881.  
  1882.    public LDAPReferralException(String message,
  1883.                                 int resultCode,
  1884.                                 String serverMessage)
  1885.  
  1886.    Parameters are:
  1887.  
  1888.    message         The additional error information.
  1889.  
  1890.    resultCode      The result code returned
  1891.  
  1892.    serverMessage   Error message specifying additional information from
  1893.                    the server.
  1894.  
  1895.  
  1896. 5.14.2.  getURLs
  1897.  
  1898.    public LDAPUrl[] getURLs()
  1899.  
  1900.    Gets the list of referrals (LDAP URLs to other servers) returned by
  1901.    the LDAP server. This exception is only thrown, and therefor the URL
  1902.    list only available, if automatic referral following is not enabled.
  1903.    The referrals may include URLs of a type other than ones for an LDAP
  1904.    server (i.e. a referral URL other than ldap://something).
  1905.  
  1906.  
  1907. 5.15.  public class LDAPSearchConstraints extends Object
  1908.  
  1909. A set of options to control a search operation. There is always an
  1910.  
  1911.  
  1912.  
  1913. Expires 1/98                                                   [Page 32]
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919. JAVA LDAP API                                                  July 1997
  1920.  
  1921.  
  1922. LDAPSearchConstraints associated with an LDAPConnection object; its
  1923. values can be changed with LDAPConnection.setOption, or overridden by
  1924. passing an LDAPSearchConstraints object to the search operation.
  1925.  
  1926.  
  1927. 5.15.1.  Constructors
  1928.  
  1929.    public LDAPSearchConstraints()
  1930.  
  1931.    Constructs an LDAPSearchConstraints object that specifies the default
  1932.    set of search constraints.
  1933.  
  1934.  
  1935.    public LDAPSearchConstraints(int msLimit,
  1936.                                 int dereference,
  1937.                                 int maxResults,
  1938.                                 boolean doReferrals,
  1939.                                 int batchSize,
  1940.                                 LDAPRebind rebind_proc,
  1941.                                 int hop_limit)
  1942.  
  1943.    Constructs a new LDAPSearchConstraints object and allows specifying
  1944.    the search constraints in that object.
  1945.  
  1946.    Parameters are:
  1947.  
  1948.    msLimit         Maximum time in milliseconds to wait for results (0
  1949.                    by default, which means that there is no maximum time
  1950.                    limit).
  1951.  
  1952.    dereference     Specifies when aliases should be dereferenced. Must
  1953.                    be either LDAP_DEREF_NEVER, LDAP_DEREF_FINDING,
  1954.                    LDAP_DEREF_SEARCHING, or LDAP_DEREF_ALWAYS from
  1955.                    LDAPv2 (LDAPv2.LDAP_DEREF_NEVER by default).
  1956.  
  1957.    maxResults      Maximum number of search results to return (1000 by
  1958.                    default).
  1959.  
  1960.    doReferrals     Specify true to follow referrals automatically, or
  1961.                    false to throw an LDAPReferralException error if the
  1962.                    server sends back a referral (false by default)
  1963.  
  1964.    batchSize       Specify the number of results to block on during
  1965.                    enumeration. 0 means to block until all results are
  1966.                    in (1 by default).
  1967.  
  1968.    rebind_proc     Specifies an object of the class that implements the
  1969.                    LDAPRebind interface. The object will be used when
  1970.  
  1971.  
  1972.  
  1973. Expires 1/98                                                   [Page 33]
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979. JAVA LDAP API                                                  July 1997
  1980.  
  1981.  
  1982.                    the client follows referrals automatically. The
  1983.                    object provides a method for getting the dis-
  1984.                    tinguished name and password used to authenticate to
  1985.                    another LDAP server during a referral. This field is
  1986.                    null by default.
  1987.  
  1988.    hop_limit       Maximum number of referrals to follow in a sequence
  1989.                    when attempting to resolve a request, when doing
  1990.                    automatic referral following.
  1991.  
  1992.  
  1993. 5.15.2.  getBatchSize
  1994.  
  1995.    public int getBatchSize()
  1996.  
  1997.    Returns the number of results to block on during enumeration of
  1998.    search results. This should be 0 if intermediate results are not
  1999.    needed, and 1 if results are to be processed as they come in.
  2000.  
  2001.  
  2002. 5.15.3.  getDereference
  2003.  
  2004.    public int getDereference()
  2005.  
  2006.    Specifies when aliases should be dereferenced. Returns either
  2007.    LDAP_DEREF_NEVER, LDAP_DEREF_FINDING, LDAP_DEREF_SEARCHING, or
  2008.    LDAP_DEREF_ALWAYS from LDAPv2.
  2009.  
  2010.  
  2011. 5.15.4.  getHopLimit
  2012.  
  2013.    public int getHopLimit()
  2014.  
  2015.    Returns the maximum number of hops to follow during automatic refer-
  2016.    ral following.
  2017.  
  2018.  
  2019. 5.15.5.  getMaxResults
  2020.  
  2021.    public int getMaxResults()
  2022.  
  2023.    Returns the maximum number of search results to be returned; 0 means
  2024.    no limit.
  2025.  
  2026.  
  2027. 5.15.6.  getRebindProc
  2028.  
  2029.    public LDAPRebind getRebindProc()
  2030.  
  2031.  
  2032.  
  2033. Expires 1/98                                                   [Page 34]
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039. JAVA LDAP API                                                  July 1997
  2040.  
  2041.  
  2042.    Returns the object that provides the method for getting authentica-
  2043.    tion information.
  2044.  
  2045.  
  2046. 5.15.7.  getReferrals
  2047.  
  2048.    public boolean getReferrals()
  2049.  
  2050.    Specifies whether nor not referrals are followed automatically.
  2051.    Returns true if referrals are to be followed automatically, or false
  2052.    if referrals throw an LDAPReferralException.
  2053.  
  2054.  
  2055. 5.15.8.  getTimeLimit
  2056.  
  2057.    public int getTimeLimit()
  2058.  
  2059.    Returns the maximum number of milliseconds to wait for any operation
  2060.    under these search constraints. If 0, there is no maximum time limit
  2061.    on waiting for the operation results. The actual granularity of the
  2062.    timeout depends on the implementation.
  2063.  
  2064.  
  2065. 5.15.9.  setBatchSize
  2066.  
  2067.    public void setBatchSize(int batchSize)
  2068.  
  2069.    Sets the suggested number of results to block on during enumeration
  2070.    of search results. This should be 0 if intermediate results are not
  2071.    needed, and 1 if results are to be processed as they come in.  The
  2072.    default is 1.
  2073.  
  2074.    Parameters are:
  2075.  
  2076.    batchSize       Blocking size on search enumerations.
  2077.  
  2078.  
  2079. 5.15.10.  setDereference
  2080.  
  2081.    public void setDereference(int dereference)
  2082.  
  2083.    Sets a preference indicating whether or not aliases should be
  2084.    dereferenced, and if so, when.
  2085.  
  2086.    Parameters are:
  2087.  
  2088.    dereference     Either LDAP_DEREF_NEVER, LDAP_DEREF_FINDING,
  2089.                    LDAP_DEREF_SEARCHING, or LDAP_DEREF_ALWAYS from
  2090.  
  2091.  
  2092.  
  2093. Expires 1/98                                                   [Page 35]
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099. JAVA LDAP API                                                  July 1997
  2100.  
  2101.  
  2102.                    LDAPv2.
  2103.  
  2104.  
  2105. 5.15.11.  setHopLimit
  2106.  
  2107.    public void setHopLimit(int hop_limit)
  2108.  
  2109.    Sets the maximum number of hops to follow in sequence during
  2110.    automatic referral following. The default is 5.
  2111.  
  2112.    Parameters are:
  2113.  
  2114.    hop_limit       Maximum number of chained referrals to follow
  2115.                    automatically.
  2116.  
  2117.  
  2118. 5.15.12.  setMaxResults
  2119.  
  2120.    public void setMaxResults(int maxResults)
  2121.  
  2122.    Sets the maximum number of search results to be returned; 0 means no
  2123.    limit.  The default is 1000.
  2124.  
  2125.    Parameters are:
  2126.  
  2127.    maxResults      Maxumum number of search results to return.
  2128.  
  2129.  
  2130. 5.15.13.  setRebindProc
  2131.  
  2132.    public void setRebindProc(LDAPRebind rebind_proc)
  2133.  
  2134.    Specifies the object that provides the method for getting authentica-
  2135.    tion information. The default is null. If referrals is set to true,
  2136.    and the rebindProc is null, referrals will be followed with anonymous
  2137.    (= no) authentication.
  2138.  
  2139.    Parameters are:
  2140.  
  2141.    rebind_proc     An object that implements LDAPRebind.
  2142.  
  2143.  
  2144. 5.15.14.  setReferrals
  2145.  
  2146.    public void setReferrals(boolean doReferrals)
  2147.  
  2148.    Specifies whether nor not referrals are followed automatically, or if
  2149.    referrals throw an LDAPReferralException.  Referrals of any type
  2150.  
  2151.  
  2152.  
  2153. Expires 1/98                                                   [Page 36]
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159. JAVA LDAP API                                                  July 1997
  2160.  
  2161.  
  2162.    other to an LDAP server (i.e. a referral URL other than
  2163.    ldap://something) are ignored on automatic referral following. The
  2164.    default is false.
  2165.  
  2166.    Parameters are:
  2167.  
  2168.    doReferrals     True to follow referrals automatically.
  2169.  
  2170.  
  2171. 5.15.15.  setTimeLimit
  2172.  
  2173.    public void setTimeLimit(int msLimit)
  2174.  
  2175.    Sets the maximum number of milliseconds to wait for any operation
  2176.    under these search constraints. If 0, there is no maximum time limit
  2177.    on waiting for the operation results. The actual granularity of the
  2178.    timeout depends on the implementation.
  2179.  
  2180.    Parameters are:
  2181.  
  2182.    msLimit         Maximum milliseconds to wait.
  2183.  
  2184.  
  2185. 5.16.  public class LDAPSearchResults extends Object
  2186.  
  2187. An LDAPSearchResults object is returned from a search operation. It
  2188. implements Enumeration, thereby providing access to all entries
  2189. retrieved during the operation.
  2190.  
  2191.  
  2192. 5.16.1.  hasMoreElements
  2193.  
  2194.    public boolean hasMoreElements()
  2195.  
  2196.    Specifies whether or not there are more search results in the
  2197.    enumeration. If true, there are more search results.
  2198.  
  2199.  
  2200. 5.16.2.  next
  2201.  
  2202.    public LDAPEntry next()
  2203.  
  2204.    Returns the next result in the enumeration as an LDAPEntry.
  2205.  
  2206.  
  2207. 5.16.3.  nextElement
  2208.  
  2209.    public Object nextElement()
  2210.  
  2211.  
  2212.  
  2213. Expires 1/98                                                   [Page 37]
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219. JAVA LDAP API                                                  July 1997
  2220.  
  2221.  
  2222.    Returns the next result in the enumeration as an Object. This the
  2223.    default implementation of Enumeration.nextElement().
  2224.  
  2225.  
  2226. 5.16.4.  sort
  2227.  
  2228.    public void sort(LDAPEntryComparator comp)
  2229.  
  2230.    Sorts all entries in the results using the provided comparison
  2231.    object. If the object has been partially or completely enumerated,
  2232.    only remaining elements are sorted. Sorting the results requires that
  2233.    they all be present. This implies that
  2234.    LDAPSearchResults.nextElement() will always block until all results
  2235.    have been retrieved, after a sort operation.
  2236.  
  2237.    The LDAPCompareAttrNames class is provided to support the common need
  2238.    to collate by a single or multiple attribute values, in ascending or
  2239.    descending order.  Examples are:
  2240.  
  2241.        res.sort(new LDAPCompareAttrNames("cn"));
  2242.  
  2243.        res.sort(new LDAPCompareAttrNames("cn", false));
  2244.  
  2245.        String[] attrNames = { "sn", "givenname" };
  2246.        res.sort(new LDAPCompareAttrNames(attrNames));
  2247.  
  2248.    Parameters are:
  2249.  
  2250.    comp            An object that implements the LDAPEntryComparator
  2251.                    interface to compare two objects of type LDAPEntry.
  2252.  
  2253.  
  2254. 5.17.  public class LDAPSecurityException extends LDAPException
  2255.  
  2256. This exception, derived from LDAPException, is thrown when a server
  2257. returns an error indicating a security violation.
  2258.  
  2259.  
  2260. 5.17.1.  Constructors
  2261.  
  2262.    public LDAPSecurityException()
  2263.  
  2264.    Constructs a default exception with no specific error information.
  2265.  
  2266.  
  2267.    public LDAPSecurityException(String message)
  2268.  
  2269.    Constructs a default exception with a specified string as additional
  2270.  
  2271.  
  2272.  
  2273. Expires 1/98                                                   [Page 38]
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279. JAVA LDAP API                                                  July 1997
  2280.  
  2281.  
  2282.    information. This form is used for lower-level errors.
  2283.  
  2284.  
  2285.    public LDAPSecurityException(String message,
  2286.                                 int resultCode,
  2287.                                 String serverMessage)
  2288.  
  2289.    Parameters are:
  2290.  
  2291.    message         The additional error information.
  2292.  
  2293.    resultCode      The result code returned
  2294.  
  2295.    serverMessage   Error message specifying additional information from
  2296.                    the server.
  2297.  
  2298.  
  2299. 5.18.  public interface LDAPSocketFactory
  2300.  
  2301. Used to construct a socket connection for use in an LDAPConnection.  An
  2302. implementation of this interface may, for example, provide an TLSSocket
  2303. connected to a secure server.
  2304.  
  2305.  
  2306. 5.18.1.  makeSocket
  2307.  
  2308.    public Socket makeSocket(String host, int port)
  2309.                             throws IOException, UnknownHostException
  2310.  
  2311.    Returns a socket connected using the provided host name and port
  2312.    number.
  2313.  
  2314.    There may be additional makeSocket methods defined when interfaces to
  2315.    establish TLS and SASL authentication in the java environment have
  2316.    been standardized.
  2317.  
  2318.    Parameters are:
  2319.  
  2320.    host            Contains a hostname or dotted string representing the
  2321.                    IP address of a host running an LDAP server to con-
  2322.                    nect to.
  2323.  
  2324.    port            Contains the TCP or UDP port number to connect to or
  2325.                    contact. The default LDAP port is 389.
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333. Expires 1/98                                                   [Page 39]
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339. JAVA LDAP API                                                  July 1997
  2340.  
  2341.  
  2342. 5.19.  public class LDAPUrl extends Object
  2343.  
  2344. Encapsulates parameters of an LDAP Url query, as defined in [8].  An
  2345. LDAPUrl object can be passed to LDAPConnection.search to retrieve search
  2346. results.
  2347.  
  2348.  
  2349. 5.19.1.  Constructors
  2350.  
  2351.    public LDAPUrl(String url) throws MalformedURLException
  2352.  
  2353.    Constructs a URL object with the specified string as URL.
  2354.  
  2355.  
  2356.    public LDAPUrl(String host,
  2357.                   int port,
  2358.                   String dn)
  2359.  
  2360.    Constructs with the specified host, port, and DN. This form is used
  2361.    to create URL references to a particular object in the directory.
  2362.  
  2363.  
  2364.    public LDAPUrl(String host,
  2365.                   int port,
  2366.                   String dn,
  2367.                   String attrNames[],
  2368.                   int scope,
  2369.                   String filter)
  2370.  
  2371.    Constructs a full-blown LDAP URL to specify an LDAP search operation.
  2372.  
  2373.    Parameters are:
  2374.  
  2375.    url             An explicit URL string, e.g.
  2376.                    "ldap://ldap.acme.com:80/o=Ace%20Industry,c=us?cn,sn?sub?
  2377.                    (objectclass=inetOrgPerson)".
  2378.  
  2379.    host            Host name of LDAP server, or null for "nearest
  2380.                    X.500/LDAP".
  2381.  
  2382.    port            Port number for LDAP server (use
  2383.                    LDAPConnection.DEFAULT_PORT for default port).
  2384.  
  2385.    dn              Distinguished name of object to fetch.
  2386.  
  2387.    attrNames       Names of attributes to retrieve. null for all attri-
  2388.                    butes.
  2389.  
  2390.  
  2391.  
  2392.  
  2393. Expires 1/98                                                   [Page 40]
  2394.  
  2395.  
  2396.  
  2397.  
  2398.  
  2399. JAVA LDAP API                                                  July 1997
  2400.  
  2401.  
  2402.    scope           Depth of search (in DN namespace). Use one of
  2403.                    SCOPE_BASE, SCOPE_ONE, SCOPE_SUB from LDAPv2.
  2404.  
  2405.  
  2406. 5.19.2.  decode
  2407.  
  2408.    public static String decode(String URLEncoded) throws MalformedURLEx-
  2409.    ception
  2410.  
  2411.    Decodes a URL-encoded string. Any occurences of %HH are decoded to
  2412.    the hex value represented. However, this routine does NOT decode "+"
  2413.    into " ". See [10] for details on URL encoding/decoding.
  2414.  
  2415.    Parameters are:
  2416.  
  2417.    URLEncoded      String to decode.
  2418.  
  2419.  
  2420. 5.19.3.  encode
  2421.  
  2422.    public static String encode(String toEncode)
  2423.  
  2424.    Encodes an arbitrary string. Any illegal characters are encoded as
  2425.    %HH.  However, this routine does NOT encode " " into "+".
  2426.  
  2427.    Parameters are:
  2428.  
  2429.    toEncode        String to encode.
  2430.  
  2431.  
  2432. 5.19.4.  getAttributes
  2433.  
  2434.    public String[] getAttributeArray()
  2435.  
  2436.    Return an array of attribute names specified in the URL
  2437.  
  2438.  
  2439. 5.19.5.  getAttributes
  2440.  
  2441.    public Enumeration getAttributes()
  2442.  
  2443.    Return an Enumerator for the attribute names specified in the URL
  2444.  
  2445.  
  2446. 5.19.6.  getDN
  2447.  
  2448.    public String getDN()
  2449.  
  2450.  
  2451.  
  2452.  
  2453. Expires 1/98                                                   [Page 41]
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459. JAVA LDAP API                                                  July 1997
  2460.  
  2461.  
  2462.    Return the distinguished name encapsulated in the URL.
  2463.  
  2464.  
  2465. 5.19.7.  getFilter
  2466.  
  2467.    public String getFilter()
  2468.  
  2469.    Returns the search filter [8], or the default filter -
  2470.    (objectclass=*) - if none was specified.
  2471.  
  2472.  
  2473. 5.19.8.  getHost
  2474.  
  2475.    public String getHost()
  2476.  
  2477.    Returns the host name of the LDAP server to connect to.
  2478.  
  2479. 5.19.9.  getPort
  2480.  
  2481.    public int getPort()
  2482.  
  2483.    Returns the port number of the LDAP server to connect to.
  2484.  
  2485.  
  2486. 5.19.10.  getUrl
  2487.  
  2488.    public String getUrl()
  2489.  
  2490.    Returns a valid string representation of this LDAP URL.
  2491.  
  2492.  
  2493. 5.20.  public interface LDAPv2
  2494.  
  2495. As a mechanism to support planned and future LDAP protocol extensions,
  2496. functionality is defined in an interface - LDAPv2, corresponding to ver-
  2497. sion 2 of the LDAP protocol. LDAPConnection currently implements LDAPv3,
  2498. which extends LDAPv2.  Applications can test for support of these proto-
  2499. col levels in a given package with the instanceof operator.
  2500.  
  2501. 5.20.1.  add
  2502.  
  2503.    public void add(LDAPEntry entry) throws LDAPException
  2504.  
  2505.    Adds an entry to the directory.
  2506.  
  2507.    Parameters are:
  2508.  
  2509.    entry           LDAPEntry object specifying the distinguished name
  2510.  
  2511.  
  2512.  
  2513. Expires 1/98                                                   [Page 42]
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519. JAVA LDAP API                                                  July 1997
  2520.  
  2521.  
  2522.                    and attributes of the new entry.
  2523.  
  2524.  
  2525. 5.20.2.  authenticate
  2526.  
  2527.    public void authenticate(String dn,
  2528.                             String passwd)
  2529.                             throws LDAPException
  2530.  
  2531.    Authenticates to the LDAP server (that the object is currently con-
  2532.    nected to) using the specified name and password.  If the object has
  2533.    been disconnected from an LDAP server, this method attempts to recon-
  2534.    nect to the server. If the object had already authenticated, the old
  2535.    authentication is discarded.
  2536.  
  2537.    Parameters are:
  2538.  
  2539.    dn              If non-null and non-empty, specifies that the connec-
  2540.                    tion and all operations through it should be authen-
  2541.                    ticated with dn as the distinguished name.
  2542.  
  2543.    passwd          If non-null and non-empty, specifies that the connec-
  2544.                    tion and all operations through it should be authen-
  2545.                    ticated with dn as the distinguished name and passwd
  2546.                    as password.
  2547.  
  2548.  
  2549. 5.20.3.  compare
  2550.  
  2551.    public boolean compare(String dn,
  2552.                           LDAPAttribute attr)
  2553.                           throws LDAPException
  2554.  
  2555.    Checks to see if an entry contains an attribute with a specified
  2556.    value.  Returns true if the entry has the value, and false if the
  2557.    entry does not have the value or the attribute.
  2558.  
  2559.    Parameters are:
  2560.  
  2561.    dn              The distinguished name of the entry to use in the
  2562.                    comparison.
  2563.  
  2564.    attr            The attribute to compare against the entry. The
  2565.                    method checks to see if the entry has an attribute
  2566.                    with the same name and value as this attribute.
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573. Expires 1/98                                                   [Page 43]
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579. JAVA LDAP API                                                  July 1997
  2580.  
  2581.  
  2582. 5.20.4.  connect
  2583.  
  2584.    public void connect(String host,
  2585.                        int port)
  2586.                        throws LDAPException
  2587.  
  2588.    Connects to the specified host and port. If this LDAPConnection
  2589.    object represents an open connection, the connection is closed first
  2590.    before the new connection is opened.  At this point there is no
  2591.    authentication, and any operations will be conducted as an anonymous
  2592.    client.
  2593.  
  2594.  
  2595.    public void connect(String host,
  2596.                        int port,
  2597.                        String dn,
  2598.                        String passwd)
  2599.                        throws LDAPException
  2600.  
  2601.    Connects to the specified host and port and uses the specified DN and
  2602.    password to authenticate to the server. If this LDAPConnection object
  2603.    represents an open connection, the connection is closed first before
  2604.    the new connection is opened. This is equivalent to connect(host,
  2605.    port) followed by authenticate(dn, passwd).
  2606.  
  2607.    Parameters are:
  2608.  
  2609.    host            Contains a hostname or dotted string representing the
  2610.                    IP address of a host running an LDAP server to con-
  2611.                    nect to. Alternatively, it may contain a list of host
  2612.                    names, space-delimited.  Each host name may include a
  2613.                    trailing colon and port number.  In the case where
  2614.                    more than one host name is specified, each host name
  2615.                    in turn will be contacted until a connection can be
  2616.                    established. Examples:
  2617.  
  2618.       "directory.knowledge.com"
  2619.       "199.254.1.2"
  2620.       "directory.knowledge.com:1050 people.catalog.com 199.254.1.2"
  2621.  
  2622.    port            Contains the TCP or UDP port number to connect to or
  2623.                    contact. The default LDAP port is 389. "port" is
  2624.                    ignored for any host name which includes a colon and
  2625.                    port number.
  2626.  
  2627.    dn              If non-null and non-empty, specifies that the connec-
  2628.                    tion and all operations through it should be authen-
  2629.                    ticated with dn as the distinguished name.
  2630.  
  2631.  
  2632.  
  2633. Expires 1/98                                                   [Page 44]
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639. JAVA LDAP API                                                  July 1997
  2640.  
  2641.  
  2642.    passwd          If non-null and non-empty, specifies that the connec-
  2643.                    tion and all operations through it should be authen-
  2644.                    ticated with dn as the distinguished name and passwd
  2645.                    as password.
  2646.  
  2647.  
  2648. 5.20.5.  delete
  2649.  
  2650.    public void delete(String dn) throws LDAPException
  2651.  
  2652.    Deletes the entry for the specified DN from the directory.
  2653.  
  2654.    Parameters are:
  2655.  
  2656.    dn              Distinguished name of the entry to modify.
  2657.  
  2658.  
  2659. 5.20.6.  disconnect
  2660.  
  2661.    public synchronized void disconnect() throws LDAPException
  2662.  
  2663.    Disconnects from the LDAP server. Before the object can perform LDAP
  2664.    operations again, it must reconnect to the server by calling connect.
  2665.  
  2666.  
  2667. 5.20.7.  getOption
  2668.  
  2669.    public Object getOption(int option) throws LDAPException
  2670.  
  2671.    Returns the value of the specified option for this object.
  2672.  
  2673.    Parameters are:
  2674.  
  2675.  
  2676.    option          See LDAPConnection.setOption for a description of
  2677.                    valid options.
  2678.  
  2679.  
  2680. 5.20.8.  modify
  2681.  
  2682.    public void modify(String dn,
  2683.                       LDAPModification mod)
  2684.                       throws LDAPException
  2685.  
  2686.    Makes a single change to an existing entry in the directory (for
  2687.    example, changes the value of an attribute, adds a new attribute
  2688.    value, or removes an existing attribute value).
  2689.  
  2690.  
  2691.  
  2692.  
  2693. Expires 1/98                                                   [Page 45]
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699. JAVA LDAP API                                                  July 1997
  2700.  
  2701.  
  2702.    The LDAPModification object specifies both the change to be made and
  2703.    the LDAPAttribute value to be changed.
  2704.  
  2705.  
  2706.    public void modify(String dn,
  2707.                       LDAPModificationSet mods)
  2708.                       throws LDAPException
  2709.  
  2710.    Makes a set of changes to an existing entry in the directory (for
  2711.    example, changes attribute values, adds new attribute values, or
  2712.    removes existing attribute values).
  2713.  
  2714.    Parameters are:
  2715.  
  2716.    dn              Distinguished name of the entry to modify.
  2717.  
  2718.    mod             A single change to be made to the entry.
  2719.  
  2720.    mods            A set of changes to be made to the entry.
  2721.  
  2722.  
  2723. 5.20.9.  read
  2724.  
  2725.    public LDAPEntry read(String dn) throws LDAPException
  2726.  
  2727.    Reads the entry for the specified distiguished name (DN) and
  2728.    retrieves all attributes for the entry.
  2729.  
  2730.  
  2731.    public LDAPEntry read(String dn,
  2732.                          String attrs[])
  2733.                          throws LDAPException
  2734.  
  2735.    Reads the entry for the specified distinguished name (DN) and
  2736.    retrieves only the specified attributes from the entry.
  2737.  
  2738.    Parameters are:
  2739.  
  2740.    dn              Distinguished name of the entry to retrieve.
  2741.  
  2742.    attrs           Names of attributes to retrieve.
  2743.  
  2744.  
  2745. 5.20.10.  rename
  2746.  
  2747.    public void rename(String dn,
  2748.                       String newRdn,
  2749.                       boolean deleteOldRdn)
  2750.  
  2751.  
  2752.  
  2753. Expires 1/98                                                   [Page 46]
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759. JAVA LDAP API                                                  July 1997
  2760.  
  2761.  
  2762.                       throws LDAPException
  2763.  
  2764.    Renames an existing entry in the directory.
  2765.  
  2766.    Parameters are:
  2767.  
  2768.    dn              Current distinguished name of the entry.
  2769.  
  2770.    newRdn          New relative distinguished name for the entry.
  2771.  
  2772.    deleteOldRdn    If true, the old name is not retained as an attribute
  2773.                    value.
  2774.  
  2775.  
  2776. 5.20.11.  search
  2777.  
  2778.    public LDAPSearchResults search(String base,
  2779.                                    int scope,
  2780.                                    String filter,
  2781.                                    String attrs[],
  2782.                                    boolean attrsOnly)
  2783.                                    throws LDAPException
  2784.  
  2785.    Performs the search specified by the parameters.
  2786.  
  2787.  
  2788.    public LDAPSearchResults search(String base,
  2789.                                    int scope,
  2790.                                    String filter,
  2791.                                    String attrs[],
  2792.                                    boolean attrsOnly,
  2793.                                    LDAPSearchConstraints cons)
  2794.                                    throws LDAPException
  2795.  
  2796.    Performs the search specified by the parameters, also allowing
  2797.    specification of constraints for the search (such as the maximum
  2798.    number of entries to find or the maximum time to wait for search
  2799.    results).
  2800.  
  2801.    As part of the search constraints, the function allows specifying
  2802.    whether or not the results are to be delivered all at once or in
  2803.    smaller batches. If specified that the results are to be delivered in
  2804.    smaller batches, each iteration blocks only until the next batch of
  2805.    results is returned.
  2806.  
  2807.    Parameters are:
  2808.  
  2809.    base            The base distinguished name to search from.
  2810.  
  2811.  
  2812.  
  2813. Expires 1/98                                                   [Page 47]
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819. JAVA LDAP API                                                  July 1997
  2820.  
  2821.  
  2822.    scope           The scope of the entries to search. The following are
  2823.                    the valid options:
  2824.  
  2825.  
  2826.                    LDAPv2.SCOPE_BASE Search only the base DN
  2827.  
  2828.                    LDAPv2.SCOPE_ONE  Search only entries under the base
  2829.                                      DN
  2830.  
  2831.                    LDAPv2.SCOPE_SUB  Search the base DN and all entries
  2832.                                      within its subtree
  2833.  
  2834.    filter          Search filter specifying the search criteria, as
  2835.                    defined in [3].
  2836.  
  2837.    attrs           Names of attributes to retrieve.
  2838.  
  2839.    attrsOnly       If true, returns the names but not the values of the
  2840.                    attributes found.  If false, returns the names and
  2841.                    values for attributes found
  2842.  
  2843.    cons            Constraints specific to the search.
  2844.  
  2845.  
  2846. 5.20.12.  setOption
  2847.  
  2848.    public void setOption(int option,
  2849.                          Object value)
  2850.                          throws LDAPException
  2851.  
  2852.    Sets the value of the specified option for this LDAPConnection
  2853.    object.
  2854.  
  2855.    See LDAPConnection.setOption for an implementation.
  2856.  
  2857.  
  2858. 5.21.  public interface LDAPv3 extends LDAPv2
  2859.  
  2860. LDAPv3 extends LDAPv2 by adding support for features of version 3 of the
  2861. LDAP protocol. LDAPConnection may implement only LDAPv2, or may imple-
  2862. ment LDAPv3. Applications can test for support of these protocol levels
  2863. in a given package with the instanceof operator.
  2864.  
  2865. 5.21.1.  Client and Server Controls
  2866.  
  2867. LDAPv3 operations can be extended through the use of controls. Controls
  2868. may be sent to a server or returned to the client with any LDAP message.
  2869. These controls are referred to as server controls. The LDAP API also
  2870.  
  2871.  
  2872.  
  2873. Expires 1/98                                                   [Page 48]
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879. JAVA LDAP API                                                  July 1997
  2880.  
  2881.  
  2882. supports a client-side extension mechanism through the use of client
  2883. controls (these controls affect the behavior of the LDAP API only and
  2884. are never sent to a server). A common class is used to represent both
  2885. types of controls - LDAPControl.
  2886.  
  2887. Controls are set and retrieved with the setOption and getOption methods,
  2888. using the keys LDAPv3.SERVERCONTROLS and LDAPv3.CLIENTCONTROLS.  Either
  2889. a single LDAPControl or an array may be passed, e.g.
  2890.  
  2891.       LDAPControl control = new LDAPControl( type, critical, vals );
  2892.       ld.setOption( LDAPv3.SERVERCONTROLS, control );
  2893.    or
  2894.       LDAPControl[] controls = new LDAPControl[2];
  2895.       controls[0] = new LDAPControl( type0, critical0, vals0 );
  2896.       controls[1] = new LDAPControl( type1, critical1, vals1 );
  2897.       ld.setOption( LDAPv3.SERVERCONTROLS, controls );
  2898.  
  2899.  
  2900. 5.21.2.  authenticate
  2901.  
  2902.    public void authenticate(int version,
  2903.                             String dn,
  2904.                             String passwd)
  2905.                             throws LDAPException
  2906.  
  2907.    Authenticates to the LDAP server (that the object is currently con-
  2908.    nected to) using the specified name and password, with the specified
  2909.    LDAP protocol version. If the server does not support the requested
  2910.    protocol version, an exception is thrown.  If the object has been
  2911.    disconnected from an LDAP server, this method attempts to reconnect
  2912.    to the server. If the object had already authenticated, the old
  2913.    authentication is discarded.
  2914.  
  2915.    Parameters are:
  2916.  
  2917.    version         LDAP protocol version requested: currently 2 or 3.
  2918.  
  2919.    dn              If non-null and non-empty, specifies that the connec-
  2920.                    tion and all operations through it should be authen-
  2921.                    ticated with dn as the distinguished name.
  2922.  
  2923.    passwd          If non-null and non-empty, specifies that the connec-
  2924.                    tion and all operations through it should be authen-
  2925.                    ticated with dn as the distinguished name and passwd
  2926.                    as password.
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933. Expires 1/98                                                   [Page 49]
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939. JAVA LDAP API                                                  July 1997
  2940.  
  2941.  
  2942. 5.21.3.  authenticate
  2943.  
  2944.    public void authenticate(String dn,
  2945.                             byte[] credentials,
  2946.                             String[] mechanisms,
  2947.                             Properties props,
  2948.                             SaslAuthenticationCallback authCb)
  2949.                             throws LDAPException
  2950.  
  2951.    Authenticates to the LDAP server using SASL authentication mechan-
  2952.    isms. Mechanisms will be tried in the order provided.  If a mechanism
  2953.    requires additional information (e.g.  credentials) to procede, and
  2954.    authCb is not null, authCb's request() method will be called. An
  2955.    LDAPException is thrown if authentication fails for all specified
  2956.    mechanisms.
  2957.  
  2958.    Parameters are:
  2959.  
  2960.    dn              Distinguished name to authenticate as
  2961.  
  2962.    credentials     Initial credentials to use on first authentication
  2963.                    request. The contents are specific to a SASL mechan-
  2964.                    ism.
  2965.  
  2966.    props           Properties to be used for authentication. Some are
  2967.                    only meaningful to a subset of all SASL mechanisms.
  2968.                    The following is a partial list of properties and
  2969.                    sample values:
  2970.  
  2971.       security.userid                         "default"
  2972.  
  2973.       security.policy.encryption              "true"
  2974.  
  2975.       security.policy.sign_without_encryption "false"
  2976.  
  2977.       security.policy.no_encryption           "false"
  2978.  
  2979.       security.policy.encryption.minimum      "40"
  2980.  
  2981.       security.policy.encryption.maximum      "128"
  2982.  
  2983.       security.policy.server_authentication   "true"
  2984.  
  2985.       security.server.fqdn                    "safe.mcom.com"
  2986.  
  2987.       security.maxbuffer                      "4096"
  2988.  
  2989.       security.ip.local                       "192.68.1.10"
  2990.  
  2991.  
  2992.  
  2993. Expires 1/98                                                   [Page 50]
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999. JAVA LDAP API                                                  July 1997
  3000.  
  3001.  
  3002.       security.ip.remote                      "192.68.1.50"
  3003.  
  3004.  
  3005. authCb          An object implementing the SaslAuthenticationCallback
  3006.                 interface, capable of returning additional information
  3007.                 to a SASL mechanism driver if necessary. This may or may
  3008.                 not involve interactively prompting the user for this
  3009.                 information. The parameter may be null, indicating that
  3010.                 the application will not provide additional information.
  3011.  
  3012.  
  3013. 5.21.4.  extendedOperation
  3014.  
  3015.    public LDAPExtendedOperation extendedOperation(
  3016.                                    LDAPExtendedOperation op )
  3017.                                    throws LDAPException
  3018.  
  3019.    Provides a means to access extended, non-mandatory operations offered
  3020.    by a particular LDAP version 3 compliant server.
  3021.  
  3022.    Returns an operation-specific object, containing an ID and an Octet
  3023.    String or BER-encoded value(s).
  3024.  
  3025.    Parameters are:
  3026.  
  3027.    op              Object which contains an identifier of the extended
  3028.                    operation, which should be one recognized by the par-
  3029.                    ticular server this client is connected to, and an
  3030.                    operation-specific sequence of Octet String or BER-
  3031.                    encoded value(s).
  3032.  
  3033.  
  3034. 5.21.5.  getResponseControls
  3035.  
  3036.    public LDAPControl[] getResponseControls()
  3037.  
  3038.    Returns the latest Server Controls returned by a Directory Server
  3039.    with a response to an LDAP request from the current thread, or null
  3040.    if the latest response contained no Server Controls.
  3041.  
  3042.  
  3043. 5.21.6.  rename
  3044.  
  3045.    public void rename(String dn,
  3046.                       String newRdn,
  3047.                       String newParentdn,
  3048.                       boolean deleteOldRdn)
  3049.                       throws LDAPException
  3050.  
  3051.  
  3052.  
  3053. Expires 1/98                                                   [Page 51]
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059. JAVA LDAP API                                                  July 1997
  3060.  
  3061.  
  3062.    Renames an existing entry in the directory, possibly repositioning it
  3063.    in the directory tree.
  3064.  
  3065.    Parameters are:
  3066.  
  3067.    dn              Current distinguished name of the entry.
  3068.  
  3069.    newRdn          New relative distinguished name for the entry.
  3070.  
  3071.    newParentdn     Distinguished name of the existing entry which is to
  3072.                    be the new parent of the entry.
  3073.  
  3074.    deleteOldRdn    If true, the old name is not retained as an attribute
  3075.                    value.
  3076.  
  3077.  
  3078. 5.22.  public interface SaslAuthenticationCallback
  3079.  
  3080. Note: this interface is not part of the LDAP classes. It is presented
  3081. here to clarify use of SASL mechanisms in authentication using the LDAP
  3082. classes.
  3083.  
  3084. An application may implement this interface to allow a SASL mechanism
  3085. driver to obtain additional information (e.g. credentials) as needed
  3086. during authentication. The implementation may or may not include
  3087. interactively prompting a user.
  3088.  
  3089. 5.22.1.  request
  3090.  
  3091.    public byte[] request(String prompt,
  3092.                          String type)
  3093.                          throws SaslException
  3094.  
  3095.    Parameters are:
  3096.  
  3097.    prompt          A prompt that may be presented to a user as a guide
  3098.                    to entering the requested information, or may be used
  3099.                    as a key to forming the user interface for requesting
  3100.                    the information, or may be ignored.
  3101.  
  3102.    type            An identifier of type of information requested by the
  3103.                    SASL mechanism driver, e.g. "password".
  3104.  
  3105.  
  3106. 6.  Security Considerations
  3107.  
  3108. LDAP supports security through protocol-level authentication, using
  3109. clear-text passwords or other more secure mechanisms.  It also supports
  3110.  
  3111.  
  3112.  
  3113. Expires 1/98                                                   [Page 52]
  3114.  
  3115.  
  3116.  
  3117.  
  3118.  
  3119. JAVA LDAP API                                                  July 1997
  3120.  
  3121.  
  3122. running over TLS, which provides strong security at the transport layer.
  3123. This draft does not cover TLS implementations, although it identifies a
  3124. mechanism for supplying one, through the LDAPSocketFactory interface. An
  3125. interface is defined for using protocol-independent SASL mechanism
  3126. drivers for authentication.
  3127.  
  3128. 7.  Acknowledgements
  3129.  
  3130. The proposed API was defined in collaboration with Thomas Kwan and
  3131. Stephan Gudmundson of NCware Technologies Corp.
  3132.  
  3133. 8.  Bibliography
  3134.  
  3135. [1]  The Directory: Selected Attribute Syntaxes.  CCITT, Recommendation
  3136.      X.520.
  3137.  
  3138. [2]  M. Wahl, A. Coulbeck, T. Howes, S. Kille, "Lightweight Directory
  3139.      Access Protocol: Standard and Pilot Attribute Definitions", Inter-
  3140.      net Draft draft-ietf-asid-ldapv3-attributes-03.txt, October 1996
  3141.  
  3142. [3]  T. Howes, "A String Representation of LDAP Search Filters," RFC
  3143.      1960, June 1996.
  3144.  
  3145. [4]  S. Kille, "A String Representation of Distinguished Names," RFC
  3146.      1779, March 1995.
  3147.  
  3148. [5]  S. Kille, "Using the OSI Directory to Achieve User Friendly Nam-
  3149.      ing," RFC 1781, March 1995.
  3150.  
  3151. [7]  M. Wahl, T. Howes, S. Kille, "Lightweight Directory Access Protocol
  3152.      (v3)", Internet Draft draft-ietf-asid-ldapv3-protocol-04.txt, March
  3153.      1997.
  3154.  
  3155. [8]  T. Howes, M. Smith, "An LDAP URL Format", RFC 1959, June 1996.
  3156.  
  3157. [9]  T. Howes, M. Smith, "The LDAP Application Program Interface", RFC
  3158.      1823, August 1995.
  3159.  
  3160. [10] T. Berners-Lee, L. Masinter, M. McCahill, "Uniform Resource Loca-
  3161.      tors (URL)", RFC 1738, December 1994.
  3162.  
  3163. [11] W. Yeong, T. Howes, S. Kille, "Lightweight Directory Access Proto-
  3164.      col", RFC 1777, March 1995.
  3165.  
  3166. [12] R. Weltman, "The Java LDAP Application Program Interface", Internet
  3167.      Draft draft-weltman-java-ldap-01.txt, April 1997.
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173. Expires 1/98                                                   [Page 53]
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179. JAVA LDAP API                                                  July 1997
  3180.  
  3181.  
  3182. 9.  Authors' Addresses
  3183.  
  3184.    Rob Weltman
  3185.    Netscape Communications Corp.
  3186.    501 E. Middlefield Rd.
  3187.    Mountain View, CA 94043
  3188.    USA
  3189.    +1 415 937-3301
  3190.    rweltman@netscape.com
  3191.  
  3192.    Tim Howes
  3193.    Netscape Communications Corp.
  3194.    501 E. Middlefield Rd.
  3195.    Mountain View, CA 94043
  3196.    USA
  3197.    +1 415 937-3419
  3198.    howes@netscape.com
  3199.  
  3200.    Mark Smith
  3201.    Netscape Communications Corp.
  3202.    501 E. Middlefield Rd.
  3203.    Mountain View, CA 94043
  3204.    USA
  3205.    +1 313 937-3477
  3206.    mcs@netscape.com
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233. Expires 1/98                                                   [Page 54]
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239. JAVA LDAP API                                                  July 1997
  3240.  
  3241.  
  3242. 10.  Appendix A - Sample java LDAP programs
  3243.  
  3244.    import netscape.ldap.*;
  3245.    import java.util.*;
  3246.  
  3247.    public class SearchJensen {
  3248.        public static void main( String[] args )
  3249.        {
  3250.            try {
  3251.                LDAPConnection ld = new LDAPConnection();
  3252.                /* Connect to server */
  3253.                String MY_HOST = "localhost";
  3254.                int MY_PORT = 389;
  3255.                ld.connect( MY_HOST, MY_PORT );
  3256.  
  3257.                /* authenticate to the directory as nobody */
  3258.                /* This is not really necessary if explicit authentication
  3259.                   is not desired, because there is already anonymous
  3260.                   authentication at connect time */
  3261.                ld.authenticate( "", "" );
  3262.  
  3263.                /* search for all entries with surname of Jensen */
  3264.                String MY_FILTER = "sn=Jensen";
  3265.                String MY_SEARCHBASE = "o=Ace Industry, c=US";
  3266.  
  3267.                LDAPSearchConstraints cons = ld.getSearchConstraints();
  3268.                /* Setting the batchSize to one will cause the result
  3269.                   enumeration below to block on one result at a time,
  3270.                   allowing us to update a list or do other things as
  3271.                   results come in. */
  3272.                /* We could set it to 0 if we just wanted to get all
  3273.                   results and were willing to block until then */
  3274.                cons.setBatchSize( 1 );
  3275.                LDAPSearchResults res = ld.search( MY_SEARCHBASE,
  3276.                                                    LDAPConnection.SCOPE_ONE,
  3277.                                                    MY_FILTER,
  3278.                                                    null,
  3279.                                                    false,
  3280.                                                    cons );
  3281.  
  3282.                /* Loop on results until finished */
  3283.                while ( res.hasMoreElements() ) {
  3284.  
  3285.                    /* Next directory entry */
  3286.                    LDAPEntry findEntry = (LDAPEntry)res.nextElement();
  3287.                    System.out.println( findEntry.getDN() );
  3288.  
  3289.                    /* Get the attributes of the entry */
  3290.  
  3291.  
  3292.  
  3293. Expires 1/98                                                   [Page 55]
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299. JAVA LDAP API                                                  July 1997
  3300.  
  3301.  
  3302.                    LDAPAttributeSet findAttrs = findEntry.getAttributeSet();
  3303.                    Enumeration enumAttrs = findAttrs.getAttributes();
  3304.                    System.out.println( "Attributes: " );
  3305.                    /* Loop on attributes */
  3306.                    while ( enumAttrs.hasMoreElements() ) {
  3307.                        LDAPAttribute anAttr =
  3308.                            (LDAPAttribute)enumAttrs.nextElement();
  3309.                        String attrName = anAttr.getName();
  3310.                        System.out.println( "" + attrName );
  3311.                        /* Loop on values for this attribute */
  3312.                        Enumeration enumVals = anAttr.getStringValues();
  3313.                        while ( enumVals.hasMoreElements() ) {
  3314.                            String aVal = ( String )enumVals.nextElement();
  3315.                            System.out.println( "" + aVal );
  3316.                        }
  3317.                    }
  3318.                }
  3319.                /* Done, so disconnect */
  3320.                ld.disconnect();
  3321.            }
  3322.            catch( LDAPException e ) {
  3323.                System.out.println( "Error: " + e.toString() );
  3324.            }
  3325.        }
  3326.    }
  3327.  
  3328.  
  3329.    public class ModifyEmail {
  3330.        public static void main( String[] args )
  3331.        {
  3332.            try {
  3333.                LDAPConnection ld = new LDAPConnection();
  3334.                /* Connect to server */
  3335.                String MY_HOST = "localhost";
  3336.                int MY_PORT = 389;
  3337.                ld.connect( MY_HOST, MY_PORT );
  3338.  
  3339.                /* authenticate to the directory as Bab Jensen */
  3340.                String MY_NAME = "cn=Barbara Jensen,o=Ace Industry,c=US";
  3341.                String MY_PASSWORD = "MysteryLady";
  3342.                ld.authenticate( MY_NAME, MY_PASSWORD );
  3343.  
  3344.                /* Prepare to change my email address */
  3345.                LDAPAttribute attrEmail =
  3346.                        new LDAPAttribute( "mail", "babs@ace.com" );
  3347.                LDAPModification mod =
  3348.                        new LDAPModification( LDAPModification.REPLACE,
  3349.                                              attrEmail );
  3350.  
  3351.  
  3352.  
  3353. Expires 1/98                                                   [Page 56]
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359. JAVA LDAP API                                                  July 1997
  3360.  
  3361.  
  3362.                /* Now modify the entry in the directory */
  3363.                ld.modify( MY_NAME, mod );
  3364.                System.out.println( "Entry modified"  );
  3365.  
  3366.                /* Done, so disconnect */
  3367.                ld.disconnect();
  3368.            }
  3369.            catch( LDAPException e ) {
  3370.                System.out.println( "Error: " + e.toString() );
  3371.            }
  3372.        }
  3373.    }
  3374.  
  3375.  
  3376.  
  3377.  
  3378.  
  3379.  
  3380.  
  3381.  
  3382.  
  3383.  
  3384.  
  3385.  
  3386.  
  3387.  
  3388.  
  3389.  
  3390.  
  3391.  
  3392.  
  3393.  
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413. Expires 1/98                                                   [Page 57]
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419. JAVA LDAP API                                                  July 1997
  3420.  
  3421.  
  3422. 11.  Appendix B - Changes from draft-weltman-java-ldap-00.txt
  3423.  
  3424.  
  3425. 11.1.  LDAPv3
  3426.  
  3427. This interface is new. It adds support for features of LDAP protocol
  3428. version 3.
  3429.  
  3430. 11.2.  SSL -> TLS
  3431.  
  3432. References to the Secure Socket Layer (SSL) have been replaced with
  3433. references to Transport Layer Security (TLS).
  3434.  
  3435. 11.3.  LDAPAttributeSet
  3436.  
  3437. Methods getAttribute(String name) and getBaseAttribute(String name) were
  3438. added.
  3439.  
  3440. 11.4.  LDAPCompareAttrNames
  3441.  
  3442. Constructors were added to allow specifying sorting in descending, and
  3443. not just ascending, order.
  3444.  
  3445. 11.5.  LDAPCompareAttrNames
  3446.  
  3447. Constructors were added to allow specifying sorting in descending, and
  3448. not just ascending, order.
  3449.  
  3450. 11.6.  LDAPControl
  3451.  
  3452. This is a new class to support the LDAPv3 protocol extension, where
  3453. Server or Client Controls may be specified for LDAP operations.
  3454.  
  3455. 11.7.  LDAPEntry
  3456.  
  3457. Methods getAttribute(String name) and getBaseAttribute(String name) were
  3458. added.
  3459.  
  3460. 11.8.  LDAPException
  3461.  
  3462. The method getMatchedDN was added.
  3463.  
  3464. 11.9.  LDAPExtendedOperation
  3465.  
  3466. New class to pass extended operations back and forth to/from the server,
  3467. for LDAPv3.
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473. Expires 1/98                                                   [Page 58]
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479. JAVA LDAP API                                                  July 1997
  3480.  
  3481.  
  3482. 11.10.  LDAPv2
  3483.  
  3484. For connect(), the "host" parameter may be a space-delimited list of
  3485. hosts to attempt to connect to. Each one may have a colon and a port
  3486. number attached.
  3487.  
  3488. 11.11.  Dereferencing aliases
  3489.  
  3490. LDAPConnection.setOption(), the LDAPSearchConstraints constructor,
  3491. LDAPSearchConstraints.getDereference(), and
  3492. LDAPSearchConstraints.setDereference() were changed so that the option
  3493. specifying how to dereference aliases is now an integer instead of a
  3494. boolean, and the legal values are declared.
  3495.  
  3496. 11.12.  Default referral hop limit
  3497.  
  3498. The default referral hop limit in LDAPConnection.setOption() was changed
  3499. from 5 to 10.
  3500.  
  3501. 11.13.  Examples
  3502.  
  3503. An example of how to modify an existing Directory entry was added to
  3504. appendix A.
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533. Expires 1/98                                                   [Page 59]
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539. JAVA LDAP API                                                  July 1997
  3540.  
  3541.  
  3542. 12.  Appendix C - Outstanding issues
  3543.  
  3544.  
  3545. 12.1.  Support for SASL authentication
  3546.  
  3547. The framework suggested in the LDAPv3 interface for SASL authentication
  3548. is tentative. It will need to be extended to and integrated into the
  3549. automatic referral-processing architecture, so that an LDAPRebindProc
  3550. can initiate new authentication procedures with servers that are
  3551. referred to by a search. The current specification only allows for sim-
  3552. ple authentication on automatic referral following.
  3553.  
  3554. If referrals are handled explicitly rather than automatically, by catch-
  3555. ing LDAPReferralException, the caller may use the LDAPv3 SASL framework.
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593. Expires 1/98                                                   [Page 60]
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599. 1.     Introduction...................................................1
  3600. 2.     Overview of the LDAP model.....................................2
  3601. 3.     Overview of the LDAP classes...................................3
  3602. 3.1.      Interfaces..................................................3
  3603. 3.2.      Classes.....................................................4
  3604. 3.3.      Exceptions..................................................5
  3605. 4.     Overview of LDAP API use.......................................5
  3606. 5.     The java LDAP classes..........................................6
  3607. 5.1.     LDAPAttribute................................................6
  3608. 5.1.1.       Constructors.............................................6
  3609. 5.1.2.       addValue.................................................7
  3610. 5.1.3.       getByteValues............................................7
  3611. 5.1.4.       getStringValues..........................................8
  3612. 5.1.5.       getName..................................................8
  3613. 5.1.6.       removeValue..............................................8
  3614. 5.1.7.       size.....................................................8
  3615. 5.2.     LDAPAttributeSet.............................................8
  3616. 5.2.1.       Constructors.............................................9
  3617. 5.2.2.       add......................................................9
  3618. 5.2.3.       elementAt................................................9
  3619. 5.2.4.       getAttribute.............................................9
  3620. 5.2.5.       getBaseAttribute.........................................10
  3621. 5.2.6.       getAttributes............................................10
  3622. 5.2.7.       remove...................................................10
  3623. 5.2.8.       removeElementAt..........................................11
  3624. 5.2.9.       size.....................................................11
  3625. 5.3.     LDAPCompareAttrNames.........................................11
  3626. 5.3.1.       Constructors.............................................11
  3627. 5.3.2.       isGreater................................................12
  3628. 5.4.     LDAPConnection...............................................12
  3629. 5.4.1.       Constructors.............................................13
  3630. 5.4.2.       clone....................................................13
  3631. 5.4.3.       getAuthenticationDN......................................13
  3632. 5.4.4.       getAuthenticationPassword................................13
  3633. 5.4.5.       getHost..................................................14
  3634. 5.4.6.       getPort..................................................14
  3635. 5.4.7.       getProperty..............................................14
  3636. 5.4.8.       getSearchConstraints.....................................14
  3637. 5.4.9.       getSocketFactory.........................................15
  3638. 5.4.10.      isAuthenticated..........................................15
  3639. 5.4.11.      isConnected..............................................15
  3640. 5.4.12.      read.....................................................15
  3641. 5.4.13.      search...................................................16
  3642. 5.4.14.      setOption................................................16
  3643. 5.4.15.      setProperty..............................................20
  3644. 5.4.16.      setSocketFactory.........................................20
  3645. 5.5.     LDAPControl..................................................21
  3646. 5.5.1.       Constructors.............................................21
  3647. 5.5.2.       getID....................................................21
  3648. 5.5.3.       isCritical...............................................21
  3649. 5.5.4.       getValue.................................................22
  3650. 5.6.     LDAPDN.......................................................22
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656. 5.6.1.       explodeDN................................................22
  3657. 5.6.2.       explodeRDN...............................................22
  3658. 5.7.     LDAPEntry....................................................23
  3659. 5.7.1.       Constructors.............................................23
  3660. 5.7.2.       getAttribute.............................................23
  3661. 5.7.3.       getBaseAttribute.........................................24
  3662. 5.7.4.       getAttributeSet..........................................24
  3663. 5.7.5.       getDN....................................................25
  3664. 5.8.     LDAPExtendedOperation........................................25
  3665. 5.8.1.       Constructors.............................................25
  3666. 5.8.2.       getID....................................................25
  3667. 5.8.3.       getValue.................................................25
  3668. 5.9.     LDAPEntryComparator..........................................26
  3669. 5.9.1.       isGreater................................................26
  3670. 5.10.    LDAPException................................................26
  3671. 5.10.1.      Constructors.............................................26
  3672. 5.10.2.      getLDAPErrorMessage......................................27
  3673. 5.10.3.      getLDAPResultCode........................................27
  3674. 5.10.4.      getMatchedDN.............................................27
  3675. 5.10.5.      Error codes..............................................28
  3676. 5.11.    LDAPModification.............................................29
  3677. 5.11.1.      Constructors.............................................29
  3678. 5.11.2.      getAttribute.............................................29
  3679. 5.11.3.      getOp....................................................29
  3680. 5.12.    LDAPModificationSet..........................................29
  3681. 5.12.1.      Constructors.............................................30
  3682. 5.12.2.      add......................................................30
  3683. 5.12.3.      elementAt................................................30
  3684. 5.12.4.      remove...................................................30
  3685. 5.12.5.      removeElementAt..........................................31
  3686. 5.12.6.      size.....................................................31
  3687. 5.13.    LDAPRebindAuth...............................................31
  3688. 5.13.1.      Constructors.............................................31
  3689. 5.13.2.      getDN....................................................31
  3690. 5.13.3.      getPassword..............................................31
  3691. 5.14.    LDAPReferralException........................................32
  3692. 5.14.1.      Constructors.............................................32
  3693. 5.14.2.      getURLs..................................................32
  3694. 5.15.    LDAPSearchConstraints........................................32
  3695. 5.15.1.      Constructors.............................................33
  3696. 5.15.2.      getBatchSize.............................................34
  3697. 5.15.3.      getDereference...........................................34
  3698. 5.15.4.      getHopLimit..............................................34
  3699. 5.15.5.      getMaxResults............................................34
  3700. 5.15.6.      getRebindProc............................................34
  3701. 5.15.7.      getReferrals.............................................35
  3702. 5.15.8.      getTimeLimit.............................................35
  3703. 5.15.9.      setBatchSize.............................................35
  3704. 5.15.10.     setDereference...........................................35
  3705. 5.15.11.     setHopLimit..............................................36
  3706. 5.15.12.     setMaxResults............................................36
  3707. 5.15.13.     setRebindProc............................................36
  3708.  
  3709.  
  3710.  
  3711.  
  3712.  
  3713. 5.15.14.     setReferrals.............................................36
  3714. 5.15.15.     setTimeLimit.............................................37
  3715. 5.16.    LDAPSearchResults............................................37
  3716. 5.16.1.      hasMoreElements..........................................37
  3717. 5.16.2.      next.....................................................37
  3718. 5.16.3.      nextElement..............................................37
  3719. 5.16.4.      sort.....................................................38
  3720. 5.17.    LDAPSecurityException........................................38
  3721. 5.17.1.      Constructors.............................................38
  3722. 5.18.    LDAPSocketFactory............................................39
  3723. 5.18.1.      makeSocket...............................................39
  3724. 5.19.    LDAPUrl......................................................40
  3725. 5.19.1.      Constructors.............................................40
  3726. 5.19.2.      decode...................................................41
  3727. 5.19.3.      encode...................................................41
  3728. 5.19.4.      getAttributes............................................41
  3729. 5.19.5.      getAttributes............................................41
  3730. 5.19.6.      getDN....................................................41
  3731. 5.19.7.      getFilter................................................42
  3732. 5.19.8.      getHost..................................................42
  3733. 5.19.9.      getPort..................................................42
  3734. 5.19.10.     getUrl...................................................42
  3735. 5.20.    LDAPv2.......................................................42
  3736. 5.20.1.      add......................................................42
  3737. 5.20.2.      authenticate.............................................43
  3738. 5.20.3.      compare..................................................43
  3739. 5.20.4.      connect..................................................44
  3740. 5.20.5.      delete...................................................45
  3741. 5.20.6.      disconnect...............................................45
  3742. 5.20.7.      getOption................................................45
  3743. 5.20.8.      modify...................................................45
  3744. 5.20.9.      read.....................................................46
  3745. 5.20.10.     rename...................................................46
  3746. 5.20.11.     search...................................................47
  3747. 5.20.12.     setOption................................................48
  3748. 5.21.    LDAPv3.......................................................48
  3749. 5.21.1.      Client and Server Controls...............................48
  3750. 5.21.2.      authenticate.............................................49
  3751. 5.21.3.      authenticate.............................................50
  3752. 5.21.4.      extendedOperation........................................51
  3753. 5.21.5.      getResponseControls......................................51
  3754. 5.21.6.      rename...................................................51
  3755. 5.22.    SaslAuthenticationCallback...................................52
  3756. 5.22.1.      request..................................................52
  3757. 6.     Security Considerations........................................52
  3758. 7.     Acknowledgements...............................................53
  3759. 8.     Bibliography...................................................53
  3760. 9.     Authors' Addresses.............................................54
  3761. 10.    Appendix A - Sample java LDAP programs.........................55
  3762. 11.    Appendix B - Changes from draft-weltman-java-ldap-00.txt.......58
  3763. 11.1.     LDAPv3......................................................58
  3764. 11.2.     SSL -> TLS..................................................58
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770. 11.3.     LDAPAttributeSet............................................58
  3771. 11.4.     LDAPCompareAttrNames........................................58
  3772. 11.5.     LDAPCompareAttrNames........................................58
  3773. 11.6.     LDAPControl.................................................58
  3774. 11.7.     LDAPEntry...................................................58
  3775. 11.8.     LDAPException...............................................58
  3776. 11.9.     LDAPExtendedOperation.......................................58
  3777. 11.10.    LDAPv2......................................................59
  3778. 11.11.    Dereferencing aliases.......................................59
  3779. 11.12.    Default referral hop limit..................................59
  3780. 11.13.    Examples....................................................59
  3781. 12.    Appendix C - Outstanding issues................................60
  3782. 12.1.     Support for SASL authentication.............................60
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.