Package com.mongodb.connection
Class SocketSettings.Builder
java.lang.Object
com.mongodb.connection.SocketSettings.Builder
- Enclosing class:
- SocketSettings
A builder for an instance of
SocketSettings
.-
Method Summary
Modifier and TypeMethodDescriptionapplyConnectionString
(ConnectionString connectionString) Takes the settings from the givenConnectionString
and applies them to the builderapplySettings
(SocketSettings socketSettings) Applies the socketSettings to the builderApplies theProxySettings.Builder
block and then sets theSocketSettings.proxySettings
.build()
Build an instance ofSocketSettings
.connectTimeout
(int connectTimeout, TimeUnit timeUnit) Sets the socket connect timeout.readTimeout
(int readTimeout, TimeUnit timeUnit) Sets the socket read timeout.receiveBufferSize
(int receiveBufferSize) Sets the receive buffer size.sendBufferSize
(int sendBufferSize) Sets the send buffer size.
-
Method Details
-
applySettings
Applies the socketSettings to the builderNote: Overwrites all existing settings
- Parameters:
socketSettings
- the socketSettings- Returns:
- this
- Since:
- 3.7
-
connectTimeout
Sets the socket connect timeout.- Parameters:
connectTimeout
- the connect timeouttimeUnit
- the time unit- Returns:
- this
-
readTimeout
Sets the socket read timeout.- Parameters:
readTimeout
- the read timeouttimeUnit
- the time unit- Returns:
- this
- See Also:
-
receiveBufferSize
Sets the receive buffer size.- Parameters:
receiveBufferSize
- the receive buffer size- Returns:
- this
-
sendBufferSize
Sets the send buffer size.- Parameters:
sendBufferSize
- the send buffer size- Returns:
- this
-
applyToProxySettings
Applies theProxySettings.Builder
block and then sets theSocketSettings.proxySettings
.- Parameters:
block
- the block to apply to theProxySettings
.- Returns:
- this
- See Also:
-
applyConnectionString
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:
-
build
Build an instance ofSocketSettings
.- Returns:
- the socket settings for this builder
-