Class LdapConnectionProvider
- java.lang.Object
-
- org.apache.directory.fortress.core.ldap.LdapConnectionProvider
-
public class LdapConnectionProvider extends Object
This utility manages the LDAP connection pools and provides methods for adding / removing connections from the three pools.- Admin Connections - bound with ldap service account creds
- User Connections - unbound used for authentication
- Audit Log Connections - bound with slapo access log service account creds (OpenLDAP only)
This class is not thread safe.
- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeAdminConnection(org.apache.directory.ldap.client.api.LdapConnection connection)
Calls the PoolMgr to close the Admin LDAP connection.static void
closeAllConnectionPools()
Closes all the ldap connection pools.void
closeLogConnection(org.apache.directory.ldap.client.api.LdapConnection connection)
Calls the PoolMgr to close the Log LDAP connection.void
closeUserConnection(org.apache.directory.ldap.client.api.LdapConnection connection)
Calls the PoolMgr to close the User LDAP connection.org.apache.directory.ldap.client.api.LdapConnection
getAdminConnection()
Calls the PoolMgr to get an Admin connection to the LDAP server.static LdapConnectionProvider
getInstance()
Synchronized getter guards access to reference to self which is a singleton and only be created the first time invoked.org.apache.directory.ldap.client.api.LdapConnection
getLogConnection()
Calls the PoolMgr to get an Log connection to the LDAP server.org.apache.directory.ldap.client.api.LdapConnection
getUserConnection()
Calls the PoolMgr to get an User connection to the LDAP server.
-
-
-
Method Detail
-
getInstance
public static LdapConnectionProvider getInstance()
Synchronized getter guards access to reference to self which is a singleton and only be created the first time invoked.- Returns:
- reference to self.
-
closeAdminConnection
public void closeAdminConnection(org.apache.directory.ldap.client.api.LdapConnection connection)
Calls the PoolMgr to close the Admin LDAP connection.- Parameters:
connection
- handle to ldap connection object.
-
closeLogConnection
public void closeLogConnection(org.apache.directory.ldap.client.api.LdapConnection connection)
Calls the PoolMgr to close the Log LDAP connection.- Parameters:
connection
- handle to ldap connection object.
-
closeUserConnection
public void closeUserConnection(org.apache.directory.ldap.client.api.LdapConnection connection)
Calls the PoolMgr to close the User LDAP connection.- Parameters:
connection
- handle to ldap connection object.
-
getAdminConnection
public org.apache.directory.ldap.client.api.LdapConnection getAdminConnection() throws org.apache.directory.api.ldap.model.exception.LdapException
Calls the PoolMgr to get an Admin connection to the LDAP server.- Returns:
- ldap connection.
- Throws:
org.apache.directory.api.ldap.model.exception.LdapException
- If we had an issue getting an LDAP connection
-
getLogConnection
public org.apache.directory.ldap.client.api.LdapConnection getLogConnection() throws org.apache.directory.api.ldap.model.exception.LdapException
Calls the PoolMgr to get an Log connection to the LDAP server.- Returns:
- ldap connection.
- Throws:
org.apache.directory.api.ldap.model.exception.LdapException
- If we had an issue getting an LDAP connection
-
getUserConnection
public org.apache.directory.ldap.client.api.LdapConnection getUserConnection() throws org.apache.directory.api.ldap.model.exception.LdapException
Calls the PoolMgr to get an User connection to the LDAP server.- Returns:
- ldap connection.
- Throws:
org.apache.directory.api.ldap.model.exception.LdapException
- If we had an issue getting an LDAP connection
-
closeAllConnectionPools
public static void closeAllConnectionPools()
Closes all the ldap connection pools.
-
-