@ThreadSafe public interface AsyncConnection extends ReferenceCounted
Implementations of this class are thread safe.
Modifier and Type | Method and Description |
---|---|
<T> void |
commandAsync(String database,
BsonDocument command,
boolean slaveOk,
FieldNameValidator fieldNameValidator,
Decoder<T> commandResultDecoder,
SingleResultCallback<T> callback)
Execute the command asynchronously.
|
void |
deleteAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<DeleteRequest> deletes,
SingleResultCallback<WriteConcernResult> callback)
Delete the documents using the delete wire protocol and apply the write concern asynchronously.
|
void |
deleteCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<DeleteRequest> deletes,
SingleResultCallback<BulkWriteResult> callback)
Delete the documents using the delete command asynchronously.
|
ConnectionDescription |
getDescription()
Gets the description of the connection.
|
<T> void |
getMoreAsync(MongoNamespace namespace,
long cursorId,
int numberToReturn,
Decoder<T> resultDecoder,
SingleResultCallback<QueryResult<T>> callback)
Get more result documents from a cursor asynchronously.
|
void |
insertAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> inserts,
SingleResultCallback<WriteConcernResult> callback)
Insert the documents using the insert wire protocol and apply the write concern asynchronously.
|
void |
insertCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> inserts,
SingleResultCallback<BulkWriteResult> callback)
Insert the documents using the insert command asynchronously.
|
void |
killCursorAsync(List<Long> cursors,
SingleResultCallback<Void> callback)
Asynchronously Kills the given list of cursors.
|
<T> void |
queryAsync(MongoNamespace namespace,
BsonDocument queryDocument,
BsonDocument fields,
int numberToReturn,
int skip,
boolean slaveOk,
boolean tailableCursor,
boolean awaitData,
boolean noCursorTimeout,
boolean partial,
boolean oplogReplay,
Decoder<T> resultDecoder,
SingleResultCallback<QueryResult<T>> callback)
Execute the query asynchronously.
|
AsyncConnection |
retain()
Retain an additional reference to this object.
|
void |
updateAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates,
SingleResultCallback<WriteConcernResult> callback)
Update the documents using the update wire protocol and apply the write concern asynchronously.
|
void |
updateCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates,
SingleResultCallback<BulkWriteResult> callback)
Update the documents using the update command asynchronously.
|
getCount, release
AsyncConnection retain()
ReferenceCounted
retain
in interface ReferenceCounted
ConnectionDescription getDescription()
void insertAsync(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<InsertRequest> inserts, SingleResultCallback<WriteConcernResult> callback)
namespace
- the namespaceordered
- whether the writes are orderedwriteConcern
- the write concerninserts
- the insertscallback
- the callback to be passed the write resultvoid updateAsync(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<UpdateRequest> updates, SingleResultCallback<WriteConcernResult> callback)
namespace
- the namespaceordered
- whether the writes are orderedwriteConcern
- the write concernupdates
- the updatescallback
- the callback to be passed the write resultvoid deleteAsync(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<DeleteRequest> deletes, SingleResultCallback<WriteConcernResult> callback)
namespace
- the namespaceordered
- whether the writes are orderedwriteConcern
- the write concerndeletes
- the deletescallback
- the callback to be passed the write resultvoid insertCommandAsync(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<InsertRequest> inserts, SingleResultCallback<BulkWriteResult> callback)
namespace
- the namespaceordered
- whether the writes are orderedwriteConcern
- the write concerninserts
- the insertscallback
- the callback to be passed the bulk write resultvoid updateCommandAsync(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<UpdateRequest> updates, SingleResultCallback<BulkWriteResult> callback)
namespace
- the namespaceordered
- whether the writes are orderedwriteConcern
- the write concernupdates
- the updatescallback
- the callback to be passed the BulkWriteResultvoid deleteCommandAsync(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<DeleteRequest> deletes, SingleResultCallback<BulkWriteResult> callback)
namespace
- the namespaceordered
- whether the writes are orderedwriteConcern
- the write concerndeletes
- the deletescallback
- the callback to be passed the BulkWriteResult<T> void commandAsync(String database, BsonDocument command, boolean slaveOk, FieldNameValidator fieldNameValidator, Decoder<T> commandResultDecoder, SingleResultCallback<T> callback)
T
- the type of the resultdatabase
- the database to execute the command incommand
- the command documentslaveOk
- whether the command can run on a secondaryfieldNameValidator
- the field name validator for the command documentcommandResultDecoder
- the decoder for the resultcallback
- the callback to be passed the command result<T> void queryAsync(MongoNamespace namespace, BsonDocument queryDocument, BsonDocument fields, int numberToReturn, int skip, boolean slaveOk, boolean tailableCursor, boolean awaitData, boolean noCursorTimeout, boolean partial, boolean oplogReplay, Decoder<T> resultDecoder, SingleResultCallback<QueryResult<T>> callback)
T
- the query result document typenamespace
- the namespace to queryqueryDocument
- the query documentfields
- the field to include or excludenumberToReturn
- the number of documents to returnskip
- the number of documents to skipslaveOk
- whether the query can run on a secondarytailableCursor
- whether to return a tailable cursorawaitData
- whether a tailable cursor should wait before returning if no documents are availablenoCursorTimeout
- whether the cursor should not timeoutpartial
- whether partial results from sharded clusters are acceptableoplogReplay
- whether to replay the oplogresultDecoder
- the decoder for the query result documentscallback
- the callback to be passed the write result<T> void getMoreAsync(MongoNamespace namespace, long cursorId, int numberToReturn, Decoder<T> resultDecoder, SingleResultCallback<QueryResult<T>> callback)
T
- the type of the query result documentsnamespace
- the namespace to get more documents fromcursorId
- the cursor idnumberToReturn
- the number of documents to returnresultDecoder
- the decoder for the query result documentscallback
- the callback to be passed the query resultvoid killCursorAsync(List<Long> cursors, SingleResultCallback<Void> callback)
cursors
- the cursorscallback
- the callback that is called once the cursors have been killed