Package com.mongodb.connection
Class ServerSettings
- java.lang.Object
- 
- com.mongodb.connection.ServerSettings
 
- 
 @Immutable public class ServerSettings extends Object Settings relating to monitoring of each server.- Since:
- 3.0
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classServerSettings.BuilderA builder for the settings.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ServerSettings.Builderbuilder()Creates a builder for ServerSettings.static ServerSettings.Builderbuilder(ServerSettings serverSettings)Creates a builder instance.booleanequals(Object o)longgetHeartbeatFrequency(TimeUnit timeUnit)Gets the frequency that the cluster monitor attempts to reach each server.longgetMinHeartbeatFrequency(TimeUnit timeUnit)Gets the minimum heartbeat frequency.List<ServerListener>getServerListeners()Gets the server listeners.List<ServerMonitorListener>getServerMonitorListeners()Gets the server monitor listeners.inthashCode()StringtoString()
 
- 
- 
- 
Method Detail- 
builderpublic static ServerSettings.Builder builder() Creates a builder for ServerSettings.- Returns:
- a new Builder for creating ServerSettings.
 
 - 
builderpublic static ServerSettings.Builder builder(ServerSettings serverSettings) Creates a builder instance.- Parameters:
- serverSettings- existing ServerSettings to default the builder settings on.
- Returns:
- a builder
- Since:
- 3.5
 
 - 
getHeartbeatFrequencypublic long getHeartbeatFrequency(TimeUnit timeUnit) Gets the frequency that the cluster monitor attempts to reach each server. The default value is 10 seconds.- Parameters:
- timeUnit- the time unit
- Returns:
- the heartbeat frequency
 
 - 
getMinHeartbeatFrequencypublic long getMinHeartbeatFrequency(TimeUnit timeUnit) Gets 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:
- timeUnit- the time unit
- Returns:
- the heartbeat reconnect retry frequency
 
 - 
getServerListenerspublic List<ServerListener> getServerListeners() Gets the server listeners. The default value is an empty list.- Returns:
- the server listeners
- Since:
- 3.3
 
 - 
getServerMonitorListenerspublic List<ServerMonitorListener> getServerMonitorListeners() Gets the server monitor listeners. The default value is an empty list.- Returns:
- the server monitor listeners
- Since:
- 3.3
 
 
- 
 
-