class CommandMessage extends RequestMessage
RequestMessage.EncodingMetadata, RequestMessage.OpCode
Modifier and Type | Field and Description |
---|---|
private BsonDocument |
command |
private boolean |
slaveOk |
private FieldNameValidator |
validator |
REQUEST_ID
Constructor and Description |
---|
CommandMessage(java.lang.String collectionName,
BsonDocument command,
boolean slaveOk,
FieldNameValidator validator,
MessageSettings settings)
Construct an instance.
|
CommandMessage(java.lang.String collectionName,
BsonDocument command,
boolean slaveOk,
MessageSettings settings)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
protected RequestMessage |
encodeMessageBody(BsonOutput bsonOutput,
int messageStartPosition)
Encode the message body to the given output.
|
protected RequestMessage.EncodingMetadata |
encodeMessageBodyWithMetadata(BsonOutput bsonOutput,
int messageStartPosition)
Encode the message body to the given output.
|
addCollectibleDocument, addDocument, backpatchMessageLength, encode, encodeWithMetadata, getCodec, getCollectionName, getCurrentGlobalId, getId, getNamespace, getOpCode, getSettings, writeMessagePrologue
private final boolean slaveOk
private final BsonDocument command
private final FieldNameValidator validator
public CommandMessage(java.lang.String collectionName, BsonDocument command, boolean slaveOk, MessageSettings settings)
collectionName
- the collection to execute the command incommand
- the commandslaveOk
- if querying of non-primary replica set members is allowedsettings
- the message settingspublic CommandMessage(java.lang.String collectionName, BsonDocument command, boolean slaveOk, FieldNameValidator validator, MessageSettings settings)
collectionName
- the collection to execute the command incommand
- the commandslaveOk
- if querying of non-primary replica set members is allowedvalidator
- the field name validatorsettings
- the message settingsprotected RequestMessage encodeMessageBody(BsonOutput bsonOutput, int messageStartPosition)
RequestMessage
encodeMessageBody
in class RequestMessage
bsonOutput
- the outputmessageStartPosition
- the start position of the messageprotected RequestMessage.EncodingMetadata encodeMessageBodyWithMetadata(BsonOutput bsonOutput, int messageStartPosition)
RequestMessage
encodeMessageBodyWithMetadata
in class RequestMessage
bsonOutput
- the outputmessageStartPosition
- the start position of the message