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

io.reactiverse.elasticsearch.client.XPackClientImpl 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.xpack.XPackInfoRequest;
import org.elasticsearch.client.xpack.XPackInfoResponse;
import org.elasticsearch.client.xpack.XPackUsageRequest;
import org.elasticsearch.client.xpack.XPackUsageResponse;
import java.io.IOException;
import static java.util.Collections.emptySet;

class XPackClientImpl implements XPackClient {

    private final Vertx vertx;

    private final org.elasticsearch.client.XPackClient delegate;

    XPackClientImpl(Vertx vertx, org.elasticsearch.client.XPackClient delegate) {
        this.vertx = vertx;
        this.delegate = delegate;
    }

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

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

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