public final class LdapApiIntegrationUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
closeConnection(org.apache.directory.ldap.client.api.LdapNetworkConnection conn)
Closes the
LdapNetworkConnection . |
static org.apache.directory.ldap.client.api.LdapNetworkConnection |
createAdminConnection(LdapServer ldapServer)
Creates a new
LdapNetworkConnection and authenticates as admin user. |
static org.apache.directory.ldap.client.api.LdapConnection |
getAnonymousNetworkConnection(LdapServer ldapServer)
Gets an anonymous LdapNetworkConnection
|
static org.apache.directory.ldap.client.api.LdapConnection |
getAnonymousNetworkConnection(String host,
int port)
Gets an anonymous LdapNetworkConnection
|
static org.apache.directory.ldap.client.api.LdapConnection |
getPooledAdminConnection(LdapServer ldapServer)
Gets the pooled
LdapConnectionPool , authenticated as admin user. |
static void |
releasePooledAdminConnection(org.apache.directory.ldap.client.api.LdapConnection conn,
LdapServer ldapServer)
Releases a pooled connection back to the pool.
|
public static org.apache.directory.ldap.client.api.LdapNetworkConnection createAdminConnection(LdapServer ldapServer) throws org.apache.directory.api.ldap.model.exception.LdapException
LdapNetworkConnection
and authenticates as admin user.
The caller is responsible for closing the connection, use closeConnection().ldapServer
- the LDAP server instance, used to obtain the port usedorg.apache.directory.api.ldap.model.exception.LdapException
- the LDAP exceptionpublic static void closeConnection(org.apache.directory.ldap.client.api.LdapNetworkConnection conn) throws org.apache.directory.api.ldap.model.exception.LdapException, IOException
LdapNetworkConnection
.conn
- the connection to closeorg.apache.directory.api.ldap.model.exception.LdapException
- the LDAP exceptionIOException
- Signals that an I/O exception has occurred.public static org.apache.directory.ldap.client.api.LdapConnection getPooledAdminConnection(LdapServer ldapServer) throws org.apache.directory.api.ldap.model.exception.LdapException
LdapConnectionPool
, authenticated as admin user.
The caller is reponsible for releasing the connection, use releasePooledConnection().ldapServer
- the LDAP server instance, used to obtain the port usedorg.apache.directory.api.ldap.model.exception.LdapException
- the exceptionpublic static void releasePooledAdminConnection(org.apache.directory.ldap.client.api.LdapConnection conn, LdapServer ldapServer) throws org.apache.directory.api.ldap.model.exception.LdapException
conn
- the connection to releaseldapServer
- the LDAP server instance, used to obtain the port usedorg.apache.directory.api.ldap.model.exception.LdapException
- the exceptionpublic static org.apache.directory.ldap.client.api.LdapConnection getAnonymousNetworkConnection(String host, int port) throws org.apache.directory.api.ldap.model.exception.LdapException
host
- The server to connect toport
- The port to connect withorg.apache.directory.api.ldap.model.exception.LdapException
- If the connection could not be established.public static org.apache.directory.ldap.client.api.LdapConnection getAnonymousNetworkConnection(LdapServer ldapServer) throws org.apache.directory.api.ldap.model.exception.LdapException
ldapServer
- The LDAP server we want to connect toorg.apache.directory.api.ldap.model.exception.LdapException
- If the connection could not be established.Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.