Package org.apache.pulsar.broker.service
Interface TopicPoliciesService
- All Known Implementing Classes:
SystemTopicBasedTopicPoliciesService,TopicPoliciesService.TopicPoliciesServiceDisabled
@Evolving
public interface TopicPoliciesService
Topic policies service.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddOwnedNamespaceBundleAsync(NamespaceBundle namespaceBundle) Add owned namespace bundle async.deleteTopicPoliciesAsync(org.apache.pulsar.common.naming.TopicName topicName) Delete policies for a topic async.org.apache.pulsar.common.policies.data.TopicPoliciesgetTopicPolicies(org.apache.pulsar.common.naming.TopicName topicName) Get policies for a topic async.org.apache.pulsar.common.policies.data.TopicPoliciesgetTopicPolicies(org.apache.pulsar.common.naming.TopicName topicName, boolean isGlobal) Get global policies for a topic async.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.CompletableFuture<org.apache.pulsar.common.policies.data.TopicPolicies>getTopicPoliciesBypassCacheAsync(org.apache.pulsar.common.naming.TopicName topicName) Get policies for a topic without cache async.org.apache.pulsar.common.policies.data.TopicPoliciesgetTopicPoliciesIfExists(org.apache.pulsar.common.naming.TopicName topicName) Get policies from current cache.voidregisterListener(org.apache.pulsar.common.naming.TopicName topicName, TopicPolicyListener<org.apache.pulsar.common.policies.data.TopicPolicies> listener) removeOwnedNamespaceBundleAsync(NamespaceBundle namespaceBundle) Remove owned namespace bundle async.voidstart()Start the topic policy service.voidunregisterListener(org.apache.pulsar.common.naming.TopicName topicName, TopicPolicyListener<org.apache.pulsar.common.policies.data.TopicPolicies> listener) updateTopicPoliciesAsync(org.apache.pulsar.common.naming.TopicName topicName, org.apache.pulsar.common.policies.data.TopicPolicies policies) Update policies for a topic async.
-
Field Details
-
DISABLED
-
DEFAULT_GET_TOPIC_POLICY_TIMEOUT
static final long DEFAULT_GET_TOPIC_POLICY_TIMEOUT- See Also:
-
-
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 namepolicies- 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 namebackoff- back off policyisGlobal- 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
Add owned namespace bundle async.- Parameters:
namespaceBundle- namespace bundle
-
removeOwnedNamespaceBundleAsync
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)
-