io.reactiverse.elasticsearch.client.IndexLifecycleClientImpl 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.core.AcknowledgedResponse;
import org.elasticsearch.client.indexlifecycle.DeleteLifecyclePolicyRequest;
import org.elasticsearch.client.indexlifecycle.ExplainLifecycleRequest;
import org.elasticsearch.client.indexlifecycle.ExplainLifecycleResponse;
import org.elasticsearch.client.indexlifecycle.GetLifecyclePolicyRequest;
import org.elasticsearch.client.indexlifecycle.GetLifecyclePolicyResponse;
import org.elasticsearch.client.indexlifecycle.LifecycleManagementStatusRequest;
import org.elasticsearch.client.indexlifecycle.LifecycleManagementStatusResponse;
import org.elasticsearch.client.indexlifecycle.PutLifecyclePolicyRequest;
import org.elasticsearch.client.indexlifecycle.RemoveIndexLifecyclePolicyRequest;
import org.elasticsearch.client.indexlifecycle.RemoveIndexLifecyclePolicyResponse;
import org.elasticsearch.client.indexlifecycle.RetryLifecyclePolicyRequest;
import org.elasticsearch.client.indexlifecycle.StartILMRequest;
import org.elasticsearch.client.indexlifecycle.StopILMRequest;
import java.io.IOException;
import static java.util.Collections.emptySet;
class IndexLifecycleClientImpl implements IndexLifecycleClient {
private final Vertx vertx;
private final org.elasticsearch.client.IndexLifecycleClient delegate;
IndexLifecycleClientImpl(Vertx vertx, org.elasticsearch.client.IndexLifecycleClient delegate) {
this.vertx = vertx;
this.delegate = delegate;
}
@Override()
public void getLifecyclePolicyAsync(GetLifecyclePolicyRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.getLifecyclePolicyAsync(request, options, new ActionListener() {
@Override
public void onResponse(GetLifecyclePolicyResponse 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 putLifecyclePolicyAsync(PutLifecyclePolicyRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.putLifecyclePolicyAsync(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 deleteLifecyclePolicyAsync(DeleteLifecyclePolicyRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.deleteLifecyclePolicyAsync(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 removeIndexLifecyclePolicyAsync(RemoveIndexLifecyclePolicyRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.removeIndexLifecyclePolicyAsync(request, options, new ActionListener() {
@Override
public void onResponse(RemoveIndexLifecyclePolicyResponse 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 startILMAsync(StartILMRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.startILMAsync(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 lifecycleManagementStatusAsync(LifecycleManagementStatusRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.lifecycleManagementStatusAsync(request, options, new ActionListener() {
@Override
public void onResponse(LifecycleManagementStatusResponse 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 stopILMAsync(StopILMRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.stopILMAsync(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 explainLifecycleAsync(ExplainLifecycleRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.explainLifecycleAsync(request, options, new ActionListener() {
@Override
public void onResponse(ExplainLifecycleResponse 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 retryLifecyclePolicyAsync(RetryLifecyclePolicyRequest request, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.retryLifecyclePolicyAsync(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)));
}
});
}
}