use of com.mongodb.internal.validator.NoOpFieldNameValidator in project mongo-java-driver by mongodb.
the class CommandOperationHelper method executeCommandAsync.
/* Async Write Binding Helpers */
static <T> void executeCommandAsync(final AsyncWriteBinding binding, final String database, final BsonDocument command, final AsyncConnection connection, final CommandWriteTransformerAsync<BsonDocument, T> transformer, final SingleResultCallback<T> callback) {
notNull("binding", binding);
SingleResultCallback<T> addingRetryableLabelCallback = addingRetryableLabelCallback(callback, connection.getDescription().getMaxWireVersion());
connection.commandAsync(database, command, new NoOpFieldNameValidator(), primary(), new BsonDocumentCodec(), binding.getSessionContext(), binding.getServerApi(), binding.getRequestContext(), transformingWriteCallback(transformer, connection, addingRetryableLabelCallback));
}
use of com.mongodb.internal.validator.NoOpFieldNameValidator in project mongo-java-driver by mongodb.
the class CommandOperationHelper method createReadCommandAndExecuteAsync.
static <D, T> void createReadCommandAndExecuteAsync(final RetryState retryState, final AsyncReadBinding binding, final AsyncConnectionSource source, final String database, final CommandCreator commandCreator, final Decoder<D> decoder, final CommandReadTransformerAsync<D, T> transformer, final AsyncConnection connection, final SingleResultCallback<T> callback) {
BsonDocument command;
try {
command = commandCreator.create(source.getServerDescription(), connection.getDescription());
retryState.attach(AttachmentKeys.commandDescriptionSupplier(), command::getFirstKey, false);
logRetryExecute(retryState);
} catch (IllegalArgumentException e) {
callback.onResult(null, e);
return;
}
connection.commandAsync(database, command, new NoOpFieldNameValidator(), source.getReadPreference(), decoder, binding.getSessionContext(), binding.getServerApi(), binding.getRequestContext(), transformingReadCallback(transformer, source, connection, callback));
}
use of com.mongodb.internal.validator.NoOpFieldNameValidator in project mongo-java-driver by mongodb.
the class FindAndUpdateOperation method getFieldNameValidator.
@Override
protected FieldNameValidator getFieldNameValidator() {
Map<String, FieldNameValidator> map = new HashMap<String, FieldNameValidator>();
map.put("update", new UpdateFieldNameValidator());
return new MappedFieldNameValidator(new NoOpFieldNameValidator(), map);
}
use of com.mongodb.internal.validator.NoOpFieldNameValidator in project mongo-java-driver by mongodb.
the class FindAndReplaceOperation method getFieldNameValidator.
@Override
protected FieldNameValidator getFieldNameValidator() {
Map<String, FieldNameValidator> map = new HashMap<String, FieldNameValidator>();
map.put("update", new ReplacingDocumentFieldNameValidator());
return new MappedFieldNameValidator(new NoOpFieldNameValidator(), map);
}
Aggregations