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(org.apache.directory.server.ldap.LdapServer ldapServer)
Creates a new
LdapNetworkConnection and authenticates as admin user. |
static org.apache.directory.ldap.client.api.LdapConnection |
getAnonymousNetworkConnection(org.apache.directory.server.ldap.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(org.apache.directory.server.ldap.LdapServer ldapServer)
Gets the pooled
LdapConnectionPool, authenticated as admin user. |
static void |
releasePooledAdminConnection(org.apache.directory.ldap.client.api.LdapConnection conn,
org.apache.directory.server.ldap.LdapServer ldapServer)
Releases a pooled connection back to the pool.
|
public static org.apache.directory.ldap.client.api.LdapNetworkConnection createAdminConnection(org.apache.directory.server.ldap.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(org.apache.directory.server.ldap.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, org.apache.directory.server.ldap.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(org.apache.directory.server.ldap.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 © 2009–2023 The Apache Software Foundation. All rights reserved.