Package com.mongodb.event
Class ServerHeartbeatSucceededEvent
- java.lang.Object
 - 
- com.mongodb.event.ServerHeartbeatSucceededEvent
 
 
- 
public final class ServerHeartbeatSucceededEvent extends java.lang.ObjectAn event for successful completion of a server heartbeat.- Since:
 - 3.3
 
 
- 
- 
Constructor Summary
Constructors Constructor Description ServerHeartbeatSucceededEvent(ConnectionId connectionId, BsonDocument reply, long elapsedTimeNanos)Construct an instance. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectionIdgetConnectionId()Gets the connectionId.longgetElapsedTime(java.util.concurrent.TimeUnit timeUnit)Gets the elapsed time in the given time unit.BsonDocumentgetReply()Gets the reply to the isMaster command executed for this heartbeat.java.lang.StringtoString() 
 - 
 
- 
- 
Constructor Detail
- 
ServerHeartbeatSucceededEvent
public ServerHeartbeatSucceededEvent(ConnectionId connectionId, BsonDocument reply, long elapsedTimeNanos)
Construct an instance.- Parameters:
 connectionId- the non-null connectionIdreply- the non-null reply to an isMaster commandelapsedTimeNanos- the non-negative elapsed time in nanoseconds
 
 - 
 
- 
Method Detail
- 
getConnectionId
public ConnectionId getConnectionId()
Gets the connectionId.- Returns:
 - the connectionId
 
 
- 
getReply
public BsonDocument getReply()
Gets the reply to the isMaster command executed for this heartbeat.- Returns:
 - the reply
 
 
- 
getElapsedTime
public long getElapsedTime(java.util.concurrent.TimeUnit 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
 
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
 - 
 
 -