abstract class BaseWriteCommandMessage extends RequestMessage
RequestMessage.EncodingMetadata, RequestMessage.OpCode
Modifier and Type | Field and Description |
---|---|
private java.lang.Boolean |
bypassDocumentValidation |
private static int |
HEADROOM |
private boolean |
ordered |
private WriteConcern |
writeConcern |
private MongoNamespace |
writeNamespace |
REQUEST_ID
Constructor and Description |
---|
BaseWriteCommandMessage(MongoNamespace writeNamespace,
boolean ordered,
WriteConcern writeConcern,
java.lang.Boolean bypassDocumentValidation,
MessageSettings settings) |
Modifier and Type | Method and Description |
---|---|
BaseWriteCommandMessage |
encode(BsonOutput outputStream)
Encoded the message to the given output.
|
protected BaseWriteCommandMessage |
encodeMessageBody(BsonOutput outputStream,
int messageStartPosition)
Encode the message body to the given output.
|
protected RequestMessage.EncodingMetadata |
encodeMessageBodyWithMetadata(BsonOutput outputStream,
int messageStartPosition)
Encode the message body to the given output.
|
private boolean |
exceedsBatchItemCountLimit(int batchItemCount) |
private boolean |
exceedsBatchLengthLimit(int batchLength,
int batchItemCount) |
(package private) boolean |
exceedsLimits(int batchLength,
int batchItemCount) |
java.lang.Boolean |
getBypassDocumentValidation()
Gets the bypass document validation flag
|
protected abstract java.lang.String |
getCommandName()
Gets the name of the write command
|
protected abstract FieldNameValidator |
getFieldNameValidator()
Gets the field name validator to apply.
|
abstract int |
getItemCount()
Gets the number of write requests left to encode.
|
WriteConcern |
getWriteConcern()
Gets the write concern.
|
MongoNamespace |
getWriteNamespace()
Gets the namespace to write to.
|
boolean |
isOrdered()
Gets whether the writes are ordered.
|
private void |
writeCommandHeader(BsonOutput outputStream) |
private void |
writeCommandPrologue(BsonBinaryWriter writer) |
protected abstract BaseWriteCommandMessage |
writeTheWrites(BsonOutput bsonOutput,
int commandStartPosition,
BsonBinaryWriter writer)
Write the list of writes to the output after the write command prologue has been written.
|
addCollectibleDocument, addDocument, backpatchMessageLength, encodeWithMetadata, getCodec, getCollectionName, getCurrentGlobalId, getId, getNamespace, getOpCode, getSettings, writeMessagePrologue
private static final int HEADROOM
private final MongoNamespace writeNamespace
private final boolean ordered
private final WriteConcern writeConcern
private final java.lang.Boolean bypassDocumentValidation
BaseWriteCommandMessage(MongoNamespace writeNamespace, boolean ordered, WriteConcern writeConcern, java.lang.Boolean bypassDocumentValidation, MessageSettings settings)
public MongoNamespace getWriteNamespace()
public WriteConcern getWriteConcern()
public boolean isOrdered()
public java.lang.Boolean getBypassDocumentValidation()
public BaseWriteCommandMessage encode(BsonOutput outputStream)
RequestMessage
encode
in class RequestMessage
outputStream
- the outputpublic abstract int getItemCount()
protected BaseWriteCommandMessage encodeMessageBody(BsonOutput outputStream, int messageStartPosition)
RequestMessage
encodeMessageBody
in class RequestMessage
outputStream
- the outputmessageStartPosition
- the start position of the messageprotected RequestMessage.EncodingMetadata encodeMessageBodyWithMetadata(BsonOutput outputStream, int messageStartPosition)
RequestMessage
encodeMessageBodyWithMetadata
in class RequestMessage
outputStream
- the outputmessageStartPosition
- the start position of the messageprotected abstract FieldNameValidator getFieldNameValidator()
private void writeCommandHeader(BsonOutput outputStream)
protected abstract java.lang.String getCommandName()
protected abstract BaseWriteCommandMessage writeTheWrites(BsonOutput bsonOutput, int commandStartPosition, BsonBinaryWriter writer)
bsonOutput
- the BSON outputcommandStartPosition
- the position in the output where the command document startswriter
- the writerboolean exceedsLimits(int batchLength, int batchItemCount)
private boolean exceedsBatchLengthLimit(int batchLength, int batchItemCount)
private boolean exceedsBatchItemCountLimit(int batchItemCount)
private void writeCommandPrologue(BsonBinaryWriter writer)