Class RedisPoolProperties

java.lang.Object
org.apereo.cas.configuration.model.support.redis.RedisPoolProperties
All Implemented Interfaces:
Serializable, CasFeatureModule

@RequiresModule(name="cas-server-support-redis-core") public class RedisPoolProperties extends Object implements CasFeatureModule, Serializable
Since:
6.3.0
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apereo.cas.configuration.features.CasFeatureModule

    CasFeatureModule.FeatureCatalog
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Max number of connections that can be allocated by the pool at a given time.
    int
    Max number of "idle" connections in the pool.
    Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted.
    long
    Sets the minimum amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object evictor (if any - see setTimeBetweenEvictionRunsMillis(long)).
    int
    Target for the minimum number of idle connections to maintain in the pool.
    int
    Sets the maximum number of objects to examine during each run (if any) of the idle object evictor thread.
    long
    Sets the minimum amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object evictor (if any - see setTimeBetweenEvictionRunsMillis(long)), with the extra condition that at least minIdle object instances remain in the pool.
    boolean
    Enable the pooling configuration.
    boolean
    Returns whether or not the pool serves threads waiting to borrow objects fairly.
    boolean
    Returns whether the pool has LIFO (last in, first out) behaviour with respect to idle objects - always returning the most recently used object from the pool, or as a FIFO (first in, first out) queue, where the pool always returns the oldest object in the idle object pool.
    boolean
    Returns whether objects borrowed from the pool will be validated before being returned from the borrowObject() method.
    boolean
    Returns whether objects created for the pool will be validated before being returned from the borrowObject() method.
    boolean
    Returns whether objects borrowed from the pool will be validated when they are returned to the pool via the returnObject() method.
    boolean
    Returns whether objects sitting idle in the pool will be validated by the idle object evictor ( if any - see setTimeBetweenEvictionRunsMillis(long)).
    setEnabled(boolean enabled)
    Enable the pooling configuration.
    setFairness(boolean fairness)
    Returns whether or not the pool serves threads waiting to borrow objects fairly.
    setLifo(boolean lifo)
    Returns whether the pool has LIFO (last in, first out) behaviour with respect to idle objects - always returning the most recently used object from the pool, or as a FIFO (first in, first out) queue, where the pool always returns the oldest object in the idle object pool.
    setMaxActive(int maxActive)
    Max number of connections that can be allocated by the pool at a given time.
    setMaxIdle(int maxIdle)
    Max number of "idle" connections in the pool.
    setMaxWait(String maxWait)
    Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted.
    setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
    Sets the minimum amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object evictor (if any - see setTimeBetweenEvictionRunsMillis(long)).
    setMinIdle(int minIdle)
    Target for the minimum number of idle connections to maintain in the pool.
    setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
    Sets the maximum number of objects to examine during each run (if any) of the idle object evictor thread.
    setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis)
    Sets the minimum amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object evictor (if any - see setTimeBetweenEvictionRunsMillis(long)), with the extra condition that at least minIdle object instances remain in the pool.
    setTestOnBorrow(boolean testOnBorrow)
    Returns whether objects borrowed from the pool will be validated before being returned from the borrowObject() method.
    setTestOnCreate(boolean testOnCreate)
    Returns whether objects created for the pool will be validated before being returned from the borrowObject() method.
    setTestOnReturn(boolean testOnReturn)
    Returns whether objects borrowed from the pool will be validated when they are returned to the pool via the returnObject() method.
    setTestWhileIdle(boolean testWhileIdle)
    Returns whether objects sitting idle in the pool will be validated by the idle object evictor ( if any - see setTimeBetweenEvictionRunsMillis(long)).

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apereo.cas.configuration.features.CasFeatureModule

    isDefined, isUndefined
  • Constructor Details

    • RedisPoolProperties

      public RedisPoolProperties()
  • Method Details

    • getNumTestsPerEvictionRun

      public int getNumTestsPerEvictionRun()
      Sets the maximum number of objects to examine during each run (if any) of the idle object evictor thread. When positive, the number of tests performed for a run will be the minimum of the configured value and the number of idle instances in the pool. When negative, the number of tests performed will be ceil(getNumIdle()/ abs(getNumTestsPerEvictionRun())) which means that when the value is -n roughly one nth of the idle objects will be tested per run.
    • getSoftMinEvictableIdleTimeMillis

      public long getSoftMinEvictableIdleTimeMillis()
      Sets the minimum amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object evictor (if any - see setTimeBetweenEvictionRunsMillis(long)), with the extra condition that at least minIdle object instances remain in the pool. This setting is overridden by getMinEvictableIdleTimeMillis() (that is, if getMinEvictableIdleTimeMillis() is positive, then getSoftMinEvictableIdleTimeMillis() is ignored).
    • getMinEvictableIdleTimeMillis

      public long getMinEvictableIdleTimeMillis()
      Sets the minimum amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object evictor (if any - see setTimeBetweenEvictionRunsMillis(long)). When non-positive, no objects will be evicted from the pool due to idle time alone.
    • isLifo

      public boolean isLifo()
      Returns whether the pool has LIFO (last in, first out) behaviour with respect to idle objects - always returning the most recently used object from the pool, or as a FIFO (first in, first out) queue, where the pool always returns the oldest object in the idle object pool.
    • isFairness

      public boolean isFairness()
      Returns whether or not the pool serves threads waiting to borrow objects fairly. True means that waiting threads are served as if waiting in a FIFO queue.
    • isTestOnCreate

      public boolean isTestOnCreate()
      Returns whether objects created for the pool will be validated before being returned from the borrowObject() method. Validation is performed by the validateObject() method of the factory associated with the pool. If the object fails to validate, then borrowObject() will fail.
    • isTestOnBorrow

      public boolean isTestOnBorrow()
      Returns whether objects borrowed from the pool will be validated before being returned from the borrowObject() method. Validation is performed by the validateObject() method of the factory associated with the pool. If the object fails to validate, it will be removed from the pool and destroyed, and a new attempt will be made to borrow an object from the pool.
    • isTestOnReturn

      public boolean isTestOnReturn()
      Returns whether objects borrowed from the pool will be validated when they are returned to the pool via the returnObject() method. Validation is performed by the validateObject() method of the factory associated with the pool. Returning objects that fail validation are destroyed rather then being returned the pool.
    • isTestWhileIdle

      public boolean isTestWhileIdle()
      Returns whether objects sitting idle in the pool will be validated by the idle object evictor ( if any - see setTimeBetweenEvictionRunsMillis(long)). Validation is performed by the validateObject() method of the factory associated with the pool. If the object fails to validate, it will be removed from the pool and destroyed.
    • getMaxIdle

      public int getMaxIdle()
      Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
    • getMinIdle

      public int getMinIdle()
      Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
    • getMaxActive

      public int getMaxActive()
      Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
    • getMaxWait

      public String getMaxWait()
      Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
    • isEnabled

      public boolean isEnabled()
      Enable the pooling configuration.
    • setNumTestsPerEvictionRun

      public RedisPoolProperties setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
      Sets the maximum number of objects to examine during each run (if any) of the idle object evictor thread. When positive, the number of tests performed for a run will be the minimum of the configured value and the number of idle instances in the pool. When negative, the number of tests performed will be ceil(getNumIdle()/ abs(getNumTestsPerEvictionRun())) which means that when the value is -n roughly one nth of the idle objects will be tested per run.
      Returns:
      this.
    • setSoftMinEvictableIdleTimeMillis

      public RedisPoolProperties setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis)
      Sets the minimum amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object evictor (if any - see setTimeBetweenEvictionRunsMillis(long)), with the extra condition that at least minIdle object instances remain in the pool. This setting is overridden by getMinEvictableIdleTimeMillis() (that is, if getMinEvictableIdleTimeMillis() is positive, then getSoftMinEvictableIdleTimeMillis() is ignored).
      Returns:
      this.
    • setMinEvictableIdleTimeMillis

      public RedisPoolProperties setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
      Sets the minimum amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object evictor (if any - see setTimeBetweenEvictionRunsMillis(long)). When non-positive, no objects will be evicted from the pool due to idle time alone.
      Returns:
      this.
    • setLifo

      public RedisPoolProperties setLifo(boolean lifo)
      Returns whether the pool has LIFO (last in, first out) behaviour with respect to idle objects - always returning the most recently used object from the pool, or as a FIFO (first in, first out) queue, where the pool always returns the oldest object in the idle object pool.
      Returns:
      this.
    • setFairness

      public RedisPoolProperties setFairness(boolean fairness)
      Returns whether or not the pool serves threads waiting to borrow objects fairly. True means that waiting threads are served as if waiting in a FIFO queue.
      Returns:
      this.
    • setTestOnCreate

      public RedisPoolProperties setTestOnCreate(boolean testOnCreate)
      Returns whether objects created for the pool will be validated before being returned from the borrowObject() method. Validation is performed by the validateObject() method of the factory associated with the pool. If the object fails to validate, then borrowObject() will fail.
      Returns:
      this.
    • setTestOnBorrow

      public RedisPoolProperties setTestOnBorrow(boolean testOnBorrow)
      Returns whether objects borrowed from the pool will be validated before being returned from the borrowObject() method. Validation is performed by the validateObject() method of the factory associated with the pool. If the object fails to validate, it will be removed from the pool and destroyed, and a new attempt will be made to borrow an object from the pool.
      Returns:
      this.
    • setTestOnReturn

      public RedisPoolProperties setTestOnReturn(boolean testOnReturn)
      Returns whether objects borrowed from the pool will be validated when they are returned to the pool via the returnObject() method. Validation is performed by the validateObject() method of the factory associated with the pool. Returning objects that fail validation are destroyed rather then being returned the pool.
      Returns:
      this.
    • setTestWhileIdle

      public RedisPoolProperties setTestWhileIdle(boolean testWhileIdle)
      Returns whether objects sitting idle in the pool will be validated by the idle object evictor ( if any - see setTimeBetweenEvictionRunsMillis(long)). Validation is performed by the validateObject() method of the factory associated with the pool. If the object fails to validate, it will be removed from the pool and destroyed.
      Returns:
      this.
    • setMaxIdle

      public RedisPoolProperties setMaxIdle(int maxIdle)
      Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
      Returns:
      this.
    • setMinIdle

      public RedisPoolProperties setMinIdle(int minIdle)
      Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
      Returns:
      this.
    • setMaxActive

      public RedisPoolProperties setMaxActive(int maxActive)
      Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
      Returns:
      this.
    • setMaxWait

      public RedisPoolProperties setMaxWait(String maxWait)
      Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
      Returns:
      this.
    • setEnabled

      public RedisPoolProperties setEnabled(boolean enabled)
      Enable the pooling configuration.
      Returns:
      this.