io.reactiverse.elasticsearch.client.WatcherClientImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-client Show documentation
Show all versions of elasticsearch-client Show documentation
Reactiverse Elasticsearch client
/*
[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.watcher.DeactivateWatchRequest;
import org.elasticsearch.client.watcher.DeactivateWatchResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.watcher.ActivateWatchRequest;
import org.elasticsearch.client.watcher.ActivateWatchResponse;
import org.elasticsearch.client.watcher.AckWatchRequest;
import org.elasticsearch.client.watcher.AckWatchResponse;
import org.elasticsearch.client.watcher.ExecuteWatchRequest;
import org.elasticsearch.client.watcher.ExecuteWatchResponse;
import org.elasticsearch.client.watcher.GetWatchRequest;
import org.elasticsearch.client.watcher.GetWatchResponse;
import org.elasticsearch.client.watcher.StartWatchServiceRequest;
import org.elasticsearch.client.watcher.StopWatchServiceRequest;
import org.elasticsearch.client.watcher.DeleteWatchRequest;
import org.elasticsearch.client.watcher.DeleteWatchResponse;
import org.elasticsearch.client.watcher.PutWatchRequest;
import org.elasticsearch.client.watcher.PutWatchResponse;
import org.elasticsearch.client.watcher.WatcherStatsRequest;
import org.elasticsearch.client.watcher.WatcherStatsResponse;
import java.io.IOException;
import static java.util.Collections.emptySet;
import static java.util.Collections.singleton;
class WatcherClientImpl implements WatcherClient {
private final Vertx vertx;
private final org.elasticsearch.client.WatcherClient delegate;
WatcherClientImpl(Vertx vertx, org.elasticsearch.client.WatcherClient delegate) {
this.vertx = vertx;
this.delegate = delegate;
}
@Override()
public void startWatchServiceAsync(StartWatchServiceRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.startWatchServiceAsync(request, options, new ActionListener() {
@Override
public void onResponse(AcknowledgedResponse 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 stopWatchServiceAsync(StopWatchServiceRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.stopWatchServiceAsync(request, options, new ActionListener() {
@Override
public void onResponse(AcknowledgedResponse 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 putWatchAsync(PutWatchRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.putWatchAsync(request, options, new ActionListener() {
@Override
public void onResponse(PutWatchResponse 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 getWatchAsync(GetWatchRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.getWatchAsync(request, options, new ActionListener() {
@Override
public void onResponse(GetWatchResponse 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 deactivateWatchAsync(DeactivateWatchRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.deactivateWatchAsync(request, options, new ActionListener() {
@Override
public void onResponse(DeactivateWatchResponse 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 deleteWatchAsync(DeleteWatchRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.deleteWatchAsync(request, options, new ActionListener() {
@Override
public void onResponse(DeleteWatchResponse 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 ackWatchAsync(AckWatchRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.ackWatchAsync(request, options, new ActionListener() {
@Override
public void onResponse(AckWatchResponse 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 activateWatchAsync(ActivateWatchRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.activateWatchAsync(request, options, new ActionListener() {
@Override
public void onResponse(ActivateWatchResponse 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 executeWatchAsync(ExecuteWatchRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.executeWatchAsync(request, options, new ActionListener() {
@Override
public void onResponse(ExecuteWatchResponse 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 watcherStatsAsync(WatcherStatsRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.watcherStatsAsync(request, options, new ActionListener() {
@Override
public void onResponse(WatcherStatsResponse value) {
context.runOnContext(v -> handler.handle(Future.succeededFuture(value)));
}
@Override
public void onFailure(Exception e) {
context.runOnContext(v -> handler.handle(Future.failedFuture(e)));
}
});
}
}