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

io.reactiverse.elasticsearch.client.reactivex.ClusterClient Maven / Gradle / Ivy

There is a newer version: 0.9.0-ec7.10.1
Show newest version
/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package io.reactiverse.elasticsearch.client.reactivex;

import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.Completable;
import io.reactivex.Maybe;
import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
import org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsRequest;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import io.vertx.core.AsyncResult;
import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse;
import io.vertx.core.Handler;
import org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsResponse;


@io.vertx.lang.rx.RxGen(io.reactiverse.elasticsearch.client.ClusterClient.class)
public class ClusterClient {

  @Override
  public String toString() {
    return delegate.toString();
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    ClusterClient that = (ClusterClient) o;
    return delegate.equals(that.delegate);
  }
  
  @Override
  public int hashCode() {
    return delegate.hashCode();
  }

  public static final io.vertx.lang.rx.TypeArg __TYPE_ARG = new io.vertx.lang.rx.TypeArg<>(    obj -> new ClusterClient((io.reactiverse.elasticsearch.client.ClusterClient) obj),
    ClusterClient::getDelegate
  );

  private final io.reactiverse.elasticsearch.client.ClusterClient delegate;
  
  public ClusterClient(io.reactiverse.elasticsearch.client.ClusterClient delegate) {
    this.delegate = delegate;
  }

  public io.reactiverse.elasticsearch.client.ClusterClient getDelegate() {
    return delegate;
  }

  public void putSettingsAsync(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options, Handler> handler) { 
    delegate.putSettingsAsync(clusterUpdateSettingsRequest, options, handler);
  }

  public Single rxPutSettingsAsync(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options) { 
    return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
      putSettingsAsync(clusterUpdateSettingsRequest, options, handler);
    });
  }

  public void getSettingsAsync(ClusterGetSettingsRequest clusterGetSettingsRequest, RequestOptions options, Handler> handler) { 
    delegate.getSettingsAsync(clusterGetSettingsRequest, options, handler);
  }

  public Single rxGetSettingsAsync(ClusterGetSettingsRequest clusterGetSettingsRequest, RequestOptions options) { 
    return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
      getSettingsAsync(clusterGetSettingsRequest, options, handler);
    });
  }

  public void healthAsync(ClusterHealthRequest healthRequest, RequestOptions options, Handler> handler) { 
    delegate.healthAsync(healthRequest, options, handler);
  }

  public Single rxHealthAsync(ClusterHealthRequest healthRequest, RequestOptions options) { 
    return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
      healthAsync(healthRequest, options, handler);
    });
  }


  public static  ClusterClient newInstance(io.reactiverse.elasticsearch.client.ClusterClient arg) {
    return arg != null ? new ClusterClient(arg) : null;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy