io.reactiverse.elasticsearch.client.EqlClientImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-client-rxjava2 Show documentation
Show all versions of elasticsearch-client-rxjava2 Show documentation
Reactiverse Elasticsearch client :: RxJava2 bindings
The newest version!
/*
[NOTE] This is an automatically generated file.
Do not make changes to this file but to the shim code generator.
*/
package io.reactiverse.elasticsearch.client;
import io.vertx.core.*;
import org.elasticsearch.client.*;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.client.eql.EqlSearchRequest;
import org.elasticsearch.client.eql.EqlSearchResponse;
import org.elasticsearch.client.eql.EqlStatsRequest;
import org.elasticsearch.client.eql.EqlStatsResponse;
import java.io.IOException;
import java.util.Collections;
class EqlClientImpl implements EqlClient {
private final Vertx vertx;
private final org.elasticsearch.client.EqlClient delegate;
EqlClientImpl(Vertx vertx, org.elasticsearch.client.EqlClient delegate) {
this.vertx = vertx;
this.delegate = delegate;
}
@Override()
public void searchAsync(EqlSearchRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.searchAsync(request, options, new ActionListener() {
@Override
public void onResponse(EqlSearchResponse value) {
context.runOnContext(v -> handler.handle(Future.succeededFuture(value)));
}
@Override
public void onFailure(Exception e) {
context.runOnContext(v -> handler.handle(Future.failedFuture(e)));
}
});
}
@Override()
public void statsAsync(EqlStatsRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.statsAsync(request, options, new ActionListener() {
@Override
public void onResponse(EqlStatsResponse value) {
context.runOnContext(v -> handler.handle(Future.succeededFuture(value)));
}
@Override
public void onFailure(Exception e) {
context.runOnContext(v -> handler.handle(Future.failedFuture(e)));
}
});
}
}