Package com.mongodb.event
Class CommandEvent
- java.lang.Object
-
- com.mongodb.event.CommandEvent
-
- Direct Known Subclasses:
CommandFailedEvent,CommandStartedEvent,CommandSucceededEvent
public abstract class CommandEvent extends Object
An event representing a MongoDB database command.- Since:
- 3.1
-
-
Constructor Summary
Constructors Constructor Description CommandEvent(int requestId, ConnectionDescription connectionDescription, String commandName)Construct an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCommandName()Gets the name of the command.ConnectionDescriptiongetConnectionDescription()Gets the description of the connection to which the operation will be sent.intgetRequestId()Gets the request identifier
-
-
-
Constructor Detail
-
CommandEvent
public CommandEvent(int requestId, ConnectionDescription connectionDescription, String commandName)Construct an instance.- Parameters:
requestId- the request idconnectionDescription- the connection descriptioncommandName- the command name
-
-
Method Detail
-
getRequestId
public int getRequestId()
Gets the request identifier- Returns:
- the request identifier
-
getConnectionDescription
public ConnectionDescription getConnectionDescription()
Gets the description of the connection to which the operation will be sent.- Returns:
- the connection description
-
getCommandName
public String getCommandName()
Gets the name of the command.- Returns:
- the command name
-
-