org.ldaptive.pool
Class PoolConfig

java.lang.Object
  extended by org.ldaptive.AbstractConfig
      extended by org.ldaptive.pool.PoolConfig

public class PoolConfig
extends AbstractConfig

Contains all the configuration data that the pooling implementations need to control the pool.

Version:
$Revision: 3161 $ $Date: 2016-10-05 16:40:19 -0400 (Wed, 05 Oct 2016) $
Author:
Middleware Services

Field Summary
static int DEFAULT_MAX_POOL_SIZE
          Default max pool size, value is 10.
static int DEFAULT_MIN_POOL_SIZE
          Default min pool size, value is 3.
static boolean DEFAULT_VALIDATE_ON_CHECKIN
          Default validate on check in, value is false.
static boolean DEFAULT_VALIDATE_ON_CHECKOUT
          Default validate on check out, value is false.
static long DEFAULT_VALIDATE_PERIOD
          Default validate period, value is 1800L.
static boolean DEFAULT_VALIDATE_PERIODICALLY
          Default validate periodically, value is false.
static long DEFAULT_VALIDATE_TIMEOUT
          Default per connection validate timeout, value is 5000L.
 
Fields inherited from class org.ldaptive.AbstractConfig
logger
 
Constructor Summary
PoolConfig()
           
 
Method Summary
 int getMaxPoolSize()
          Returns the max pool size.
 int getMinPoolSize()
          Returns the min pool size.
 long getValidatePeriod()
          Returns the validate period.
 String getValidatePeriodDuration()
          Returns the validate period as a duration.
 long getValidateTimeout()
          Returns the timeout in milliseconds imposed when validating a single connection.
 String getValidateTimeoutDuration()
          Returns the validate timeout as a duration.
 boolean isValidateOnCheckIn()
          Returns the validate on check in flag.
 boolean isValidateOnCheckOut()
          Returns the validate on check out flag.
 boolean isValidatePeriodically()
          Returns the validate periodically flag.
 void setMaxPoolSize(int size)
          Sets the max pool size.
 void setMinPoolSize(int size)
          Sets the min pool size.
 void setValidateOnCheckIn(boolean b)
          Sets the validate on check in flag.
 void setValidateOnCheckOut(boolean b)
          Sets the validate on check out flag.
 void setValidatePeriod(long time)
          Sets the period for which the pool will be validated.
 void setValidatePeriodDuration(String time)
          Sets the period for which the pool will be validated.
 void setValidatePeriodically(boolean b)
          Sets the validate periodically flag.
 void setValidateTimeout(long time)
          Sets the timeout imposed when validating a single connection.
 void setValidateTimeoutDuration(String time)
          Sets the timeout imposed when validating a single connection.
 String toString()
          
 
Methods inherited from class org.ldaptive.AbstractConfig
checkImmutable, checkStringInput, makeImmutable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MIN_POOL_SIZE

public static final int DEFAULT_MIN_POOL_SIZE
Default min pool size, value is 3.

See Also:
Constant Field Values

DEFAULT_MAX_POOL_SIZE

public static final int DEFAULT_MAX_POOL_SIZE
Default max pool size, value is 10.

See Also:
Constant Field Values

DEFAULT_VALIDATE_ON_CHECKIN

public static final boolean DEFAULT_VALIDATE_ON_CHECKIN
Default validate on check in, value is false.

See Also:
Constant Field Values

DEFAULT_VALIDATE_ON_CHECKOUT

public static final boolean DEFAULT_VALIDATE_ON_CHECKOUT
Default validate on check out, value is false.

See Also:
Constant Field Values

DEFAULT_VALIDATE_PERIODICALLY

public static final boolean DEFAULT_VALIDATE_PERIODICALLY
Default validate periodically, value is false.

See Also:
Constant Field Values

DEFAULT_VALIDATE_PERIOD

public static final long DEFAULT_VALIDATE_PERIOD
Default validate period, value is 1800L.

See Also:
Constant Field Values

DEFAULT_VALIDATE_TIMEOUT

public static final long DEFAULT_VALIDATE_TIMEOUT
Default per connection validate timeout, value is 5000L.

See Also:
Constant Field Values
Constructor Detail

PoolConfig

public PoolConfig()
Method Detail

getMinPoolSize

public int getMinPoolSize()
Returns the min pool size. Default value is DEFAULT_MIN_POOL_SIZE. This value represents the size of the pool after a prune has occurred.

Returns:
min pool size

setMinPoolSize

public void setMinPoolSize(int size)
Sets the min pool size.

Parameters:
size - min pool size

getMaxPoolSize

public int getMaxPoolSize()
Returns the max pool size. Default value is DEFAULT_MAX_POOL_SIZE. This value may or may not be strictly enforced depending on the pooling implementation.

Returns:
max pool size

setMaxPoolSize

public void setMaxPoolSize(int size)
Sets the max pool size.

Parameters:
size - max pool size

isValidateOnCheckIn

public boolean isValidateOnCheckIn()
Returns the validate on check in flag. Default value is DEFAULT_VALIDATE_ON_CHECKIN.

Returns:
validate on check in

setValidateOnCheckIn

public void setValidateOnCheckIn(boolean b)
Sets the validate on check in flag.

Parameters:
b - validate on check in

isValidateOnCheckOut

public boolean isValidateOnCheckOut()
Returns the validate on check out flag. Default value is DEFAULT_VALIDATE_ON_CHECKOUT.

Returns:
validate on check in

setValidateOnCheckOut

public void setValidateOnCheckOut(boolean b)
Sets the validate on check out flag.

Parameters:
b - validate on check out

isValidatePeriodically

public boolean isValidatePeriodically()
Returns the validate periodically flag. Default value is DEFAULT_VALIDATE_PERIODICALLY.

Returns:
validate periodically

setValidatePeriodically

public void setValidatePeriodically(boolean b)
Sets the validate periodically flag.

Parameters:
b - validate periodically

getValidatePeriod

public long getValidatePeriod()
Returns the validate period. Default value is DEFAULT_VALIDATE_PERIOD.

Returns:
validate period in seconds

setValidatePeriod

public void setValidatePeriod(long time)
Sets the period for which the pool will be validated.

Parameters:
time - in seconds

getValidatePeriodDuration

public String getValidatePeriodDuration()
Returns the validate period as a duration.

Returns:
validate period in duration syntax

setValidatePeriodDuration

public void setValidatePeriodDuration(String time)
Sets the period for which the pool will be validated.

Parameters:
time - in duration syntax or in seconds

getValidateTimeout

public long getValidateTimeout()
Returns the timeout in milliseconds imposed when validating a single connection.

Returns:
validate timeout

setValidateTimeout

public void setValidateTimeout(long time)
Sets the timeout imposed when validating a single connection.

Parameters:
time - in milliseconds for a connection validation

getValidateTimeoutDuration

public String getValidateTimeoutDuration()
Returns the validate timeout as a duration.

Returns:
validate timeout in duration syntax

setValidateTimeoutDuration

public void setValidateTimeoutDuration(String time)
Sets the timeout imposed when validating a single connection.

Parameters:
time - in duration syntax or in milliseconds

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.