public class MixedBulkWriteOperation extends java.lang.Object implements AsyncWriteOperation<BulkWriteResult>, WriteOperation<BulkWriteResult>
Constructor and Description |
---|
MixedBulkWriteOperation(MongoNamespace namespace,
java.util.List<? extends WriteRequest> writeRequests,
boolean ordered,
WriteConcern writeConcern)
Deprecated.
|
MixedBulkWriteOperation(MongoNamespace namespace,
java.util.List<? extends WriteRequest> writeRequests,
boolean ordered,
WriteConcern writeConcern,
boolean retryWrites)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
MixedBulkWriteOperation |
bypassDocumentValidation(java.lang.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
|
java.lang.Boolean |
getBypassDocumentValidation()
Gets the the bypass document level validation flag
|
MongoNamespace |
getNamespace()
Gets the namespace of the collection to write to.
|
java.lang.Boolean |
getRetryWrites()
Returns true if writes should be retried if they fail due to a network error.
|
WriteConcern |
getWriteConcern()
Gets the write concern to apply
|
java.util.List<? extends WriteRequest> |
getWriteRequests()
Gets the list of write requests to execute.
|
boolean |
isOrdered()
Gets whether the writes are ordered.
|
@Deprecated public MixedBulkWriteOperation(MongoNamespace namespace, java.util.List<? extends WriteRequest> writeRequests, boolean ordered, WriteConcern writeConcern)
MixedBulkWriteOperation(MongoNamespace, List, boolean, WriteConcern, boolean)
insteadnamespace
- 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 MixedBulkWriteOperation(MongoNamespace namespace, java.util.List<? extends WriteRequest> writeRequests, boolean ordered, WriteConcern writeConcern, boolean retryWrites)
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.retryWrites
- if writes should be retried if they fail due to a network error.public MongoNamespace getNamespace()
public WriteConcern getWriteConcern()
public boolean isOrdered()
public java.util.List<? extends WriteRequest> getWriteRequests()
public java.lang.Boolean getBypassDocumentValidation()
public MixedBulkWriteOperation bypassDocumentValidation(java.lang.Boolean bypassDocumentValidation)
bypassDocumentValidation
- If true, allows the write to opt-out of document level validation.public java.lang.Boolean getRetryWrites()
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