Package com.mongodb.operation
Class BaseWriteOperation
- java.lang.Object
-
- com.mongodb.operation.BaseWriteOperation
-
- All Implemented Interfaces:
AsyncWriteOperation<WriteConcernResult>
,WriteOperation<WriteConcernResult>
- Direct Known Subclasses:
DeleteOperation
,InsertOperation
,UpdateOperation
@Deprecated public abstract class BaseWriteOperation extends Object implements AsyncWriteOperation<WriteConcernResult>, WriteOperation<WriteConcernResult>
Deprecated.Abstract base class for write operations.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description BaseWriteOperation(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern)
Deprecated.BaseWriteOperation(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, boolean retryWrites)
Deprecated.Construct an instance
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BaseWriteOperation
bypassDocumentValidation(Boolean bypassDocumentValidation)
Deprecated.Sets the bypass document level validation flag.WriteConcernResult
execute(WriteBinding binding)
Deprecated.General execute which can return anything of type Tvoid
executeAsync(AsyncWriteBinding binding, SingleResultCallback<WriteConcernResult> callback)
Deprecated.General execute which can return anything of type TBoolean
getBypassDocumentValidation()
Deprecated.Gets the the bypass document level validation flagMongoNamespace
getNamespace()
Deprecated.Gets the namespace of the collection to write to.protected abstract WriteRequest.Type
getType()
Deprecated.WriteConcern
getWriteConcern()
Deprecated.Gets the write concern to applyprotected abstract List<? extends WriteRequest>
getWriteRequests()
Deprecated.boolean
isOrdered()
Deprecated.Gets whether the writes are ordered.
-
-
-
Constructor Detail
-
BaseWriteOperation
@Deprecated public BaseWriteOperation(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern)
Deprecated.Construct an instance- Parameters:
namespace
- the database and collection namespace for the operation.ordered
- whether the writes are ordered.writeConcern
- the write concern for the operation.
-
BaseWriteOperation
public BaseWriteOperation(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, boolean retryWrites)
Deprecated.Construct an instance- Parameters:
namespace
- the database and collection namespace for the operation.ordered
- whether the writes are ordered.writeConcern
- the write concern for the operation.retryWrites
- if writes should be retried if they fail due to a network error.- Since:
- 3.6
-
-
Method Detail
-
getWriteRequests
protected abstract List<? extends WriteRequest> getWriteRequests()
Deprecated.
-
getType
protected abstract WriteRequest.Type getType()
Deprecated.
-
getNamespace
public MongoNamespace getNamespace()
Deprecated.Gets the namespace of the collection to write to.- Returns:
- the namespace
-
getWriteConcern
public WriteConcern getWriteConcern()
Deprecated.Gets the write concern to apply- Returns:
- the write concern
-
isOrdered
public boolean isOrdered()
Deprecated.Gets whether the writes are ordered. If true, no more writes will be executed after the first failure.- Returns:
- whether the writes are ordered
-
getBypassDocumentValidation
public Boolean getBypassDocumentValidation()
Deprecated.Gets the the bypass document level validation flag- Returns:
- the bypass document level validation flag
- Since:
- 3.2
- Since server release
- 3.2
-
bypassDocumentValidation
public BaseWriteOperation bypassDocumentValidation(Boolean bypassDocumentValidation)
Deprecated.Sets the bypass document level validation flag.- Parameters:
bypassDocumentValidation
- If true, allows the write to opt-out of document level validation.- Returns:
- this
- Since:
- 3.2
- Since server release
- 3.2
-
execute
public WriteConcernResult execute(WriteBinding binding)
Deprecated.Description copied from interface:WriteOperation
General execute which can return anything of type T- Specified by:
execute
in interfaceWriteOperation<WriteConcernResult>
- Parameters:
binding
- the binding to execute in the context of- Returns:
- T, the result of the execution
-
executeAsync
public void executeAsync(AsyncWriteBinding binding, SingleResultCallback<WriteConcernResult> callback)
Deprecated.Description copied from interface:AsyncWriteOperation
General execute which can return anything of type T- Specified by:
executeAsync
in interfaceAsyncWriteOperation<WriteConcernResult>
- Parameters:
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed
-
-