class InsertCommandMessage extends BaseWriteCommandMessage
RequestMessage.EncodingMetadata, RequestMessage.OpCode
Modifier and Type | Field and Description |
---|---|
private java.util.List<InsertRequest> |
insertRequestList |
REQUEST_ID
Constructor and Description |
---|
InsertCommandMessage(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
java.lang.Boolean bypassDocumentValidation,
MessageSettings settings,
java.util.List<InsertRequest> insertRequestList)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getCommandName()
Gets the command name, which is "insert".
|
protected FieldNameValidator |
getFieldNameValidator()
Gets the field name validator to apply.
|
int |
getItemCount()
Gets the number of write requests left to encode.
|
java.util.List<InsertRequest> |
getRequests()
Gets the list of insert requests.
|
protected InsertCommandMessage |
writeTheWrites(BsonOutput bsonOutput,
int commandStartPosition,
BsonBinaryWriter writer)
Write the list of writes to the output after the write command prologue has been written.
|
encode, encodeMessageBody, encodeMessageBodyWithMetadata, exceedsLimits, getBypassDocumentValidation, getWriteConcern, getWriteNamespace, isOrdered
addCollectibleDocument, addDocument, backpatchMessageLength, encodeWithMetadata, getCodec, getCollectionName, getCurrentGlobalId, getId, getNamespace, getOpCode, getSettings, writeMessagePrologue
private final java.util.List<InsertRequest> insertRequestList
public InsertCommandMessage(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, java.lang.Boolean bypassDocumentValidation, MessageSettings settings, java.util.List<InsertRequest> insertRequestList)
namespace
- the namespaceordered
- whether the inserts are orderedwriteConcern
- the write concernbypassDocumentValidation
- the bypass documentation validation flagsettings
- the message settingsinsertRequestList
- the list of insertspublic int getItemCount()
BaseWriteCommandMessage
getItemCount
in class BaseWriteCommandMessage
protected FieldNameValidator getFieldNameValidator()
BaseWriteCommandMessage
getFieldNameValidator
in class BaseWriteCommandMessage
public java.util.List<InsertRequest> getRequests()
protected java.lang.String getCommandName()
getCommandName
in class BaseWriteCommandMessage
protected InsertCommandMessage writeTheWrites(BsonOutput bsonOutput, int commandStartPosition, BsonBinaryWriter writer)
BaseWriteCommandMessage
writeTheWrites
in class BaseWriteCommandMessage
bsonOutput
- the BSON outputcommandStartPosition
- the position in the output where the command document startswriter
- the writer