All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.reactiverse.elasticsearch.client.ClusterClientImpl Maven / Gradle / Ivy

There is a newer version: 0.9.0-ec7.10.1
Show 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.action.admin.cluster.health.ClusterHealthRequest;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsRequest;
import org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsResponse;
import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest;
import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse;
import org.elasticsearch.rest.RestStatus;
import java.io.IOException;
import static java.util.Collections.emptySet;
import static java.util.Collections.singleton;

class ClusterClientImpl implements ClusterClient {

    private final Vertx vertx;

    private final org.elasticsearch.client.ClusterClient delegate;

    ClusterClientImpl(Vertx vertx, org.elasticsearch.client.ClusterClient delegate) {
        this.vertx = vertx;
        this.delegate = delegate;
    }

    @Override()
    public void putSettingsAsync(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.putSettingsAsync(clusterUpdateSettingsRequest, options, new ActionListener() {

            @Override
            public void onResponse(ClusterUpdateSettingsResponse 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 getSettingsAsync(ClusterGetSettingsRequest clusterGetSettingsRequest, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.getSettingsAsync(clusterGetSettingsRequest, options, new ActionListener() {

            @Override
            public void onResponse(ClusterGetSettingsResponse 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 healthAsync(ClusterHealthRequest healthRequest, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.healthAsync(healthRequest, options, new ActionListener() {

            @Override
            public void onResponse(ClusterHealthResponse value) {
                context.runOnContext(v -> handler.handle(Future.succeededFuture(value)));
            }

            @Override
            public void onFailure(Exception e) {
                context.runOnContext(v -> handler.handle(Future.failedFuture(e)));
            }
        });
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy