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

io.reactiverse.elasticsearch.client.TransformClientImpl 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.client.core.AcknowledgedResponse;
import org.elasticsearch.client.transform.DeleteTransformRequest;
import org.elasticsearch.client.transform.GetTransformRequest;
import org.elasticsearch.client.transform.GetTransformResponse;
import org.elasticsearch.client.transform.GetTransformStatsRequest;
import org.elasticsearch.client.transform.GetTransformStatsResponse;
import org.elasticsearch.client.transform.PreviewTransformRequest;
import org.elasticsearch.client.transform.PreviewTransformResponse;
import org.elasticsearch.client.transform.PutTransformRequest;
import org.elasticsearch.client.transform.StartTransformRequest;
import org.elasticsearch.client.transform.StartTransformResponse;
import org.elasticsearch.client.transform.StopTransformRequest;
import org.elasticsearch.client.transform.StopTransformResponse;
import org.elasticsearch.client.transform.UpdateTransformRequest;
import org.elasticsearch.client.transform.UpdateTransformResponse;
import java.io.IOException;
import java.util.Collections;

class TransformClientImpl implements TransformClient {

    private final Vertx vertx;

    private final org.elasticsearch.client.TransformClient delegate;

    TransformClientImpl(Vertx vertx, org.elasticsearch.client.TransformClient delegate) {
        this.vertx = vertx;
        this.delegate = delegate;
    }

    @Override()
    public void putTransformAsync(PutTransformRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.putTransformAsync(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 updateTransformAsync(UpdateTransformRequest request, RequestOptions options, Handler> handler) {
        Context context = vertx.getOrCreateContext();
        delegate.updateTransformAsync(request, options, new ActionListener() {

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

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

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

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

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

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