io.vertx.sqlclient

## Class PoolOptions

- java.lang.Object
- - io.vertx.sqlclient.PoolOptions

-     public class PoolOptions
      extends Object

  The options for configuring a connection pool.
  Author:
    Julien Viet

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_CONNECTION_TIMEOUT` Default connection timeout in the pool = 30 seconds
    `static TimeUnit` | `DEFAULT_CONNECTION_TIMEOUT_TIME_UNIT` Default connection idle time unit in the pool = seconds
    `static int` | `DEFAULT_IDLE_TIMEOUT` Default connection timeout in the pool = 0 (no timeout)
    `static TimeUnit` | `DEFAULT_IDLE_TIMEOUT_TIME_UNIT` Default connection idle time unit in the pool = seconds
    `static int` | `DEFAULT_MAX_SIZE` The default maximum number of connections a client will pool = 4
    `static int` | `DEFAULT_MAX_WAIT_QUEUE_SIZE` Default max wait queue size = -1 (unbounded)
    `static int` | `DEFAULT_POOL_CLEANER_PERIOD` Default pool cleaner period = 1000 ms (1 second)

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PoolOptions()`
    `PoolOptions(JsonObject json)`
    `PoolOptions(PoolOptions other)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `int` | `getConnectionTimeout()`
    `TimeUnit` | `getConnectionTimeoutUnit()`
    `int` | `getIdleTimeout()`
    `TimeUnit` | `getIdleTimeoutUnit()`
    `int` | `getMaxSize()`
    `int` | `getMaxWaitQueueSize()`
    `int` | `getPoolCleanerPeriod()`
    `int` | `hashCode()`
    `PoolOptions` | `setConnectionTimeout(int timeout)` Set the amount of time a client will wait for a connection from the pool.
    `PoolOptions` | `setConnectionTimeoutUnit(TimeUnit timeoutUnit)` Set the time unit of `setConnectionTimeout(int)`
    `PoolOptions` | `setIdleTimeout(int idleTimeout)` Establish an idle timeout for pooled connections.
    `PoolOptions` | `setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)` Establish an idle timeout unit for pooled connections.
    `PoolOptions` | `setMaxSize(int maxSize)` Set the maximum pool size
    `PoolOptions` | `setMaxWaitQueueSize(int maxWaitQueueSize)` Set the maximum connection request allowed in the wait queue, any requests beyond the max size will result in an failure.
    `PoolOptions` | `setPoolCleanerPeriod(int poolCleanerPeriod)` Set the connection pool cleaner period in milli seconds, a non positive value disables expiration checks and connections will remain in the pool until they are closed.
    `JsonObject` | `toJson()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_MAX_SIZE

          public static final int DEFAULT_MAX_SIZE

      The default maximum number of connections a client will pool = 4
      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_WAIT_QUEUE_SIZE

          public static final int DEFAULT_MAX_WAIT_QUEUE_SIZE

      Default max wait queue size = -1 (unbounded)
      See Also:
        Constant Field Values

    - #### DEFAULT_IDLE_TIMEOUT

          public static final int DEFAULT_IDLE_TIMEOUT

      Default connection timeout in the pool = 0 (no timeout)
      See Also:
        Constant Field Values

    - #### DEFAULT_IDLE_TIMEOUT_TIME_UNIT

          public static final TimeUnit DEFAULT_IDLE_TIMEOUT_TIME_UNIT

      Default connection idle time unit in the pool = seconds

    - #### DEFAULT_POOL_CLEANER_PERIOD

          public static final int DEFAULT_POOL_CLEANER_PERIOD

      Default pool cleaner period = 1000 ms (1 second)
      See Also:
        Constant Field Values

    - #### DEFAULT_CONNECTION_TIMEOUT

          public static final int DEFAULT_CONNECTION_TIMEOUT

      Default connection timeout in the pool = 30 seconds
      See Also:
        Constant Field Values

    - #### DEFAULT_CONNECTION_TIMEOUT_TIME_UNIT

          public static final TimeUnit DEFAULT_CONNECTION_TIMEOUT_TIME_UNIT

      Default connection idle time unit in the pool = seconds

  - ### Constructor Detail

    - #### PoolOptions

          public PoolOptions()

    - #### PoolOptions

          public PoolOptions(JsonObject json)

    - #### PoolOptions

          public PoolOptions(PoolOptions other)

  - ### Method Detail

    - #### getMaxSize

          public int getMaxSize()

      Returns:
        the maximum pool size

    - #### setMaxSize

          public PoolOptions setMaxSize(int maxSize)

      Set the maximum pool size
      Parameters:
        `maxSize` - the maximum pool size
      Returns:
        a reference to this, so the API can be used fluently

    - #### getMaxWaitQueueSize

          public int getMaxWaitQueueSize()

      Returns:
        the maximum wait queue size

    - #### setMaxWaitQueueSize

          public PoolOptions setMaxWaitQueueSize(int maxWaitQueueSize)

      Set the maximum connection request allowed in the wait queue, any requests beyond the max size will result in an failure. If the value is set to a negative number then the queue will be unbounded.
      Parameters:
        `maxWaitQueueSize` - the maximum number of waiting requests
      Returns:
        a reference to this, so the API can be used fluently

    - #### getIdleTimeoutUnit

          public TimeUnit getIdleTimeoutUnit()

      Returns:
        the pooled connection idle timeout unit

    - #### setIdleTimeoutUnit

          public PoolOptions setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)

      Establish an idle timeout unit for pooled connections.
      Parameters:
        `idleTimeoutUnit` - pooled connection idle time unit
      Returns:
        a reference to this, so the API can be used fluently

    - #### getIdleTimeout

          public int getIdleTimeout()

      Returns:
        pooled connection idle timeout

    - #### setIdleTimeout

          public PoolOptions setIdleTimeout(int idleTimeout)

      Establish an idle timeout for pooled connections.
      Parameters:
        `idleTimeout` - the pool connection idle time unitq
      Returns:
        a reference to this, so the API can be used fluently

    - #### getPoolCleanerPeriod

          public int getPoolCleanerPeriod()

      Returns:
        the connection pool cleaner period in ms.

    - #### setPoolCleanerPeriod

          public PoolOptions setPoolCleanerPeriod(int poolCleanerPeriod)

      Set the connection pool cleaner period in milli seconds, a non positive value disables expiration checks and connections will remain in the pool until they are closed.
      Parameters:
        `poolCleanerPeriod` - the pool cleaner period
      Returns:
        a reference to this, so the API can be used fluently

    - #### getConnectionTimeoutUnit

          public TimeUnit getConnectionTimeoutUnit()

      Returns:
        the time unit of @link #setConnectionTimeout(int)}

    - #### setConnectionTimeoutUnit

          public PoolOptions setConnectionTimeoutUnit(TimeUnit timeoutUnit)

      Set the time unit of `setConnectionTimeout(int)`
      Parameters:
        `timeoutUnit` - the time unit
      Returns:
        a reference to this, so the API can be used fluently

    - #### getConnectionTimeout

          public int getConnectionTimeout()

      Returns:
        the amount of time a client will wait for a connection from the pool. See `setConnectionTimeout(int)`

    - #### setConnectionTimeout

          public PoolOptions setConnectionTimeout(int timeout)

      Set the amount of time a client will wait for a connection from the pool. If the time is exceeded without a connection available, an exception is provided.
      Parameters:
        `timeout` - the pool connection idle time unitq
      Returns:
        a reference to this, so the API can be used fluently

    - #### toJson

          public JsonObject toJson()

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2021 Eclipse. All rights reserved.