SubscriptionsManager class Null safety

A class that can manage the topic subscription process.

Constructors

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

Properties

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?
Unsubscribed
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
resubscribeOnAutoReconnect bool
Re subscribe on auto reconnect.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
subscriptionNotifier Stream<List<MqttReceivedMessage<MqttMessage>>>
Subscription notifier
read-only
subscriptions Map<String, Subscription?>
List of confirmed subscriptions, keyed on the topic name.
read / write

Methods

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. [...]
inherited
publishMessageReceived(MessageReceived event) → void
Publish message received
registerSubscription(String topic, MqttQos qos) Subscription?
Registers a new subscription with the subscription manager.
resubscribe() → void
Re subscribe. Unsubscribes all confirmed subscriptions and re subscribes them without sending unsubscribe messages to the broker.
toString() String
A string representation of this object. [...]
inherited
tryGetExistingSubscription(String topic) Subscription?
Gets a view on the existing observable, if the subscription already exists.
unsubscribe(String topic) → void
Unsubscribe from a topic

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited