io.reactiverse.elasticsearch.client.SnapshotClientImpl 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.action.admin.cluster.repositories.delete.DeleteRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesRequest;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesResponse;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryResponse;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusRequest;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import java.io.IOException;
import static java.util.Collections.emptySet;
class SnapshotClientImpl implements SnapshotClient {
private final Vertx vertx;
private final org.elasticsearch.client.SnapshotClient delegate;
SnapshotClientImpl(Vertx vertx, org.elasticsearch.client.SnapshotClient delegate) {
this.vertx = vertx;
this.delegate = delegate;
}
@Override()
public void getRepositoryAsync(GetRepositoriesRequest getRepositoriesRequest, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.getRepositoryAsync(getRepositoriesRequest, options, new ActionListener() {
@Override
public void onResponse(GetRepositoriesResponse 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 createRepositoryAsync(PutRepositoryRequest putRepositoryRequest, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.createRepositoryAsync(putRepositoryRequest, 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 deleteRepositoryAsync(DeleteRepositoryRequest deleteRepositoryRequest, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.deleteRepositoryAsync(deleteRepositoryRequest, 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 verifyRepositoryAsync(VerifyRepositoryRequest verifyRepositoryRequest, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.verifyRepositoryAsync(verifyRepositoryRequest, options, new ActionListener() {
@Override
public void onResponse(VerifyRepositoryResponse 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 createAsync(CreateSnapshotRequest createSnapshotRequest, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.createAsync(createSnapshotRequest, options, new ActionListener() {
@Override
public void onResponse(CreateSnapshotResponse 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 getAsync(GetSnapshotsRequest getSnapshotsRequest, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.getAsync(getSnapshotsRequest, options, new ActionListener() {
@Override
public void onResponse(GetSnapshotsResponse 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 statusAsync(SnapshotsStatusRequest snapshotsStatusRequest, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.statusAsync(snapshotsStatusRequest, options, new ActionListener() {
@Override
public void onResponse(SnapshotsStatusResponse 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 restoreAsync(RestoreSnapshotRequest restoreSnapshotRequest, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.restoreAsync(restoreSnapshotRequest, options, new ActionListener() {
@Override
public void onResponse(RestoreSnapshotResponse 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 deleteAsync(DeleteSnapshotRequest deleteSnapshotRequest, RequestOptions options, Handler> handler) {
Context context = vertx.getOrCreateContext();
delegate.deleteAsync(deleteSnapshotRequest, 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)));
}
});
}
}