Package com.mongodb.event
Class ServerHeartbeatFailedEvent
-
- com.mongodb.event.ServerHeartbeatFailedEvent
-
public final class ServerHeartbeatFailedEvent extends
An event for server heartbeat failures.- Since:
- 3.3
-
-
Constructor Summary
Constructors Constructor Description ServerHeartbeatFailedEvent(ConnectionId connectionId, long elapsedTimeNanos, throwable)
Construct an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectionId
getConnectionId()
Gets the connectionId.long
timeUnit)
Gets the elapsed time in the given time unit.getThrowable()
Gets the exceptions that caused the failuretoString()
-
-
-
Constructor Detail
-
ServerHeartbeatFailedEvent
public ServerHeartbeatFailedEvent(ConnectionId connectionId, long elapsedTimeNanos, throwable)
Construct an instance.- Parameters:
connectionId
- the non-null connectionIdelapsedTimeNanos
- the non-negative elapsed time in nanosecondsthrowable
- the non-null exception that caused the failure
-
-
Method Detail
-
getConnectionId
public ConnectionId getConnectionId()
Gets the connectionId.- Returns:
- the connectionId
-
getElapsedTime
public long getElapsedTime( timeUnit)
Gets the elapsed time in the given time unit.- Parameters:
timeUnit
- the non-null timeUnit- Returns:
- the elapsed time in the given time unit
-
getThrowable
public getThrowable()
Gets the exceptions that caused the failure- Returns:
- the exception
-
toString
public toString()
- Overrides:
in class
-
-