@ThreadSafe public interface AsyncConnection extends ReferenceCounted
Implementations of this class are thread safe.
This interface is not stable. While methods will not be removed, new ones may be added.
| 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,
Boolean bypassDocumentValidation,
List<InsertRequest> inserts,
SingleResultCallback<BulkWriteResult> callback)
Insert the documents using the insert command asynchronously.
|
void |
insertCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> inserts,
SingleResultCallback<BulkWriteResult> callback)
Deprecated.
|
void |
killCursorAsync(List<Long> cursors,
SingleResultCallback<Void> callback)
Deprecated.
|
void |
killCursorAsync(MongoNamespace namespace,
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)
|
<T> void |
queryAsync(MongoNamespace namespace,
BsonDocument queryDocument,
BsonDocument fields,
int skip,
int limit,
int batchSize,
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,
Boolean bypassDocumentValidation,
List<UpdateRequest> updates,
SingleResultCallback<BulkWriteResult> callback)
Update the documents using the update command asynchronously.
|
void |
updateCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates,
SingleResultCallback<BulkWriteResult> callback)
Deprecated.
|
getCount, releaseAsyncConnection retain()
ReferenceCountedretain in interface ReferenceCountedConnectionDescription 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 result@Deprecated void insertCommandAsync(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<InsertRequest> inserts, SingleResultCallback<BulkWriteResult> callback)
insertCommandAsync(MongoNamespace, boolean, WriteConcern, Boolean, List,
SingleResultCallback)namespace - the namespaceordered - whether the writes are orderedwriteConcern - the write concerninserts - the insertscallback - the callback to be passed the bulk write resultvoid insertCommandAsync(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, Boolean bypassDocumentValidation, List<InsertRequest> inserts, SingleResultCallback<BulkWriteResult> callback)
namespace - the namespaceordered - whether the writes are orderedwriteConcern - the write concernbypassDocumentValidation - the bypassDocumentValidation flaginserts - the insertscallback - the callback to be passed the bulk write result@Deprecated void updateCommandAsync(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<UpdateRequest> updates, SingleResultCallback<BulkWriteResult> callback)
updateCommandAsync(MongoNamespace, boolean, WriteConcern, Boolean, List,
SingleResultCallback)namespace - the namespaceordered - whether the writes are orderedwriteConcern - the write concernupdates - the updatescallback - the callback to be passed the BulkWriteResultvoid updateCommandAsync(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, Boolean bypassDocumentValidation, List<UpdateRequest> updates, SingleResultCallback<BulkWriteResult> callback)
namespace - the namespaceordered - whether the writes are orderedwriteConcern - the write concernbypassDocumentValidation - the bypassDocumentValidation flagupdates - 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@Deprecated <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)
queryAsync(MongoNamespace, BsonDocument, BsonDocument, int, int, int, boolean, boolean, boolean,
boolean, boolean, boolean, Decoder, SingleResultCallback)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 queryAsync(MongoNamespace namespace, BsonDocument queryDocument, BsonDocument fields, int skip, int limit, int batchSize, 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 excludeskip - the number of documents to skiplimit - the maximum number of documents to return in all batchesbatchSize - the maximum number of documents to return in this batchslaveOk - 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 result@Deprecated void killCursorAsync(List<Long> cursors, SingleResultCallback<Void> callback)
killCursorAsync(MongoNamespace, List, SingleResultCallback)cursors - the cursorscallback - the callback that is called once the cursors have been killedvoid killCursorAsync(MongoNamespace namespace, List<Long> cursors, SingleResultCallback<Void> callback)
namespace - the namespace in which the cursors livecursors - the cursorscallback - the callback that is called once the cursors have been killed