Package org.apache.pulsar.broker.service
Interface TopicPoliciesService
-
- All Known Implementing Classes:
SystemTopicBasedTopicPoliciesService,TopicPoliciesService.TopicPoliciesServiceDisabled
public interface TopicPoliciesServiceTopic policies service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTopicPoliciesService.TopicPoliciesServiceDisabled
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_GET_TOPIC_POLICY_TIMEOUTstatic TopicPoliciesServiceDISABLED
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.Void>addOwnedNamespaceBundleAsync(NamespaceBundle namespaceBundle)Add owned namespace bundle async.default voidclean(org.apache.pulsar.common.naming.TopicName topicName)clean cache and listeners in TopicPolicies and so on.java.util.concurrent.CompletableFuture<java.lang.Void>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.default java.util.concurrent.CompletableFuture<java.util.Optional<org.apache.pulsar.common.policies.data.TopicPolicies>>getTopicPoliciesAsyncWithRetry(org.apache.pulsar.common.naming.TopicName topicName, org.apache.pulsar.client.impl.Backoff backoff, java.util.concurrent.ScheduledExecutorService scheduledExecutorService)When getting TopicPolicies, if the initialization has not been completed, we will go back off and try again until time out.java.util.concurrent.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)java.util.concurrent.CompletableFuture<java.lang.Void>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)java.util.concurrent.CompletableFuture<java.lang.Void>updateTopicPoliciesAsync(org.apache.pulsar.common.naming.TopicName topicName, org.apache.pulsar.common.policies.data.TopicPolicies policies)Update policies for a topic async.
-
-
-
Field Detail
-
DISABLED
static final TopicPoliciesService DISABLED
-
DEFAULT_GET_TOPIC_POLICY_TIMEOUT
static final long DEFAULT_GET_TOPIC_POLICY_TIMEOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
deleteTopicPoliciesAsync
java.util.concurrent.CompletableFuture<java.lang.Void> deleteTopicPoliciesAsync(org.apache.pulsar.common.naming.TopicName topicName)
Delete policies for a topic async.- Parameters:
topicName- topic name
-
updateTopicPoliciesAsync
java.util.concurrent.CompletableFuture<java.lang.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.TopicPoliciesCacheNotInitExceptionGet 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
-
getTopicPoliciesAsyncWithRetry
default java.util.concurrent.CompletableFuture<java.util.Optional<org.apache.pulsar.common.policies.data.TopicPolicies>> getTopicPoliciesAsyncWithRetry(org.apache.pulsar.common.naming.TopicName topicName, org.apache.pulsar.client.impl.Backoff backoff, java.util.concurrent.ScheduledExecutorService scheduledExecutorService)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 policy- Returns:
- CompletableFuture
>
-
getTopicPoliciesBypassCacheAsync
java.util.concurrent.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
java.util.concurrent.CompletableFuture<java.lang.Void> addOwnedNamespaceBundleAsync(NamespaceBundle namespaceBundle)
Add owned namespace bundle async.- Parameters:
namespaceBundle- namespace bundle
-
removeOwnedNamespaceBundleAsync
java.util.concurrent.CompletableFuture<java.lang.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)
-
clean
default void clean(org.apache.pulsar.common.naming.TopicName topicName)
clean cache and listeners in TopicPolicies and so on.- Parameters:
topicName-
-
-