Class LdapProviderConfig.PoolConfig

  • Enclosing class:
    LdapProviderConfig

    public static class LdapProviderConfig.PoolConfig
    extends java.lang.Object
    Defines the configuration of a connection pool. Currently we do not support all available configuration options of the pool implementation. (documentation copied from GenericObjectPool)
    • Constructor Detail

      • PoolConfig

        public PoolConfig()
    • 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
      • 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(getNumTestsPerEvictionRun()) 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.

        Parameters:
        numTestsPerEvictionRun - max number of objects to examine during each evictor run.
        Returns:
        this
        See Also:
        getNumTestsPerEvictionRun(), setTimeBetweenEvictionRunsMillis(long)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object