| | |
| | | <document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd"> |
| | | <properties> |
| | | <title>About ${project.name}</title> |
| | | <title>About OpenDJ LDAP SDK</title> |
| | | <author email="opendj-dev@forgerock.org">${project.organization.name}</author> |
| | | </properties> |
| | | <body> |
| | | <section name="About ${project.name}"> |
| | | <section name="About OpenDJ LDAP SDK"> |
| | | <p> |
| | | ${project.description} |
| | | The OpenDJ LDAP SDK provides a set of modern, developer-friendly Java |
| | | APIs as part of the OpenDJ product suite. The product suite includes the |
| | | client SDK alongside command-line tools and sample code, a 100% pure |
| | | Java directory server, and more. You can use OpenDJ SDK to create client |
| | | applications for use with any server that complies with the, |
| | | <a href='http://tools.ietf.org/html/rfc4510'>RFC 4510: Lightweight Directory |
| | | Access Protocol (LDAP): Technical Specification Road Map</a>. |
| | | </p> |
| | | <p> |
| | | The OpenDJ LDAP SDK brings you easy-to-use connection management, |
| | | connection pooling, load balancing, and all the standard LDAP operations |
| | | to read and write directory entries. OpenDJ LDAP SDK also lets you build |
| | | applications with capabilities defined in additional draft and |
| | | experimental RFCs that are supported by modern LDAP servers. |
| | | </p> |
| | | </section> |
| | | <section name="Documentation for ${project.name}"> |
| | | <section name="Documentation for OpenDJ SDK"> |
| | | <p> |
| | | Javadoc for this module can be found <a href="apidocs/index.html">here</a>. |
| | | Read the <a href="../doc/dev-guide/index.html">developer guide</a> for |
| | | a deeper understanding of LDAP application development, as well as a |
| | | detailed over of LDAP itself. |
| | | </p> |
| | | </section> |
| | | <section name="Get ${project.name}"> |
| | | <section name="Get the OpenDJ LDAP SDK"> |
| | | <p> |
| | | Start developing your applications by obtaining ${project.name} |
| | | using any of the following methods: |
| | | You can start developing your LDAP applications now by obtaining the |
| | | OpenDJ LDAP SDK using any of the following methods: |
| | | </p> |
| | | <subsection name="Maven"> |
| | | <p> |
| | |
| | | <enabled>false</enabled> |
| | | </releases> |
| | | </repository> |
| | | </repositories> |
| | | |
| | | ... |
| | | |
| | | <dependencies> |
| | | </repositories></source> |
| | | <p> |
| | | The following dependencies will load both the OpenDJ Core APIs and the |
| | | OpenDJ Grizzly network transport: |
| | | </p> |
| | | <source><dependencies> |
| | | <dependency> |
| | | <groupId>${project.groupId}</groupId> |
| | | <artifactId>${project.artifactId}</artifactId> |
| | | <version>${project.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>${project.groupId}</groupId> |
| | | <artifactId>opendj-grizzly</artifactId> |
| | | <version>${project.version}</version> |
| | | </dependency> |
| | | </dependencies></source> |
| | | <p> |
| | | In some use-cases, such as developing LDAP unit tests or embedded |
| | | LDAP applications, the network transport is not required, in which |
| | | case you can simply declare a dependency on the OpenDJ core APIs: |
| | | </p> |
| | | <source><dependencies> |
| | | <dependency> |
| | | <groupId>${project.groupId}</groupId> |
| | | <artifactId>${project.artifactId}</artifactId> |
| | |
| | | </section> |
| | | <section name="Getting started"> |
| | | <p> |
| | | Please refer to the <a href="../opendj-ldap-sdk">example</a> in the OpenDJ LDAP SDK page. |
| | | The following example shows how the OpenDJ SDK may be used to |
| | | connect to a Directory Server, authenticate, and then perform a |
| | | search. The search results are output as LDIF to the standard output: |
| | | </p> |
| | | <source>// Create an LDIF writer which will write the search results to stdout. |
| | | final LDIFEntryWriter writer = new LDIFEntryWriter(System.out); |
| | | Connection connection = null; |
| | | try |
| | | { |
| | | // Connect and bind to the server. |
| | | final LDAPConnectionFactory factory = new LDAPConnectionFactory("localhost", 1389); |
| | | |
| | | connection = factory.getConnection(); |
| | | connection.bind(userName, password); |
| | | |
| | | // Read the entries and output them as LDIF. |
| | | final ConnectionEntryReader reader = connection.search(baseDN, scope, filter, attributes); |
| | | while (reader.hasNext()) |
| | | { |
| | | if (reader.isEntry()) |
| | | { |
| | | // Got an entry. |
| | | final SearchResultEntry entry = reader.readEntry(); |
| | | writer.writeComment("Search result entry: " + entry.getName().toString()); |
| | | writer.writeEntry(entry); |
| | | } |
| | | else |
| | | { |
| | | // Got a continuation reference. |
| | | final SearchResultReference ref = reader.readReference(); |
| | | writer.writeComment("Search result reference: " + ref.getURIs().toString()); |
| | | } |
| | | } |
| | | writer.flush(); |
| | | } |
| | | catch (final Exception e) |
| | | { |
| | | // Handle exceptions... |
| | | System.err.println(e.getMessage()); |
| | | } |
| | | finally |
| | | { |
| | | if (connection != null) |
| | | { |
| | | connection.close(); |
| | | } |
| | | }</source> |
| | | <p> |
| | | You can find more examples in the <a href="../opendj-ldap-sdk-examples/index.html">OpenDJ LDAP SDK Examples</a> module. |
| | | </p> |
| | | </section> |
| | | </body> |