@Override public Void call(final Connection connection) { try { validateIndexRequestCollations(connection, requests); executeWrappedCommandProtocol(binding, namespace.getDatabaseName(), getCommand(connection.getDescription()), connection, writeConcernErrorTransformer()); } catch (MongoCommandException e) { throw checkForDuplicateKeyError(e); } return 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> wrappedCallback = releasingCallback(errHandlingCallback, connection); validateIndexRequestCollations(connection, requests, new AsyncCallableWithConnection() { @Override public void call(final AsyncConnection connection, final Throwable t) { if (t != null) { wrappedCallback.onResult(null, t); } else { executeWrappedCommandProtocolAsync(binding, namespace.getDatabaseName(), getCommand(connection.getDescription()), connection, writeConcernErrorTransformer(), new SingleResultCallback<Void>() { @Override public void onResult(final Void result, final Throwable t) { wrappedCallback.onResult(null, translateException(t)); } }); } } }); } } });
@Override public Void call(final Connection connection) { try { validateIndexRequestCollations(connection, requests); executeWrappedCommandProtocol(binding, namespace.getDatabaseName(), getCommand(connection.getDescription()), connection, writeConcernErrorTransformer()); } catch (MongoCommandException e) { throw checkForDuplicateKeyError(e); } return 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> wrappedCallback = releasingCallback(errHandlingCallback, connection); validateIndexRequestCollations(connection, requests, new AsyncCallableWithConnection() { @Override public void call(final AsyncConnection connection, final Throwable t) { if (t != null) { wrappedCallback.onResult(null, t); } else { executeWrappedCommandProtocolAsync(binding, namespace.getDatabaseName(), getCommand(connection.getDescription()), connection, writeConcernErrorTransformer(), new SingleResultCallback<Void>() { @Override public void onResult(final Void result, final Throwable t) { wrappedCallback.onResult(null, translateException(t)); } }); } } }); } } });