public class InsertOperation extends BaseWriteOperation
Constructor and Description |
---|
InsertOperation(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> insertRequests)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
protected BulkWriteResult |
executeCommandProtocol(Connection connection)
Executes the write command protocol.
|
protected void |
executeCommandProtocolAsync(AsyncConnection connection,
SingleResultCallback<BulkWriteResult> callback)
Asynchronously executes the write command protocol.
|
protected WriteConcernResult |
executeProtocol(Connection connection)
Executes the write protocol
|
protected void |
executeProtocolAsync(AsyncConnection connection,
SingleResultCallback<WriteConcernResult> callback)
Asynchronously executes the write protocol
|
protected int |
getCount(BulkWriteResult bulkWriteResult) |
List<InsertRequest> |
getInsertRequests()
Gets the list of insert requests.
|
protected WriteRequest.Type |
getType() |
bypassDocumentValidation, execute, executeAsync, getBypassDocumentValidation, getNamespace, getUpdatedExisting, getWriteConcern, isOrdered
public InsertOperation(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<InsertRequest> insertRequests)
namespace
- the database and collection namespace for the operation.ordered
- whether the inserts are ordered.writeConcern
- the write concern for the operation.insertRequests
- the list of inserts.public List<InsertRequest> getInsertRequests()
protected WriteConcernResult executeProtocol(Connection connection)
BaseWriteOperation
executeProtocol
in class BaseWriteOperation
connection
- the connectionprotected void executeProtocolAsync(AsyncConnection connection, SingleResultCallback<WriteConcernResult> callback)
BaseWriteOperation
executeProtocolAsync
in class BaseWriteOperation
connection
- the connectioncallback
- the callback to be passed the WriteConcernResultprotected BulkWriteResult executeCommandProtocol(Connection connection)
BaseWriteOperation
executeCommandProtocol
in class BaseWriteOperation
connection
- the connectionprotected void executeCommandProtocolAsync(AsyncConnection connection, SingleResultCallback<BulkWriteResult> callback)
BaseWriteOperation
executeCommandProtocolAsync
in class BaseWriteOperation
connection
- the connectioncallback
- the callback to be passed the BulkWriteResultprotected WriteRequest.Type getType()
getType
in class BaseWriteOperation
protected int getCount(BulkWriteResult bulkWriteResult)
getCount
in class BaseWriteOperation