Package org.ldaptive.pool
Class PoolConfig
- java.lang.Object
-
- org.ldaptive.AbstractConfig
-
- org.ldaptive.pool.PoolConfig
-
public class PoolConfig extends AbstractConfig
Contains all the configuration data that the pooling implementations need to control the pool.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PoolConfig.Builder
-
Field Summary
Fields Modifier and Type Field Description 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 boolean
DEFAULT_VALIDATE_PERIODICALLY
Default validate periodically, value is false.private int
maxPoolSize
Maximum pool size.private int
minPoolSize
Minimum pool size.private boolean
validateOnCheckIn
Whether the ldap object should be validated when returned to the pool.private boolean
validateOnCheckOut
Whether the ldap object should be validated when given from the pool.private boolean
validatePeriodically
Whether the pool should be validated periodically.-
Fields inherited from class org.ldaptive.AbstractConfig
logger
-
-
Constructor Summary
Constructors Constructor Description PoolConfig()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PoolConfig.Builder
builder()
Creates a builder for this class.int
getMaxPoolSize()
Returns the max pool size.int
getMinPoolSize()
Returns the min pool size.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
setValidatePeriodically(boolean b)
Sets the validate periodically flag.String
toString()
-
Methods inherited from class org.ldaptive.AbstractConfig
checkImmutable, checkStringInput, makeImmutable
-
-
-
-
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
-
minPoolSize
private int minPoolSize
Minimum pool size.
-
maxPoolSize
private int maxPoolSize
Maximum pool size.
-
validateOnCheckIn
private boolean validateOnCheckIn
Whether the ldap object should be validated when returned to the pool.
-
validateOnCheckOut
private boolean validateOnCheckOut
Whether the ldap object should be validated when given from the pool.
-
validatePeriodically
private boolean validatePeriodically
Whether the pool should be validated periodically.
-
-
Method Detail
-
getMinPoolSize
public int getMinPoolSize()
Returns the min pool size. Default value isDEFAULT_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 isDEFAULT_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 isDEFAULT_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 isDEFAULT_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 isDEFAULT_VALIDATE_PERIODICALLY
.- Returns:
- validate periodically
-
setValidatePeriodically
public void setValidatePeriodically(boolean b)
Sets the validate periodically flag.- Parameters:
b
- validate periodically
-
builder
public static PoolConfig.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-