Package edu.vt.middleware.ldap.pool
Class LdapPoolConfig
- java.lang.Object
-
- edu.vt.middleware.ldap.props.AbstractPropertyConfig
-
- edu.vt.middleware.ldap.pool.LdapPoolConfig
-
- All Implemented Interfaces:
PropertyConfig
public class LdapPoolConfig extends AbstractPropertyConfig
LdapPoolConfig
contains all the configuration data that the pooling implementations need to control the pool.- Version:
- $Revision: 1330 $ $Date: 2010-05-24 00:10:53 +0200 (Mon, 24 May 2010) $
- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_EXPIRATION_TIME
Default expiration time, value is 600000L.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 long
DEFAULT_PRUNE_TIMER_PERIOD
Default prune timer period, value is 300000L.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.static long
DEFAULT_VALIDATE_TIMER_PERIOD
Default validate timer period, value is 1800000L.static java.lang.String
PROPERTIES_DOMAIN
Domain to look for ldap properties in, value is "edu.vt.middleware.ldap.pool.".-
Fields inherited from class edu.vt.middleware.ldap.props.AbstractPropertyConfig
logger
-
-
Constructor Summary
Constructors Constructor Description LdapPoolConfig()
Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LdapPoolConfig
createFromProperties(java.io.InputStream is)
Create an instance of this class initialized with properties from the input stream.long
getExpirationTime()
This returns the expiration time for theLdapPoolConfig
.int
getMaxPoolSize()
This returns the max pool size for theLdapPoolConfig
.int
getMinPoolSize()
This returns the min pool size for theLdapPoolConfig
.java.lang.String
getPropertiesDomain()
This returns the properties domain for this property config.long
getPruneTimerPeriod()
This returns the prune timer period for theLdapPoolConfig
.long
getValidateTimerPeriod()
This returns the validate timer period for theLdapPoolConfig
.boolean
hasEnvironmentProperty(java.lang.String name)
This returns whether the supplied property exists.boolean
isValidateOnCheckIn()
This returns the validate on check in flag for theLdapPoolConfig
.boolean
isValidateOnCheckOut()
This returns the validate on check out flag for theLdapPoolConfig
.boolean
isValidatePeriodically()
This returns the validate periodically flag for theLdapPoolConfig
.void
setEnvironmentProperties(java.lang.String name, java.lang.String value)
This adds environment properties to this object.void
setExpirationTime(long time)
Sets the time that an ldap object should be considered stale and ready for removal from the pool.void
setMaxPoolSize(int size)
This sets the max pool size for theLdapPoolConfig
.void
setMinPoolSize(int size)
This sets the min pool size for theLdapPoolConfig
.void
setPruneTimerPeriod(long time)
Sets the period for which the prune pool timer will run.void
setValidateOnCheckIn(boolean b)
This sets the validate on check in flag for theLdapPoolConfig
.void
setValidateOnCheckOut(boolean b)
This sets the validate on check out flag for theLdapPoolConfig
.void
setValidatePeriodically(boolean b)
This sets the validate periodically flag for theLdapPoolConfig
.void
setValidateTimerPeriod(long time)
Sets the period for which the validate pool timer will run.-
Methods inherited from class edu.vt.middleware.ldap.props.AbstractPropertyConfig
checkImmutable, checkStringInput, makeImmutable, setEnvironmentProperties, setEnvironmentProperties
-
-
-
-
Field Detail
-
PROPERTIES_DOMAIN
public static final java.lang.String PROPERTIES_DOMAIN
Domain to look for ldap properties in, value is "edu.vt.middleware.ldap.pool.".- See Also:
- Constant Field Values
-
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_TIMER_PERIOD
public static final long DEFAULT_VALIDATE_TIMER_PERIOD
Default validate timer period, value is 1800000L.- See Also:
- Constant Field Values
-
DEFAULT_PRUNE_TIMER_PERIOD
public static final long DEFAULT_PRUNE_TIMER_PERIOD
Default prune timer period, value is 300000L.- See Also:
- Constant Field Values
-
DEFAULT_EXPIRATION_TIME
public static final long DEFAULT_EXPIRATION_TIME
Default expiration time, value is 600000L.- See Also:
- Constant Field Values
-
-
Method Detail
-
getMinPoolSize
public int getMinPoolSize()
This returns the min pool size for theLdapPoolConfig
. Default value isDEFAULT_MIN_POOL_SIZE
. This value represents the size of the pool after the prune timer has run.- Returns:
int
- min pool size
-
getMaxPoolSize
public int getMaxPoolSize()
This returns the max pool size for theLdapPoolConfig
. Default value isDEFAULT_MAX_POOL_SIZE
. This value may or may not be strictly enforced depending on the pooling implementation.- Returns:
int
- max pool size
-
isValidateOnCheckIn
public boolean isValidateOnCheckIn()
This returns the validate on check in flag for theLdapPoolConfig
. Default value isDEFAULT_VALIDATE_ON_CHECKIN
.- Returns:
boolean
- validate on check in
-
isValidateOnCheckOut
public boolean isValidateOnCheckOut()
This returns the validate on check out flag for theLdapPoolConfig
. Default value isDEFAULT_VALIDATE_ON_CHECKOUT
.- Returns:
boolean
- validate on check in
-
isValidatePeriodically
public boolean isValidatePeriodically()
This returns the validate periodically flag for theLdapPoolConfig
. Default value isDEFAULT_VALIDATE_PERIODICALLY
.- Returns:
boolean
- validate periodically
-
getPruneTimerPeriod
public long getPruneTimerPeriod()
This returns the prune timer period for theLdapPoolConfig
. Default value isDEFAULT_PRUNE_TIMER_PERIOD
. The prune timer attempts to executeLdapPool.prune()
.- Returns:
long
- prune timer period in milliseconds
-
getValidateTimerPeriod
public long getValidateTimerPeriod()
This returns the validate timer period for theLdapPoolConfig
. Default value isDEFAULT_VALIDATE_TIMER_PERIOD
. The validate timer attempts to executeLdapPool.validate()
.- Returns:
long
- validate timer period in milliseconds
-
getExpirationTime
public long getExpirationTime()
This returns the expiration time for theLdapPoolConfig
. Default value isDEFAULT_EXPIRATION_TIME
. The expiration time represents the max time an ldap object should be available before it is considered stale. This value does not apply to objects in the pool if the pool has only a minimum number of objects available.- Returns:
long
- expiration time in milliseconds
-
setMinPoolSize
public void setMinPoolSize(int size)
This sets the min pool size for theLdapPoolConfig
.- Parameters:
size
-int
-
setMaxPoolSize
public void setMaxPoolSize(int size)
This sets the max pool size for theLdapPoolConfig
.- Parameters:
size
-int
-
setValidateOnCheckIn
public void setValidateOnCheckIn(boolean b)
This sets the validate on check in flag for theLdapPoolConfig
.- Parameters:
b
-boolean
-
setValidateOnCheckOut
public void setValidateOnCheckOut(boolean b)
This sets the validate on check out flag for theLdapPoolConfig
.- Parameters:
b
-boolean
-
setValidatePeriodically
public void setValidatePeriodically(boolean b)
This sets the validate periodically flag for theLdapPoolConfig
.- Parameters:
b
-boolean
-
setPruneTimerPeriod
public void setPruneTimerPeriod(long time)
Sets the period for which the prune pool timer will run.- Parameters:
time
- in milliseconds
-
setValidateTimerPeriod
public void setValidateTimerPeriod(long time)
Sets the period for which the validate pool timer will run.- Parameters:
time
- in milliseconds
-
setExpirationTime
public void setExpirationTime(long time)
Sets the time that an ldap object should be considered stale and ready for removal from the pool.- Parameters:
time
- in milliseconds
-
getPropertiesDomain
public java.lang.String getPropertiesDomain()
This returns the properties domain for this property config.- Specified by:
getPropertiesDomain
in interfacePropertyConfig
- Specified by:
getPropertiesDomain
in classAbstractPropertyConfig
- Returns:
String
properties domain
-
setEnvironmentProperties
public void setEnvironmentProperties(java.lang.String name, java.lang.String value)
This adds environment properties to this object. If name or value is null, then this method does nothing.- Specified by:
setEnvironmentProperties
in interfacePropertyConfig
- Specified by:
setEnvironmentProperties
in classAbstractPropertyConfig
- Parameters:
name
-String
property namevalue
-String
property value
-
hasEnvironmentProperty
public boolean hasEnvironmentProperty(java.lang.String name)
This returns whether the supplied property exists.- Specified by:
hasEnvironmentProperty
in interfacePropertyConfig
- Specified by:
hasEnvironmentProperty
in classAbstractPropertyConfig
- Parameters:
name
-String
to check- Returns:
boolean
whether the supplied property exists
-
createFromProperties
public static LdapPoolConfig createFromProperties(java.io.InputStream is)
Create an instance of this class initialized with properties from the input stream. If the input stream is null, load properties from the default properties file.- Parameters:
is
- to load properties from- Returns:
LdapPoolConfig
initialized ldap pool config
-
-