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

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

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.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.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.cluster.RemoteInfoRequest;
import org.elasticsearch.client.cluster.RemoteInfoResponse;
import org.elasticsearch.client.indices.ComponentTemplatesExistRequest;
import org.elasticsearch.client.indices.DeleteComponentTemplateRequest;
import org.elasticsearch.client.indices.GetComponentTemplatesRequest;
import org.elasticsearch.client.indices.GetComponentTemplatesResponse;
import org.elasticsearch.client.indices.PutComponentTemplateRequest;
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)));
            }
        });
    }

    @Override()
    public void remoteInfoAsync(RemoteInfoRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.remoteInfoAsync(request, options, new ActionListener() {

            @Override
            public void onResponse(RemoteInfoResponse 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 deleteComponentTemplateAsync(DeleteComponentTemplateRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.deleteComponentTemplateAsync(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 putComponentTemplateAsync(PutComponentTemplateRequest putComponentTemplateRequest, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.putComponentTemplateAsync(putComponentTemplateRequest, 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 getComponentTemplateAsync(GetComponentTemplatesRequest getComponentTemplatesRequest, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.getComponentTemplateAsync(getComponentTemplatesRequest, options, new ActionListener() {

            @Override
            public void onResponse(GetComponentTemplatesResponse 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 existsComponentTemplateAsync(ComponentTemplatesExistRequest componentTemplatesRequest, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.existsComponentTemplateAsync(componentTemplatesRequest, options, new ActionListener() {

            @Override
            public void onResponse(Boolean 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