title: MongoClient (from mongoDB Api) equivalent in LDAP
body: <p>I need to provide a pool of connections to a LDAP db, I'm using unbound the problem is that in the structure that we are using, I need to create one instance of the connection and this instance must manage the resource usage limits as max connecctions, similar as creating an instance of <a href="http://mongodb.github.io/mongo-java-driver/2.13/getting-started/quick-tour/" rel="nofollow">Mongoclient</a></p>
  
  <blockquote>
    <p>The MongoClient class is designed to be thread safe and shared among
    threads. Typically you create only 1 instance for a given database
    cluster and use it across your application.</p>
    
    <p>IMPORTANT When creating many MongoClient instances:</p>
    
    <p>All resource usage limits (max connections, etc) apply per MongoClient
    instance To dispose of an instance, make sure you call
    MongoClient.close() to clean up resources</p>
  </blockquote>
  
  <p>The Unboundid sdk has the classes <a href="https://docs.ldap.com/ldap-sdk/docs/javadoc/com/unboundid/ldap/sdk/LDAPConnectionPool.html" rel="nofollow">LDAPConnectionPool</a> class and the LDAPConnection. But do not have something that is similar to Mongoclient, for creating a single instance of an lDAPClient and this will be the one that take care of the usage limits. How can I implement this, this are examples for creating connection pools, but I think that this only create the connection pool but doesn't have an object as mongoclient</p>
  
  <pre><code>// Create a new LDAP connection pool with ten connections established and
     // authenticated to the same server:
     LDAPConnection connection = new LDAPConnection(address, port);
     BindResult bindResult = connection.bind(bindDN, password);
     LDAPConnectionPool connectionPool = new LDAPConnectionPool(connection, 10);
  </code></pre>
  
  <p>So my question is how can I build an LDAPclient similar to MOngoclient, or it is a library that I can use </p>