Package com.mongodb.event
Class CommandFailedEvent
-
- com.mongodb.event.CommandEvent
-
- com.mongodb.event.CommandFailedEvent
-
public final class CommandFailedEvent extends CommandEvent
An event representing the failure of a MongoDB database command.- Since:
- 3.1
-
-
Constructor Summary
Constructors Constructor Description CommandFailedEvent(int requestId, ConnectionDescription connectionDescription, commandName, long elapsedTimeNanos, throwable)
Construct an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
timeUnit)
Gets the elapsed time in the given unit of time.getThrowable()
Gets the throwable cause of the failure-
Methods inherited from class com.mongodb.event.CommandEvent
getCommandName, getConnectionDescription, getRequestId
-
-
-
-
Constructor Detail
-
CommandFailedEvent
public CommandFailedEvent(int requestId, ConnectionDescription connectionDescription, commandName, long elapsedTimeNanos, throwable)
Construct an instance.- Parameters:
requestId
- the requestIdconnectionDescription
- the connection descriptioncommandName
- the command nameelapsedTimeNanos
- the non-negative elapsed time in nanoseconds for the operation to completethrowable
- the throwable cause of the failure
-
-
Method Detail
-
getElapsedTime
public long getElapsedTime( timeUnit)
Gets the elapsed time in the given unit of time.- Parameters:
timeUnit
- the time unit in which to get the elapsed time- Returns:
- the elapsed time
-
getThrowable
public getThrowable()
Gets the throwable cause of the failure- Returns:
- the throwable cause of the failuer
-
-