Skip to content

Commit

Permalink
Add a PooledReferralConnector Javadoc example
Browse files Browse the repository at this point in the history
  • Loading branch information
dirmgr committed Aug 2, 2023
1 parent 1093ed7 commit 69d79ba
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/com/unboundid/ldap/sdk/PooledReferralConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,36 @@
* This class provides an implementation of a reusable referral connector that
* maintains pools of connections to each of the servers accessed in the course
* of following referrals. Connections may be reused across multiple
* referrals.
* referrals. Note that it is important to close the connector when it is no
* longer needed, as that will ensure that all of the connection pools that it
* maintains will be closed.
* <BR><BR>
* <H2>Example</H2>
* The following example demonstrates the process for establishing an LDAP
* connection that will use this connector for following any referrals that are
* encountered during processing:
* <PRE>
* PooledReferralConnectorProperties properties =
* new PooledReferralConnectorProperties();
*
* PooledReferralConnector referralConnector =
* new PooledReferralConnector(properties);
*
* LDAPConnectionOptions options = new LDAPConnectionOptions();
* options.setFollowReferrals(true);
* options.setReferralConnector(referralConnector);
*
* try (LDAPConnection conn = new LDAPConnection(socketFactory, options,
* serverAddress, serverPort)
* {
* // Use the connection to perform whatever processing is needed that might
* // involve receiving referrals.
* }
* finally
* {
* referralConnector.close();
* }
* </PRE>
*/
@NotMutable()
@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
Expand Down

0 comments on commit 69d79ba

Please sign in to comment.