public class MixedBulkWriteOperation extends Object implements AsyncWriteOperation<BulkWriteResult>, WriteOperation<BulkWriteResult>
Constructor and Description |
---|
MixedBulkWriteOperation(MongoNamespace namespace,
List<? extends WriteRequest> writeRequests,
boolean ordered,
WriteConcern writeConcern)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
MixedBulkWriteOperation |
bypassDocumentValidation(Boolean bypassDocumentValidation)
Sets the bypass document level validation flag.
|
BulkWriteResult |
execute(WriteBinding binding)
Executes a bulk write operation.
|
void |
executeAsync(AsyncWriteBinding binding,
SingleResultCallback<BulkWriteResult> callback)
General execute which can return anything of type T
|
Boolean |
getBypassDocumentValidation()
Gets the the bypass document level validation flag
|
MongoNamespace |
getNamespace()
Gets the namespace of the collection to write to.
|
WriteConcern |
getWriteConcern()
Gets the write concern to apply
|
List<? extends WriteRequest> |
getWriteRequests()
Gets the list of write requests to execute.
|
boolean |
isOrdered()
Gets whether the writes are ordered.
|
public MixedBulkWriteOperation(MongoNamespace namespace, List<? extends WriteRequest> writeRequests, boolean ordered, WriteConcern writeConcern)
namespace
- the database and collection namespace for the operation.writeRequests
- the list of writeRequests to execute.ordered
- whether the writeRequests must be executed in order.writeConcern
- the write concern for the operation.public MongoNamespace getNamespace()
public WriteConcern getWriteConcern()
public boolean isOrdered()
public List<? extends WriteRequest> getWriteRequests()
public Boolean getBypassDocumentValidation()
public MixedBulkWriteOperation bypassDocumentValidation(Boolean bypassDocumentValidation)
bypassDocumentValidation
- If true, allows the write to opt-out of document level validation.public BulkWriteResult execute(WriteBinding binding)
execute
in interface WriteOperation<BulkWriteResult>
binding
- the WriteBinding for the operationMongoBulkWriteException
- if a failure to complete the bulk write is detected based on the server responsepublic void executeAsync(AsyncWriteBinding binding, SingleResultCallback<BulkWriteResult> callback)
AsyncWriteOperation
executeAsync
in interface AsyncWriteOperation<BulkWriteResult>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed