Class ClusterApiClient


@Public
@Experimental
public class ClusterApiClient
extends AbstractClusterApiClient<RestBuilder>
An utility class to execute generic HTTP calls synchronously on a cluster's REST API.
Since:
2.3.2
Author:
Simon Baslé
  • Constructor Details

    • ClusterApiClient

      public ClusterApiClient​(String username, String password, ClusterFacade core, long defaultTimeout, TimeUnit defaultTimeUnit)
      Build a new ClusterApiClient to work with a given ClusterFacade.
      Parameters:
      username - the login to use for REST api calls (eg. administrative username).
      password - the password associated with the username.
      core - the ClusterFacade through which to send requests.
      defaultTimeout - the default timeout duration to use when executing requests.
      defaultTimeUnit - the time unit for the timeout.
  • Method Details

    • createBuilder

      protected RestBuilder createBuilder​(com.couchbase.client.deps.io.netty.handler.codec.http.HttpMethod method, String fullPath)
      Description copied from class: AbstractClusterApiClient
      Create the concrete builders returned by concrete implementations. Builders will be either capable of synchronous or asynchronous execution, depending on type T.
      Specified by:
      createBuilder in class AbstractClusterApiClient<RestBuilder>
    • defaultTimeout

      public long defaultTimeout()
      Returns:
      the default timeout duration used when executing requests that don't specify a timeout.
    • defaultTimeUnit

      public TimeUnit defaultTimeUnit()
      Returns:
      the default time unit used when executing requests that don't specify a timeout.