Package org.apache.pulsar.broker.service
Interface TopicPoliciesService
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
SystemTopicBasedTopicPoliciesService,TopicPoliciesService.TopicPoliciesServiceDisabled
Topic policies service.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Close the resources if necessary.deleteTopicPoliciesAsync(org.apache.pulsar.common.naming.TopicName topicName) Delete policies for a topic asynchronously.CompletableFuture<Optional<org.apache.pulsar.common.policies.data.TopicPolicies>>getTopicPoliciesAsync(org.apache.pulsar.common.naming.TopicName topicName, TopicPoliciesService.GetType type) Retrieve the topic policies.booleanregisterListener(org.apache.pulsar.common.naming.TopicName topicName, TopicPolicyListener listener) Registers a listener for topic policies updates.default voidstart(PulsarService pulsar) Start the topic policy service.voidunregisterListener(org.apache.pulsar.common.naming.TopicName topicName, TopicPolicyListener listener) Unregister the topic policies listener.updateTopicPoliciesAsync(org.apache.pulsar.common.naming.TopicName topicName, org.apache.pulsar.common.policies.data.TopicPolicies policies) Update policies for a topic asynchronously.
-
Field Details
-
DISABLED
-
-
Method Details
-
deleteTopicPoliciesAsync
CompletableFuture<Void> deleteTopicPoliciesAsync(org.apache.pulsar.common.naming.TopicName topicName) Delete policies for a topic asynchronously.- 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 asynchronously.- Parameters:
topicName- topic namepolicies- policies for the topic name
-
getTopicPoliciesAsync
CompletableFuture<Optional<org.apache.pulsar.common.policies.data.TopicPolicies>> getTopicPoliciesAsync(org.apache.pulsar.common.naming.TopicName topicName, TopicPoliciesService.GetType type) Retrieve the topic policies. -
start
Start the topic policy service. -
close
Close the resources if necessary.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
registerListener
boolean registerListener(org.apache.pulsar.common.naming.TopicName topicName, TopicPolicyListener listener) Registers a listener for topic policies updates.The listener will receive the latest topic policies when they are updated. If the policies are removed, the listener will receive a null value. Note that not every update is guaranteed to trigger the listener. For instance, if the policies change from A -> B -> null -> C in quick succession, only the final state (C) is guaranteed to be received by the listener. In summary, the listener is guaranteed to receive only the latest value.
- Returns:
- true if the listener is registered successfully
-
unregisterListener
void unregisterListener(org.apache.pulsar.common.naming.TopicName topicName, TopicPolicyListener listener) Unregister the topic policies listener.
-