Package com.mongodb.event
Class CommandEvent
java.lang.Object
com.mongodb.event.CommandEvent
- Direct Known Subclasses:
- CommandFailedEvent,- CommandStartedEvent,- CommandSucceededEvent
An event representing a MongoDB database command.
- Since:
- 3.1
- 
Constructor SummaryConstructorsConstructorDescriptionCommandEvent(int requestId, ConnectionDescription connectionDescription, String commandName) Construct an instance.CommandEvent(RequestContext requestContext, int requestId, ConnectionDescription connectionDescription, String commandName) Construct an instance.
- 
Method SummaryModifier and TypeMethodDescriptionGets the name of the command.Gets the description of the connection to which the operation will be sent.Gets the request context associated with this event.intGets the request identifier
- 
Constructor Details- 
CommandEventpublic CommandEvent(@Nullable RequestContext requestContext, int requestId, ConnectionDescription connectionDescription, String commandName) Construct an instance.- Parameters:
- requestContext- the request context
- requestId- the request id
- connectionDescription- the connection description
- commandName- the command name
- Since:
- 4.4
 
- 
CommandEventConstruct an instance.- Parameters:
- requestId- the request id
- connectionDescription- the connection description
- commandName- the command name
 
 
- 
- 
Method Details- 
getRequestIdpublic int getRequestId()Gets the request identifier- Returns:
- the request identifier
 
- 
getConnectionDescriptionGets the description of the connection to which the operation will be sent.- Returns:
- the connection description
 
- 
getCommandNameGets the name of the command.- Returns:
- the command name
 
- 
getRequestContextGets the request context associated with this event.- Returns:
- the request context
- Since:
- 4.4
 
 
-