Class ConnectionPoolSettings


  • @Immutable
    @Deprecated(since="2021-05-27")
    public class ConnectionPoolSettings
    extends java.lang.Object
    Deprecated.
    Usage of this API is not supported in AEM as a Cloud Service.
    All settings that relate to the pool of connections to a MongoDB server.
    Since:
    3.0
    • Method Detail

      • builder

        public static ConnectionPoolSettings.Builder builder()
        Deprecated.
        Gets a Builder for creating a new ConnectionPoolSettings instance.
        Returns:
        a new Builder for ConnectionPoolSettings.
      • builder

        public static ConnectionPoolSettings.Builder builder​(ConnectionPoolSettings connectionPoolSettings)
        Deprecated.
        Gets a Builder for creating a new ConnectionPoolSettings instance.
        Parameters:
        connectionPoolSettings - the existing connection pool settings to configure the builder with
        Returns:
        a new Builder for ConnectionPoolSettings
        Since:
        3.5
      • getMaxSize

        public int getMaxSize()
        Deprecated.

        The maximum number of connections allowed. Those connections will be kept in the pool when idle. Once the pool is exhausted, any operation requiring a connection will block waiting for an available connection.

        Default is 100.

        Returns:
        the maximum number of connections in the pool.
      • getMinSize

        public int getMinSize()
        Deprecated.

        The minimum number of connections. Those connections will be kept in the pool when idle, and the pool will ensure that it contains at least this minimum number.

        Default is 0.

        Returns:
        the minimum number of connections to have in the pool at all times.
      • getMaxWaitQueueSize

        @Deprecated
        public int getMaxWaitQueueSize()
        Deprecated.
        in the next major release, wait queue size limitations will be removed

        This is the maximum number of operations that may be waiting for a connection to become available from the pool. All further operations will get an exception immediately.

        Default is 500.

        Returns:
        the number of threads that are allowed to be waiting for a connection.
      • getMaxWaitTime

        public long getMaxWaitTime​(java.util.concurrent.TimeUnit timeUnit)
        Deprecated.

        The maximum time that a thread may wait for a connection to become available.

        Default is 2 minutes. A value of 0 means that it will not wait. A negative value means it will wait indefinitely.

        Parameters:
        timeUnit - the TimeUnit for this wait period
        Returns:
        the maximum amount of time to wait in the given TimeUnits
      • getMaxConnectionLifeTime

        public long getMaxConnectionLifeTime​(java.util.concurrent.TimeUnit timeUnit)
        Deprecated.
        The maximum time a pooled connection can live for. A zero value indicates no limit to the life time. A pooled connection that has exceeded its life time will be closed and replaced when necessary by a new connection.
        Parameters:
        timeUnit - the TimeUnit to use for this time period
        Returns:
        the maximum length of time a connection can live in the given TimeUnits
      • getMaxConnectionIdleTime

        public long getMaxConnectionIdleTime​(java.util.concurrent.TimeUnit timeUnit)
        Deprecated.
        Returns the maximum idle time of a pooled connection. A zero value indicates no limit to the idle time. A pooled connection that has exceeded its idle time will be closed and replaced when necessary by a new connection.
        Parameters:
        timeUnit - the TimeUnit to use for this time period
        Returns:
        the maximum time a connection can be unused, in the given TimeUnits
      • getMaintenanceInitialDelay

        public long getMaintenanceInitialDelay​(java.util.concurrent.TimeUnit timeUnit)
        Deprecated.
        Returns the period of time to wait before running the first maintenance job on the connection pool.
        Parameters:
        timeUnit - the TimeUnit to use for this time period
        Returns:
        the time period to wait in the given units
      • getMaintenanceFrequency

        public long getMaintenanceFrequency​(java.util.concurrent.TimeUnit timeUnit)
        Deprecated.
        Returns the time period between runs of the maintenance job.
        Parameters:
        timeUnit - the TimeUnit to use for this time period
        Returns:
        the time period between runs of the maintainance job in the given units
      • getConnectionPoolListeners

        public java.util.List<ConnectionPoolListener> getConnectionPoolListeners()
        Deprecated.
        Gets the list of added ConnectionPoolListener. The default is an empty list.
        Returns:
        the unmodifiable list of connection pool listeners
        Since:
        3.5
      • equals

        public boolean equals​(java.lang.Object o)
        Deprecated.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class java.lang.Object
      • toString

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