Interface TopicPoliciesService

All Known Implementing Classes:
SystemTopicBasedTopicPoliciesService, TopicPoliciesService.TopicPoliciesServiceDisabled

@Evolving public interface TopicPoliciesService
Topic policies service.
  • Field Details

  • Method Details

    • deleteTopicPoliciesAsync

      CompletableFuture<Void> deleteTopicPoliciesAsync(org.apache.pulsar.common.naming.TopicName topicName)
      Delete policies for a topic async.
      Parameters:
      topicName - topic name
    • updateTopicPoliciesAsync

      CompletableFuture<Void> updateTopicPoliciesAsync(org.apache.pulsar.common.naming.TopicName topicName, org.apache.pulsar.common.policies.data.TopicPolicies policies)
      Update policies for a topic async.
      Parameters:
      topicName - topic name
      policies - policies for the topic name
    • getTopicPolicies

      org.apache.pulsar.common.policies.data.TopicPolicies getTopicPolicies(org.apache.pulsar.common.naming.TopicName topicName) throws BrokerServiceException.TopicPoliciesCacheNotInitException
      Get policies for a topic async.
      Parameters:
      topicName - topic name
      Returns:
      future of the topic policies
      Throws:
      BrokerServiceException.TopicPoliciesCacheNotInitException
    • getTopicPoliciesIfExists

      org.apache.pulsar.common.policies.data.TopicPolicies getTopicPoliciesIfExists(org.apache.pulsar.common.naming.TopicName topicName)
      Get policies from current cache.
      Parameters:
      topicName - topic name
      Returns:
      the topic policies
    • getTopicPolicies

      org.apache.pulsar.common.policies.data.TopicPolicies getTopicPolicies(org.apache.pulsar.common.naming.TopicName topicName, boolean isGlobal) throws BrokerServiceException.TopicPoliciesCacheNotInitException
      Get global policies for a topic async.
      Parameters:
      topicName - topic name
      Returns:
      future of the topic policies
      Throws:
      BrokerServiceException.TopicPoliciesCacheNotInitException
    • getTopicPoliciesAsyncWithRetry

      default CompletableFuture<Optional<org.apache.pulsar.common.policies.data.TopicPolicies>> getTopicPoliciesAsyncWithRetry(org.apache.pulsar.common.naming.TopicName topicName, org.apache.pulsar.client.impl.Backoff backoff, ScheduledExecutorService scheduledExecutorService, boolean isGlobal)
      When getting TopicPolicies, if the initialization has not been completed, we will go back off and try again until time out.
      Parameters:
      topicName - topic name
      backoff - back off policy
      isGlobal - is global policies
      Returns:
      CompletableFuture<Optional<TopicPolicies>>
    • getTopicPoliciesBypassCacheAsync

      CompletableFuture<org.apache.pulsar.common.policies.data.TopicPolicies> getTopicPoliciesBypassCacheAsync(org.apache.pulsar.common.naming.TopicName topicName)
      Get policies for a topic without cache async.
      Parameters:
      topicName - topic name
      Returns:
      future of the topic policies
    • addOwnedNamespaceBundleAsync

      CompletableFuture<Void> addOwnedNamespaceBundleAsync(NamespaceBundle namespaceBundle)
      Add owned namespace bundle async.
      Parameters:
      namespaceBundle - namespace bundle
    • removeOwnedNamespaceBundleAsync

      CompletableFuture<Void> removeOwnedNamespaceBundleAsync(NamespaceBundle namespaceBundle)
      Remove owned namespace bundle async.
      Parameters:
      namespaceBundle - namespace bundle
    • start

      void start()
      Start the topic policy service.
    • registerListener

      void registerListener(org.apache.pulsar.common.naming.TopicName topicName, TopicPolicyListener<org.apache.pulsar.common.policies.data.TopicPolicies> listener)
    • unregisterListener

      void unregisterListener(org.apache.pulsar.common.naming.TopicName topicName, TopicPolicyListener<org.apache.pulsar.common.policies.data.TopicPolicies> listener)