Package com.mongodb.operation
Class BaseFindAndModifyOperation<T>
- java.lang.Object
-
- com.mongodb.operation.BaseFindAndModifyOperation<T>
-
- Type Parameters:
T
- the document type
- All Implemented Interfaces:
AsyncWriteOperation<T>
,WriteOperation<T>
- Direct Known Subclasses:
FindAndDeleteOperation
,FindAndReplaceOperation
,FindAndUpdateOperation
Deprecated.
@Deprecated public abstract class BaseFindAndModifyOperation<T> extends Object implements AsyncWriteOperation<T>, WriteOperation<T>
Abstract base class for findAndModify-based operations- Since:
- 3.8
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseFindAndModifyOperation(MongoNamespace namespace, WriteConcern writeConcern, boolean retryWrites, Decoder<T> decoder)
Deprecated.Construct a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addTxnNumberToCommand(ServerDescription serverDescription, ConnectionDescription connectionDescription, BsonDocument commandDocument, SessionContext sessionContext)
Deprecated.protected void
addWriteConcernToCommand(ConnectionDescription connectionDescription, BsonDocument commandDocument, SessionContext sessionContext)
Deprecated.T
execute(WriteBinding binding)
Deprecated.General execute which can return anything of type Tvoid
executeAsync(AsyncWriteBinding binding, SingleResultCallback<T> callback)
Deprecated.General execute which can return anything of type Tprotected abstract com.mongodb.operation.CommandOperationHelper.CommandCreator
getCommandCreator(SessionContext sessionContext)
Deprecated.protected abstract String
getDatabaseName()
Deprecated.Decoder<T>
getDecoder()
Deprecated.Gets the decoder used to decode the result documents.protected abstract FieldNameValidator
getFieldNameValidator()
Deprecated.MongoNamespace
getNamespace()
Deprecated.Gets the namespace.WriteConcern
getWriteConcern()
Deprecated.Get the write concern for this operationboolean
isRetryWrites()
Deprecated.Returns true if the operation should be retried.
-
-
-
Constructor Detail
-
BaseFindAndModifyOperation
protected BaseFindAndModifyOperation(MongoNamespace namespace, WriteConcern writeConcern, boolean retryWrites, Decoder<T> decoder)
Deprecated.Construct a new instance.- Parameters:
namespace
- the database and collection namespace for the operation.writeConcern
- the writeConcern for the operationretryWrites
- if writes should be retried if they fail due to a network error.decoder
- the decoder for the result documents.
-
-
Method Detail
-
execute
public T execute(WriteBinding binding)
Deprecated.Description copied from interface:WriteOperation
General execute which can return anything of type T- Specified by:
execute
in interfaceWriteOperation<T>
- Parameters:
binding
- the binding to execute in the context of- Returns:
- T, the result of the execution
-
executeAsync
public void executeAsync(AsyncWriteBinding binding, SingleResultCallback<T> callback)
Deprecated.Description copied from interface:AsyncWriteOperation
General execute which can return anything of type T- Specified by:
executeAsync
in interfaceAsyncWriteOperation<T>
- Parameters:
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed
-
getDatabaseName
protected abstract String getDatabaseName()
Deprecated.
-
getNamespace
public MongoNamespace getNamespace()
Deprecated.Gets the namespace.- Returns:
- the namespace
-
getWriteConcern
public WriteConcern getWriteConcern()
Deprecated.Get the write concern for this operation- Returns:
- the
WriteConcern
- Since:
- 3.2
- Since server release
- 3.2
-
getDecoder
public Decoder<T> getDecoder()
Deprecated.Gets the decoder used to decode the result documents.- Returns:
- the decoder
-
isRetryWrites
public boolean isRetryWrites()
Deprecated.Returns true if the operation should be retried.- Returns:
- true if the operation should be retried
- Since:
- 3.8
-
getCommandCreator
protected abstract com.mongodb.operation.CommandOperationHelper.CommandCreator getCommandCreator(SessionContext sessionContext)
Deprecated.
-
addTxnNumberToCommand
protected void addTxnNumberToCommand(ServerDescription serverDescription, ConnectionDescription connectionDescription, BsonDocument commandDocument, SessionContext sessionContext)
Deprecated.
-
addWriteConcernToCommand
protected void addWriteConcernToCommand(ConnectionDescription connectionDescription, BsonDocument commandDocument, SessionContext sessionContext)
Deprecated.
-
getFieldNameValidator
protected abstract FieldNameValidator getFieldNameValidator()
Deprecated.
-
-