Package com.mongodb.connection
Class ServerSettings.Builder
- java.lang.Object
-
- com.mongodb.connection.ServerSettings.Builder
-
- Enclosing class:
- ServerSettings
@NotThreadSafe @Deprecated(since="2021-05-27") public static final class ServerSettings.Builder extends java.lang.Object
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.A builder for the settings.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ServerSettings.Builder
addServerListener(ServerListener serverListener)
Deprecated.Add a server listener.ServerSettings.Builder
addServerMonitorListener(ServerMonitorListener serverMonitorListener)
Deprecated.Adds a server monitor listener.ServerSettings.Builder
applyConnectionString(ConnectionString connectionString)
Deprecated.Takes the settings from the givenConnectionString
and applies them to the builderServerSettings.Builder
applySettings(ServerSettings serverSettings)
Deprecated.Applies the serverSettings to the builderServerSettings
build()
Deprecated.Create a new ServerSettings from the settings applied to this builder.ServerSettings.Builder
heartbeatFrequency(long heartbeatFrequency, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Sets the frequency that the cluster monitor attempts to reach each server.ServerSettings.Builder
minHeartbeatFrequency(long minHeartbeatFrequency, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Sets the minimum heartbeat frequency.
-
-
-
Method Detail
-
applySettings
public ServerSettings.Builder applySettings(ServerSettings serverSettings)
Deprecated.Applies the serverSettings to the builderNote: Overwrites all existing settings
- Parameters:
serverSettings
- the serverSettings- Returns:
- this
- Since:
- 3.7
-
heartbeatFrequency
public ServerSettings.Builder heartbeatFrequency(long heartbeatFrequency, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Sets the frequency that the cluster monitor attempts to reach each server. The default value is 10 seconds.- Parameters:
heartbeatFrequency
- the heartbeat frequencytimeUnit
- the time unit- Returns:
- this
-
minHeartbeatFrequency
public ServerSettings.Builder minHeartbeatFrequency(long minHeartbeatFrequency, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Sets the minimum heartbeat frequency. In the event that the driver has to frequently re-check a server's availability, it will wait at least this long since the previous check to avoid wasted effort. The default value is 500 milliseconds.- Parameters:
minHeartbeatFrequency
- the minimum heartbeat frequencytimeUnit
- the time unit- Returns:
- this
-
addServerListener
public ServerSettings.Builder addServerListener(ServerListener serverListener)
Deprecated.Add a server listener.- Parameters:
serverListener
- the non-null server listener- Returns:
- this
- Since:
- 3.3
-
addServerMonitorListener
public ServerSettings.Builder addServerMonitorListener(ServerMonitorListener serverMonitorListener)
Deprecated.Adds a server monitor listener.- Parameters:
serverMonitorListener
- the non-null server monitor listener- Returns:
- this
- Since:
- 3.3
-
applyConnectionString
public ServerSettings.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
- Since:
- 3.3
-
build
public ServerSettings build()
Deprecated.Create a new ServerSettings from the settings applied to this builder.- Returns:
- a ServerSettings with the given settings.
-
-