Class LdapProviderConfig.PoolConfig
- java.lang.Object
-
- org.apache.jackrabbit.oak.security.authentication.ldap.impl.LdapProviderConfig.PoolConfig
-
- Enclosing class:
- LdapProviderConfig
public static class LdapProviderConfig.PoolConfig extends Object
Defines the configuration of a connection pool. Currently we do not support all available configuration options of the pool implementation. (documentation copied fromGenericObjectPool
)
-
-
Constructor Summary
Constructors Constructor Description PoolConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMaxActive()
Returns the maximum number of objects that can be allocated by the pool (checked out to clients, or idle awaiting checkout) at a given time.long
getMinEvictableIdleTimeMillis()
Returns the minimum amount of time a connection may sit idle in the pool before it is eligible for eviction by the idle object evictor (if running).int
getNumTestsPerEvictionRun()
Returns the max number of objects to examine during each run of the idle object evictor thread (if any).long
getTimeBetweenEvictionRunsMillis()
Returns the number of milliseconds to sleep between runs of the idle object evictor thread.boolean
lookupOnValidate()
Defines if the lookup on validate flag is enabled.@NotNull LdapProviderConfig.PoolConfig
setLookupOnValidate(boolean lookupOnValidate)
Sets the lookup on validate flag.@NotNull LdapProviderConfig.PoolConfig
setMaxActive(int maxActive)
Sets the cap on the number of objects that can be allocated by the pool.LdapProviderConfig.PoolConfig
setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
Sets the minimum amount of time a connection may sit idle in the pool before it is eligible for eviction by the idle object evictor (if any).LdapProviderConfig.PoolConfig
setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
Sets the max number of objects to examine during each run of the idle object evictor thread (if any).LdapProviderConfig.PoolConfig
setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
Sets the number of milliseconds to sleep between runs of the idle object evictor thread.String
toString()
-
-
-
Method Detail
-
getMaxActive
public int getMaxActive()
Returns the maximum number of objects that can be allocated by the pool (checked out to clients, or idle awaiting checkout) at a given time. When non-positive, there is no limit to the number of objects that can be managed by the pool at one time. A value of 0 disables this pool.- Returns:
- the cap on the total number of object instances managed by the pool.
- See Also:
setMaxActive(int)
-
setMaxActive
@NotNull public @NotNull LdapProviderConfig.PoolConfig setMaxActive(int maxActive)
Sets the cap on the number of objects that can be allocated by the pool.- Parameters:
maxActive
- the new upper limit of the pool size- Returns:
- this
- See Also:
getMaxActive()
-
lookupOnValidate
public boolean lookupOnValidate()
Defines if the lookup on validate flag is enabled. If enable a connection that taken from the pool are validated before used. currently this is done by performing a lookup to the ROOT DSE, which might not be allowed on all LDAP servers.- Returns:
true
if the flag is enabled.
-
setLookupOnValidate
@NotNull public @NotNull LdapProviderConfig.PoolConfig setLookupOnValidate(boolean lookupOnValidate)
Sets the lookup on validate flag.- Parameters:
lookupOnValidate
- the new value of the lookup on validate flag- Returns:
- this
- See Also:
lookupOnValidate()
-
getMinEvictableIdleTimeMillis
public long getMinEvictableIdleTimeMillis()
Returns the minimum amount of time a connection may sit idle in the pool before it is eligible for eviction by the idle object evictor (if running). When non-positive, no connections will be evicted from the pool due to idle time alone.- Returns:
- minimum amount of time a connection may sit idle in the pool before it is eligible for eviction.
-
setMinEvictableIdleTimeMillis
public LdapProviderConfig.PoolConfig setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
Sets the minimum amount of time a connection may sit idle in the pool before it is eligible for eviction by the idle object evictor (if any). When non-positive, no connections will be evicted from the pool due to idle time alone.- Parameters:
minEvictableIdleTimeMillis
- minimum amount of time a connection may sit idle in the pool before it is eligible for eviction.- Returns:
- this
-
getTimeBetweenEvictionRunsMillis
public long getTimeBetweenEvictionRunsMillis()
Returns the number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run.- Returns:
- number of milliseconds to sleep between evictor runs.
-
setTimeBetweenEvictionRunsMillis
public LdapProviderConfig.PoolConfig setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
Sets the number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run.- Parameters:
timeBetweenEvictionRunsMillis
- number of milliseconds to sleep between evictor runs.- Returns:
- this
-
getNumTestsPerEvictionRun
public int getNumTestsPerEvictionRun()
Returns the max number of objects to examine during each run of the idle object evictor thread (if any).- Returns:
- max number of objects to examine during each evictor run.
- See Also:
setNumTestsPerEvictionRun(int)
,setTimeBetweenEvictionRunsMillis(long)
-
setNumTestsPerEvictionRun
public LdapProviderConfig.PoolConfig setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
Sets the max number of objects to examine during each run of the idle object evictor thread (if any).When a negative value is supplied,
ceil(number of idle objects)/abs(
tests will be run. That is, when the value is -n, roughly one nth of the idle objects will be tested per run. When the value is positive, the number of tests actually performed in each run will be the minimum of this value and the number of instances idle in the pool.getNumTestsPerEvictionRun()
)- Parameters:
numTestsPerEvictionRun
- max number of objects to examine during each evictor run.- Returns:
- this
- See Also:
getNumTestsPerEvictionRun()
,setTimeBetweenEvictionRunsMillis(long)
-
-