Class BaseResource

java.lang.Object
org.apache.pulsar.client.admin.internal.BaseResource
Direct Known Subclasses:
BookiesImpl, BrokersImpl, BrokerStatsImpl, ClustersImpl, ComponentResource, LookupImpl, NamespacesImpl, NonPersistentTopicsImpl, ProxyStatsImpl, ResourceGroupsImpl, ResourceQuotasImpl, SchemasImpl, TenantsImpl, TopicPoliciesImpl, TopicsImpl, TransactionsImpl, WorkerImpl

public abstract class BaseResource extends Object
Abstract base class for all admin resources.
  • Field Details

    • auth

      protected final org.apache.pulsar.client.api.Authentication auth
    • readTimeoutMs

      protected final long readTimeoutMs
  • Constructor Details

    • BaseResource

      protected BaseResource(org.apache.pulsar.client.api.Authentication auth, long readTimeoutMs)
  • Method Details

    • request

      public javax.ws.rs.client.Invocation.Builder request(javax.ws.rs.client.WebTarget target) throws PulsarAdminException
      Throws:
      PulsarAdminException
    • requestAsync

      public CompletableFuture<javax.ws.rs.client.Invocation.Builder> requestAsync(javax.ws.rs.client.WebTarget target)
    • asyncPutRequest

      public <T> CompletableFuture<Void> asyncPutRequest(javax.ws.rs.client.WebTarget target, javax.ws.rs.client.Entity<T> entity)
    • asyncPostRequestWithResponse

      public <T, R> void asyncPostRequestWithResponse(javax.ws.rs.client.WebTarget target, javax.ws.rs.client.Entity<T> entity, javax.ws.rs.client.InvocationCallback<R> callback)
    • asyncPostRequest

      public <T> CompletableFuture<Void> asyncPostRequest(javax.ws.rs.client.WebTarget target, javax.ws.rs.client.Entity<T> entity)
    • asyncGetRequest

      public <T> void asyncGetRequest(javax.ws.rs.client.WebTarget target, javax.ws.rs.client.InvocationCallback<T> callback)
    • asyncGetRequest

      public <T> CompletableFuture<T> asyncGetRequest(javax.ws.rs.client.WebTarget target, org.apache.pulsar.client.admin.internal.BaseResource.FutureCallback<T> callback)
    • asyncGetRequest

      protected <T> CompletableFuture<T> asyncGetRequest(javax.ws.rs.client.WebTarget target, Class<? extends T> type)
    • asyncGetRequest

      protected <T> CompletableFuture<T> asyncGetRequest(javax.ws.rs.client.WebTarget target, javax.ws.rs.core.GenericType<T> type)
    • asyncDeleteRequest

      public CompletableFuture<Void> asyncDeleteRequest(javax.ws.rs.client.WebTarget target)
    • asyncDeleteRequest

      public <T> void asyncDeleteRequest(javax.ws.rs.client.WebTarget target, javax.ws.rs.client.InvocationCallback<T> callback)
    • getApiException

      public static PulsarAdminException getApiException(Throwable e)
    • getApiException

      public PulsarAdminException getApiException(javax.ws.rs.core.Response response)
    • getReasonFromServer

      public static String getReasonFromServer(javax.ws.rs.WebApplicationException e)
    • sync

      protected <T> T sync(Supplier<CompletableFuture<T>> executor) throws PulsarAdminException
      Throws:
      PulsarAdminException