Package com.mongodb.connection
Enum Class ServerMonitoringMode
- All Implemented Interfaces:
Serializable
,Comparable<ServerMonitoringMode>
,java.lang.constant.Constable
The server monitoring mode, which defines the monitoring protocol to use.
- Since:
- 5.1
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ServerMonitoringMode
Returns the enum constant of this class with the specified name.static ServerMonitoringMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STREAM
Use the streaming protocol when the server supports it or fall back to the polling protocol otherwise. When the streaming protocol comes into play,ServerHeartbeatStartedEvent.isAwaited()
,ServerHeartbeatSucceededEvent.isAwaited()
,ServerHeartbeatFailedEvent.isAwaited()
returntrue
for new events.The streaming protocol uses long polling for server monitoring, and is intended to reduce the delay between a server change that warrants a new event for
ServerListener
/ClusterListener
, and that event being emitted, as well as the related housekeeping work being done. -
POLL
Use the polling protocol. -
AUTO
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-