Package com.mongodb.event
Class ServerHeartbeatStartedEvent
java.lang.Object
com.mongodb.event.ServerHeartbeatStartedEvent
An event for the start of a server heartbeat.
- Since:
- 3.3
-
Constructor Summary
ConstructorDescriptionServerHeartbeatStartedEvent
(ConnectionId connectionId) Deprecated.ServerHeartbeatStartedEvent
(ConnectionId connectionId, boolean awaited) Construct an instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the connectionId.boolean
Gets whether the heartbeat is for an awaitable `hello` / legacy hello.toString()
-
Constructor Details
-
ServerHeartbeatStartedEvent
Construct an instance.- Parameters:
connectionId
- the non-null connnectionIdawaited
-true
if and only if the heartbeat is for an awaitable `hello` / legacy hello.- Since:
- 5.1
-
ServerHeartbeatStartedEvent
Deprecated.PreferServerHeartbeatStartedEvent(ConnectionId, boolean)
. If this constructor is used thenisAwaited()
isfalse
.Construct an instance.- Parameters:
connectionId
- the non-null connnectionId
-
-
Method Details
-
getConnectionId
Gets the connectionId.- Returns:
- the connectionId
-
isAwaited
public boolean isAwaited()Gets whether the heartbeat is for an awaitable `hello` / legacy hello.- Returns:
true
if and only if the heartbeat is for an awaitable `hello` / legacy hello.- Since:
- 5.1
- See Also:
-
toString
-
ServerHeartbeatStartedEvent(ConnectionId, boolean)
.