Class ServerHeartbeatStartedEvent

java.lang.Object
com.mongodb.event.ServerHeartbeatStartedEvent

public final class ServerHeartbeatStartedEvent extends Object
An event for the start of a server heartbeat.
Since:
3.3
  • Constructor Details

    • ServerHeartbeatStartedEvent

      public ServerHeartbeatStartedEvent(ConnectionId connectionId, boolean awaited)
      Construct an instance.
      Parameters:
      connectionId - the non-null connnectionId
      awaited - true if and only if the heartbeat is for an awaitable `hello` / legacy hello.
      Since:
      5.1
    • ServerHeartbeatStartedEvent

      @Deprecated public ServerHeartbeatStartedEvent(ConnectionId connectionId)
      Deprecated.
      Prefer ServerHeartbeatStartedEvent(ConnectionId, boolean). If this constructor is used then isAwaited() is false.
      Construct an instance.
      Parameters:
      connectionId - the non-null connnectionId
  • Method Details

    • getConnectionId

      public ConnectionId 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

      public String toString()
      Overrides:
      toString in class Object