Class FTPPoolConfig
- java.lang.Object
-
- com.github.robtimus.filesystems.ftp.FTPPoolConfig
-
public final class FTPPoolConfig extends Object
Configuration for the client connection pools of FTP file systems.Instances of this class are immutable and thread-safe.
- Author:
- Rob Spoor
- Since:
- 3.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FTPPoolConfig.Builder
A builder forFTPPoolConfig
objects.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FTPPoolConfig.Builder
custom()
Returns a new builder for creatingFTPPoolConfig
objects.static FTPPoolConfig
defaultConfig()
Returns a defaultFTPPoolConfig
object.int
initialSize()
Returns the initial pool size.Optional<Duration>
maxIdleTime()
Returns the maximum time that client connections can be idle.int
maxSize()
Returns the maximum pool size.Optional<Duration>
maxWaitTime()
Returns the maximum time to wait when acquiring client connections.String
toString()
-
-
-
Method Detail
-
maxWaitTime
public Optional<Duration> maxWaitTime()
Returns the maximum time to wait when acquiring client connections.- Returns:
- An
Optional
describing the maximum time to wait when acquiring client connections, orOptional#empty()
to wait indefinitely.
-
maxIdleTime
public Optional<Duration> maxIdleTime()
Returns the maximum time that client connections can be idle.- Returns:
- An
Optional
describing the maximum time that client connections can be idle, orOptional.empty()
if client connections can be idle indefinitely.
-
initialSize
public int initialSize()
Returns the initial pool size. This is the number of idle client connections to start with.- Returns:
- The initial pool size.
-
maxSize
public int maxSize()
Returns the maximum pool size. This is the maximum number of client connections, both idle and currently in use.- Returns:
- The maximum pool size.
-
defaultConfig
public static FTPPoolConfig defaultConfig()
Returns a defaultFTPPoolConfig
object. This has the same configuration as an object returned bycustom().build()
.- Returns:
- A default
FTPPoolConfig
object. - See Also:
custom()
-
custom
public static FTPPoolConfig.Builder custom()
Returns a new builder for creatingFTPPoolConfig
objects.- Returns:
- A new builder for creating
FTPPoolConfig
objects.
-
-