Interface DittoProtocolSub
- All Superinterfaces:
akka.actor.Extension
public interface DittoProtocolSub
extends akka.actor.Extension
Subscriptions for Ditto protocol channels.
-
Method Summary
Modifier and TypeMethodDescriptiondeclareAcknowledgementLabels(Collection<org.eclipse.ditto.base.model.acks.AcknowledgementLabel> acknowledgementLabels, akka.actor.ActorRef subscriber, String group) Declare acknowledgement labels for a subscriber.static DittoProtocolSubget(akka.actor.ActorSystem system) Get theDittoProtocolSubfor an actor system.voidremoveAcknowledgementLabelDeclaration(akka.actor.ActorRef subscriber) Relinquish any acknowledgement labels declared by a subscriber.removePolicyAnnouncementSubscriber(akka.actor.ActorRef subscriber, Collection<String> topics) Remove a subscriber from the policy announcements only.voidremoveSubscriber(akka.actor.ActorRef subscriber) Remove a subscriber.default CompletionStage<Void>removeSubscriber(akka.actor.ActorRef subscriber, Collection<String> topics) Remove subscriber from all distributed data and wait for acknowledgements.removeTwinSubscriber(akka.actor.ActorRef subscriber, Collection<String> topics) Remove a subscriber from the twin events channel only.default CompletionStage<Void>subscribe(Collection<StreamingType> types, Collection<String> topics, akka.actor.ActorRef subscriber) Subscribe for each streaming type the same collection of topics.subscribe(Collection<StreamingType> types, Collection<String> topics, akka.actor.ActorRef subscriber, String group, boolean resubscribe) Subscribe for each streaming type the same collection of topics.updateLiveSubscriptions(Collection<StreamingType> types, Collection<String> topics, akka.actor.ActorRef subscriber) Update streaming types of a subscriber.
-
Method Details
-
subscribe
default CompletionStage<Void> subscribe(Collection<StreamingType> types, Collection<String> topics, akka.actor.ActorRef subscriber) Subscribe for each streaming type the same collection of topics.- Parameters:
types- the streaming types.topics- the topics.subscriber- who is subscribing.- Returns:
- future that completes or fails according to the acknowledgement.
-
subscribe
CompletionStage<Boolean> subscribe(Collection<StreamingType> types, Collection<String> topics, akka.actor.ActorRef subscriber, @Nullable String group, boolean resubscribe) Subscribe for each streaming type the same collection of topics.- Parameters:
types- the streaming types.topics- the topics.subscriber- who is subscribing.group- the group the subscriber belongs to, or null.- Returns:
- future that completes or fails according to the acknowledgement, containing the result of consistency check for resubscriptions.
-
removeSubscriber
void removeSubscriber(akka.actor.ActorRef subscriber) Remove a subscriber.- Parameters:
subscriber- who is unsubscribing.
-
updateLiveSubscriptions
CompletionStage<Void> updateLiveSubscriptions(Collection<StreamingType> types, Collection<String> topics, akka.actor.ActorRef subscriber) Update streaming types of a subscriber.- Parameters:
types- the currently active streaming types.topics- the topics to unsubscribe from.subscriber- the subscriber.- Returns:
- future that completes or fails according to the acknowledgement.
-
removeTwinSubscriber
CompletionStage<Void> removeTwinSubscriber(akka.actor.ActorRef subscriber, Collection<String> topics) Remove a subscriber from the twin events channel only.- Parameters:
subscriber- whom to remove.topics- what were the subscribed topics.- Returns:
- future that completes or fails according to the acknowledgement.
-
removePolicyAnnouncementSubscriber
CompletionStage<Void> removePolicyAnnouncementSubscriber(akka.actor.ActorRef subscriber, Collection<String> topics) Remove a subscriber from the policy announcements only.- Parameters:
subscriber- whom to remove.topics- what were the subscribed topics.- Returns:
- future that completes or fails according to the acknowledgement.
-
declareAcknowledgementLabels
CompletionStage<Void> declareAcknowledgementLabels(Collection<org.eclipse.ditto.base.model.acks.AcknowledgementLabel> acknowledgementLabels, akka.actor.ActorRef subscriber, @Nullable String group) Declare acknowledgement labels for a subscriber. Declared acknowledgement labels are globally unique for each subscriber. When racing against another subscriber on another node, the future may still complete successfully, but the subscriber losing the race will receive anAcknowledgementLabelNotUniqueExceptionlater. This method will always return a failed future if a distributed data for declared labels is not provided.- Parameters:
acknowledgementLabels- the acknowledgement labels to declare.subscriber- the subscriber making the declaration.group- any group the subscriber belongs to, or null.- Returns:
- a future that completes successfully when the initial declaration succeeds and fails if duplicate labels
are known. Subscribers losing a race against remote subscribers may receive an
AcknowledgementLabelNotUniqueExceptionlater.
-
removeAcknowledgementLabelDeclaration
void removeAcknowledgementLabelDeclaration(akka.actor.ActorRef subscriber) Relinquish any acknowledgement labels declared by a subscriber.- Parameters:
subscriber- the subscriber.
-
removeSubscriber
default CompletionStage<Void> removeSubscriber(akka.actor.ActorRef subscriber, Collection<String> topics) Remove subscriber from all distributed data and wait for acknowledgements.- Parameters:
subscriber- the subscriber to be removed.topics- the topics of the subscriber to be removed.- Returns:
- future that completes or fails according to the acknowledgements.
-
get
Get theDittoProtocolSubfor an actor system.- Parameters:
system- the actor system.- Returns:
- the
DittoProtocolSubextension.
-