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

io.reactiverse.elasticsearch.client.CcrClientImpl 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.client.ccr.CcrStatsRequest;
import org.elasticsearch.client.ccr.CcrStatsResponse;
import org.elasticsearch.client.ccr.DeleteAutoFollowPatternRequest;
import org.elasticsearch.client.ccr.FollowInfoRequest;
import org.elasticsearch.client.ccr.FollowInfoResponse;
import org.elasticsearch.client.ccr.FollowStatsRequest;
import org.elasticsearch.client.ccr.FollowStatsResponse;
import org.elasticsearch.client.ccr.ForgetFollowerRequest;
import org.elasticsearch.client.ccr.GetAutoFollowPatternRequest;
import org.elasticsearch.client.ccr.GetAutoFollowPatternResponse;
import org.elasticsearch.client.ccr.PauseFollowRequest;
import org.elasticsearch.client.ccr.PutAutoFollowPatternRequest;
import org.elasticsearch.client.ccr.PutFollowRequest;
import org.elasticsearch.client.ccr.PutFollowResponse;
import org.elasticsearch.client.ccr.ResumeFollowRequest;
import org.elasticsearch.client.ccr.UnfollowRequest;
import org.elasticsearch.client.core.AcknowledgedResponse;
import org.elasticsearch.client.core.BroadcastResponse;
import java.io.IOException;
import java.util.Collections;

class CcrClientImpl implements CcrClient {

    private final Vertx vertx;

    private final org.elasticsearch.client.CcrClient delegate;

    CcrClientImpl(Vertx vertx, org.elasticsearch.client.CcrClient delegate) {
        this.vertx = vertx;
        this.delegate = delegate;
    }

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

            @Override
            public void onResponse(PutFollowResponse 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 pauseFollowAsync(PauseFollowRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.pauseFollowAsync(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 resumeFollowAsync(ResumeFollowRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.resumeFollowAsync(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 unfollowAsync(UnfollowRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.unfollowAsync(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 forgetFollowerAsync(final ForgetFollowerRequest request, final RequestOptions options, final Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.forgetFollowerAsync(request, options, new ActionListener() {

            @Override
            public void onResponse(BroadcastResponse 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 putAutoFollowPatternAsync(PutAutoFollowPatternRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.putAutoFollowPatternAsync(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 deleteAutoFollowPatternAsync(DeleteAutoFollowPatternRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.deleteAutoFollowPatternAsync(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 getAutoFollowPatternAsync(GetAutoFollowPatternRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.getAutoFollowPatternAsync(request, options, new ActionListener() {

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

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

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

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