public final class CommandSucceededEvent extends CommandEvent
Constructor | Description |
---|---|
CommandSucceededEvent(int requestId,
ConnectionDescription connectionDescription,
String commandName,
BsonDocument response,
long elapsedTimeNanos) |
Construct an instance.
|
Modifier and Type | Method | Description |
---|---|---|
long |
getElapsedTime(TimeUnit timeUnit) |
Gets the elapsed time in the given unit of time.
|
BsonDocument |
getResponse() |
Gets the response document.
|
getCommandName, getConnectionDescription, getRequestId
public CommandSucceededEvent(int requestId, ConnectionDescription connectionDescription, String commandName, BsonDocument response, long elapsedTimeNanos)
requestId
- the request idconnectionDescription
- the connection descriptioncommandName
- the command nameresponse
- the command responseelapsedTimeNanos
- the non-negative elapsed time in nanoseconds for the operation to completepublic long getElapsedTime(TimeUnit timeUnit)
timeUnit
- the time unit in which to get the elapsed timepublic BsonDocument getResponse()
Object.clone()
.