LDAPConnectionPools.java revision ce4d3fddc8fe2eddd68a20af9570b3cc63ece5ab
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: LDAPConnectionPools.java,v 1.7 2009/01/28 05:35:01 ww203982 Exp $
*
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
/**
* Provides a pool of <code>LDAPConnection</code>
* objects per host(s) for the policy service to use.
*/
public class LDAPConnectionPools {
private final static int MIN_CONNECTION_POOL_SIZE = 1;
private final static int MAX_CONNECTION_POOL_SIZE = 10;
private final static int DEFAULT_PORT = 389;
private LDAPConnectionPools() {
// Do nothing
}
/**
* Create a Ldap Connection Pool for a ldap server
* @param host the name of the LDAP server host and its port number.
* For example, dsame.sun.com:389
* Alternatively, this can be a space-delimited list of
* host names.
* @param ssl if the connection is in ssl
* @param minPoolSize minimal pool size
* @param maxPoolSize maximum pool size
*/
boolean ssl,
int minPoolSize,
int maxPoolSize)
throws PolicyException {
initConnectionPool(host, authDN, authPasswd, ssl, minPoolSize, maxPoolSize, Options.defaultOptions());
}
/**
* Create a Ldap Connection Pool for a ldap server
* @param host the name of the LDAP server host and its port number.
* For example, dsame.sun.com:389
* Alternatively, this can be a space-delimited list of
* host names.
* @param ssl if the connection is in ssl
* @param minPoolSize minimal pool size
* @param maxPoolSize maximum pool size
*/
boolean ssl,
int minPoolSize,
int maxPoolSize,
throws PolicyException {
}
try {
synchronized(connectionPools) {
if (debug.messageEnabled()) {
}
if (ssl) {
}
if (minPoolSize < 1) {
}
if (maxPoolSize < 1) {
}
if (idleTimeout == 0) {
debug.error("LDAPConnectionPools: Idle timeout could not be parsed, connection reaping is disabled");
}
public void shutdown() {
}
});
}
}
}
catch (Exception e) {
throw new PolicyException(e.getMessage(), e);
}
}
/**
* Get LDAPConnectionPool for the ldap server from the pools.
* @param host the name of host and its port number.
* It can be a space-delimited list of host names.
* @return LDAPConnectionPool for the ldap server
*/
{
if (debug.messageEnabled()) {
host);
}
synchronized(connectionPools) {
}
}
}