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

io.reactiverse.elasticsearch.client.RollupClientImpl 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.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.core.AcknowledgedResponse;
import org.elasticsearch.client.rollup.DeleteRollupJobRequest;
import org.elasticsearch.client.rollup.GetRollupIndexCapsRequest;
import org.elasticsearch.client.rollup.GetRollupIndexCapsResponse;
import org.elasticsearch.client.rollup.GetRollupJobRequest;
import org.elasticsearch.client.rollup.GetRollupJobResponse;
import org.elasticsearch.client.rollup.GetRollupCapsRequest;
import org.elasticsearch.client.rollup.GetRollupCapsResponse;
import org.elasticsearch.client.rollup.PutRollupJobRequest;
import org.elasticsearch.client.rollup.StartRollupJobRequest;
import org.elasticsearch.client.rollup.StartRollupJobResponse;
import org.elasticsearch.client.rollup.StopRollupJobRequest;
import org.elasticsearch.client.rollup.StopRollupJobResponse;
import java.io.IOException;
import java.util.Collections;

class RollupClientImpl implements RollupClient {

    private final Vertx vertx;

    private final org.elasticsearch.client.RollupClient delegate;

    RollupClientImpl(Vertx vertx, org.elasticsearch.client.RollupClient delegate) {
        this.vertx = vertx;
        this.delegate = delegate;
    }

    @Override()
    public void putRollupJobAsync(PutRollupJobRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.putRollupJobAsync(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 startRollupJobAsync(StartRollupJobRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.startRollupJobAsync(request, options, new ActionListener() {

            @Override
            public void onResponse(StartRollupJobResponse 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 stopRollupJobAsync(StopRollupJobRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.stopRollupJobAsync(request, options, new ActionListener() {

            @Override
            public void onResponse(StopRollupJobResponse 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 deleteRollupJobAsync(DeleteRollupJobRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.deleteRollupJobAsync(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 getRollupJobAsync(GetRollupJobRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.getRollupJobAsync(request, options, new ActionListener() {

            @Override
            public void onResponse(GetRollupJobResponse 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 searchAsync(SearchRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.searchAsync(request, options, new ActionListener() {

            @Override
            public void onResponse(SearchResponse 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 getRollupCapabilitiesAsync(GetRollupCapsRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.getRollupCapabilitiesAsync(request, options, new ActionListener() {

            @Override
            public void onResponse(GetRollupCapsResponse 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 getRollupIndexCapabilitiesAsync(GetRollupIndexCapsRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.getRollupIndexCapabilitiesAsync(request, options, new ActionListener() {

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