@Override public void executeAsync(final AsyncReadBinding binding, final SingleResultCallback<T> callback) { executeWrappedCommandProtocolAsync(binding, databaseName, command, decoder, callback); } }
@Override public void executeAsync(final AsyncWriteBinding binding, final SingleResultCallback<T> callback) { executeWrappedCommandProtocolAsync(binding, databaseName, command, decoder, callback); } }
static <T> void executeWrappedCommandProtocolAsync(final AsyncReadBinding binding, final String database, final BsonDocument command, final AsyncConnection connection, final CommandTransformer<BsonDocument, T> transformer, final SingleResultCallback<T> callback) { executeWrappedCommandProtocolAsync(binding, database, command, new BsonDocumentCodec(), connection, transformer, callback); }
static <T> void executeWrappedCommandProtocolAsync(final AsyncReadBinding binding, final String database, final BsonDocument command, final Decoder<T> decoder, final SingleResultCallback<T> callback) { executeWrappedCommandProtocolAsync(binding, database, command, decoder, new IdentityTransformer<T>(), callback); }
static <T> void executeWrappedCommandProtocolAsync(final AsyncReadBinding binding, final String database, final BsonDocument command, final CommandTransformer<BsonDocument, T> transformer, final SingleResultCallback<T> callback) { executeWrappedCommandProtocolAsync(binding, database, command, new BsonDocumentCodec(), transformer, callback); }
static <T> void executeWrappedCommandProtocolAsync(final AsyncWriteBinding binding, final String database, final BsonDocument command, final Decoder<T> decoder, final SingleResultCallback<T> callback) { executeWrappedCommandProtocolAsync(binding, database, command, decoder, new IdentityTransformer<T>(), callback); }
static <T> void executeWrappedCommandProtocolAsync(final AsyncWriteBinding binding, final String database, final BsonDocument command, final CommandTransformer<BsonDocument, T> transformer, final SingleResultCallback<T> callback) { executeWrappedCommandProtocolAsync(binding, database, command, new BsonDocumentCodec(), transformer, callback); }
static <D, T> void executeWrappedCommandProtocolAsync(final AsyncWriteBinding binding, final String database, final BsonDocument command, final Decoder<D> decoder, final CommandTransformer<D, T> transformer, final SingleResultCallback<T> callback) { executeWrappedCommandProtocolAsync(binding, database, command, new NoOpFieldNameValidator(), decoder, transformer, callback); }
static void executeWrappedCommandProtocolAsync(final AsyncWriteBinding binding, final String database, final BsonDocument command, final AsyncConnection connection, final SingleResultCallback<BsonDocument> callback) { executeWrappedCommandProtocolAsync(binding, database, command, connection, new IdentityTransformer<BsonDocument>(), callback); }
static <T> void executeWrappedCommandProtocolAsync(final AsyncReadBinding binding, final String database, final BsonDocument command, final Decoder<BsonDocument> decoder, final AsyncConnection connection, final CommandTransformer<BsonDocument, T> transformer, final SingleResultCallback<T> callback) { notNull("binding", binding); executeWrappedCommandProtocolAsync(database, command, decoder, connection, binding.getReadPreference(), transformer, binding.getSessionContext(), callback); }
static <T> void executeWrappedCommandProtocolAsync(final AsyncWriteBinding binding, final String database, final BsonDocument command, final Decoder<BsonDocument> decoder, final AsyncConnection connection, final CommandTransformer<BsonDocument, T> transformer, final SingleResultCallback<T> callback) { notNull("binding", binding); executeWrappedCommandProtocolAsync(database, command, decoder, connection, primary(), transformer, binding.getSessionContext(), callback); }
static <T> void executeWrappedCommandProtocolAsync(final AsyncWriteBinding binding, final String database, final BsonDocument command, final FieldNameValidator fieldNameValidator, final Decoder<BsonDocument> decoder, final AsyncConnection connection, final CommandTransformer<BsonDocument, T> transformer, final SingleResultCallback<T> callback) { notNull("binding", binding); executeWrappedCommandProtocolAsync(database, command, fieldNameValidator, decoder, connection, primary(), transformer, binding.getSessionContext(), callback); }
static <T> void executeWrappedCommandProtocolAsync(final AsyncWriteBinding binding, final String database, final BsonDocument command, final AsyncConnection connection, final CommandTransformer<BsonDocument, T> transformer, final SingleResultCallback<T> callback) { notNull("binding", binding); executeWrappedCommandProtocolAsync(database, command, new BsonDocumentCodec(), connection, primary(), transformer, binding.getSessionContext(), callback); }
@Override public void call(final AsyncConnection connection, final Throwable t) { SingleResultCallback<Boolean> errHandlingCallback = errorHandlingCallback(callback, LOGGER); if (t != null) { errHandlingCallback.onResult(null, t); } else { final SingleResultCallback<Boolean> wrappedCallback = releasingCallback(errHandlingCallback, connection); executeWrappedCommandProtocolAsync(binding, databaseName, getCommand(), new BsonDocumentCodec(), connection, transformer(), wrappedCallback); } } });
@Override public void call(final AsyncConnection connection, final Throwable t) { SingleResultCallback<Void> errHandlingCallback = errorHandlingCallback(callback, LOGGER); if (t != null) { errHandlingCallback.onResult(null, t); } else { final SingleResultCallback<Void> wrappedCallback = releasingCallback(errHandlingCallback, connection); executeWrappedCommandProtocolAsync(binding, databaseName, getCommand(connection.getDescription()), connection, writeConcernErrorTransformer(), userCommandCallback(wrappedCallback)); } } });
@Override public void call(final AsyncConnection connection, final Throwable t) { SingleResultCallback<Void> errHandlingCallback = errorHandlingCallback(callback, LOGGER); if (t != null) { errHandlingCallback.onResult(null, t); } else { final SingleResultCallback<Void> wrappedCallback = releasingCallback(errHandlingCallback, connection); executeWrappedCommandProtocolAsync(binding, credential.getSource(), getCommand(connection.getDescription()), connection, writeConcernErrorTransformer(), userCommandCallback(wrappedCallback)); } } });
@Override public void call(final AsyncConnection connection, final Throwable t) { SingleResultCallback<Void> errHandlingCallback = errorHandlingCallback(callback, LOGGER); if (t != null) { errHandlingCallback.onResult(null, t); } else { final SingleResultCallback<Void> wrappedCallback = releasingCallback(errHandlingCallback, connection); executeWrappedCommandProtocolAsync(binding, credential.getSource(), getCommand(connection.getDescription()), connection, writeConcernErrorTransformer(), userCommandCallback(wrappedCallback)); } } });
@Override public void call(final AsyncConnection connection, final Throwable t) { SingleResultCallback<Void> errHandlingCallback = errorHandlingCallback(callback, LOGGER); if (t != null) { errHandlingCallback.onResult(null, t); } else { final SingleResultCallback<Void> releasingCallback = releasingCallback(errHandlingCallback, connection); executeWrappedCommandProtocolAsync(binding, namespace.getDatabaseName(), getCommand(connection.getDescription()), connection, writeConcernErrorTransformer(), new SingleResultCallback<Void>() { @Override public void onResult(final Void result, final Throwable t) { if (t != null && !isNamespaceError(t)) { releasingCallback.onResult(null, t); } else { releasingCallback.onResult(result, null); } } }); } } });
@Override public void call(final AsyncConnection connection, final Throwable t) { SingleResultCallback<Void> errHandlingCallback = errorHandlingCallback(callback, LOGGER); if (t != null) { errHandlingCallback.onResult(null, t); } else { final SingleResultCallback<Void> releasingCallback = releasingCallback(errHandlingCallback, connection); executeWrappedCommandProtocolAsync(binding, namespace.getDatabaseName(), getCommand(connection.getDescription()), connection, writeConcernErrorTransformer(), new SingleResultCallback<Void>() { @Override public void onResult(final Void result, final Throwable t) { if (t != null && !isNamespaceError(t)) { releasingCallback.onResult(null, t); } else { releasingCallback.onResult(result, null); } } }); } } });
@Override public void call(final AsyncConnection connection, final Throwable t) { SingleResultCallback<Void> errHandlingCallback = errorHandlingCallback(callback, LOGGER); if (t != null) { errHandlingCallback.onResult(null, t); } else { SingleResultCallback<Void> wrappedCallback = releasingCallback(errHandlingCallback, connection); if (!serverIsAtLeastVersionThreeDotFour(connection.getDescription())) { wrappedCallback.onResult(null, createExceptionForIncompatibleServerVersion()); } executeWrappedCommandProtocolAsync(binding, databaseName, getCommand(connection.getDescription()), connection, writeConcernErrorTransformer(), wrappedCallback); } } });