SubscriptionsManager class

A class that can manage the topic subscription process.


SubscriptionsManager(IMqttConnectionHandler connectionHandler, PublishingManager publishingManager, EventBus _clientEventBus)
Creates a new instance of a SubscriptionsManager that uses the specified connection to manage subscriptions.


connectionHandler IMqttConnectionHandler
The connection handler that we use to subscribe to subscription acknowledgements.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
messageIdentifierDispenser MessageIdentifierDispenser
Dispenser used for keeping track of subscription ids
read / write
onSubscribed SubscribeCallback
Subscribe and Unsubscribe callbacks
read / write
onSubscribeFail SubscribeFailCallback
Subscription failed callback
read / write
onUnsubscribed UnsubscribeCallback
read / write
pendingSubscriptions Map<int, Subscription>
A list of subscriptions that are pending acknowledgement, keyed on the message identifier.
read / write
pendingUnsubscriptions Map<int, String>
A list of unsubscribe requests waiting for an unsubscribe ack message. Index is the message identifier of the unsubscribe message
read / write
publishingManager PublishingManager
Publishing manager used for passing on published messages to subscribers.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
subscriptionNotifier → ChangeNotifier<MqttReceivedMessage<MqttMessage>>
Subscription notifier
subscriptions Map<String, Subscription>
List of confirmed subscriptions, keyed on the topic name.
read / write


confirmSubscription(MqttMessage msg) bool
Confirms a subscription has been made with the broker. Marks the sub as confirmed in the subs storage. Returns true on successful subscription, false on fail.
confirmUnsubscribe(MqttMessage msg) bool
Cleans up after an unsubscribe message is received from the broker. returns true, always
createNewSubscription(String topic, MqttQos qos) Subscription
Creates a new subscription for the specified topic. If the subscription cannot be created null is returned.
getSubscriptionsStatus(String topic) MqttSubscriptionStatus
Gets the current status of a subscription.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
publishMessageReceived(MessageReceived event) → void
Publish message received
registerSubscription(String topic, MqttQos qos) Subscription
Registers a new subscription with the subscription manager.
toString() String
Returns a string representation of this object.
tryGetExistingSubscription(String topic) Subscription
Gets a view on the existing observable, if the subscription already exists.
unsubscribe(String topic) → void
Unsubscribe from a topic


operator ==(dynamic other) bool
The equality operator. [...]