Package com.mongodb.connection
Class SocketSettings.Builder
- java.lang.Object
-
- com.mongodb.connection.SocketSettings.Builder
-
- Enclosing class:
- SocketSettings
@Deprecated(since="2021-05-27") public static final class SocketSettings.Builder extends java.lang.Object
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.A builder for an instance ofSocketSettings
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SocketSettings.Builder
applyConnectionString(ConnectionString connectionString)
Deprecated.Takes the settings from the givenConnectionString
and applies them to the builderSocketSettings.Builder
applySettings(SocketSettings socketSettings)
Deprecated.Applies the socketSettings to the builderSocketSettings
build()
Deprecated.Build an instance ofSocketSettings
.SocketSettings.Builder
connectTimeout(int connectTimeout, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Sets the socket connect timeout.SocketSettings.Builder
keepAlive(boolean keepAlive)
Deprecated.configuring keep-alive has been deprecated.SocketSettings.Builder
readTimeout(int readTimeout, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Sets the socket read timeout.SocketSettings.Builder
receiveBufferSize(int receiveBufferSize)
Deprecated.Sets the receive buffer size.SocketSettings.Builder
sendBufferSize(int sendBufferSize)
Deprecated.Sets the send buffer size.
-
-
-
Method Detail
-
applySettings
public SocketSettings.Builder applySettings(SocketSettings socketSettings)
Deprecated.Applies the socketSettings to the builderNote: Overwrites all existing settings
- Parameters:
socketSettings
- the socketSettings- Returns:
- this
- Since:
- 3.7
-
connectTimeout
public SocketSettings.Builder connectTimeout(int connectTimeout, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Sets the socket connect timeout.- Parameters:
connectTimeout
- the connect timeouttimeUnit
- the time unit- Returns:
- this
-
readTimeout
public SocketSettings.Builder readTimeout(int readTimeout, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Sets the socket read timeout.- Parameters:
readTimeout
- the read timeouttimeUnit
- the time unit- Returns:
- this
-
keepAlive
@Deprecated public SocketSettings.Builder keepAlive(boolean keepAlive)
Deprecated.configuring keep-alive has been deprecated. It now defaults to true and disabling it is not recommended.Sets keep-alive.- Parameters:
keepAlive
- false if keep-alive should be disabled- Returns:
- this
- See Also:
- Does TCP keep-alive time affect MongoDB Deployments?
-
receiveBufferSize
public SocketSettings.Builder receiveBufferSize(int receiveBufferSize)
Deprecated.Sets the receive buffer size.- Parameters:
receiveBufferSize
- the receive buffer size- Returns:
- this
-
sendBufferSize
public SocketSettings.Builder sendBufferSize(int sendBufferSize)
Deprecated.Sets the send buffer size.- Parameters:
sendBufferSize
- the send buffer size- Returns:
- this
-
applyConnectionString
public SocketSettings.Builder applyConnectionString(ConnectionString connectionString)
Deprecated.Takes the settings from the givenConnectionString
and applies them to the builder- Parameters:
connectionString
- the connection string containing details of how to connect to MongoDB- Returns:
- this
- See Also:
ConnectionString.getConnectTimeout()
,ConnectionString.getSocketTimeout()
-
build
public SocketSettings build()
Deprecated.Build an instance ofSocketSettings
.- Returns:
- the socket settings for this builder
-
-