NotificationHandler.NotifierMqtt(CreateTopic)
class documentationNotificationHandler
(View In Hierarchy)
This class will create objects used to for notification service.
Method | __init__ | Undocumented |
Method | on_message_cb | This method will invoke the specified callback handler by the client app when a notification is received by the app based on the notification type. |
Method | Subscribe | No summary |
Method | Unsubscribe | This method takes the topic as argument and unsubscribes to the given topic. If topic name is not given as argument (no arguments), this method unsubscribes to all the topics which app already subscribed for. |
Method | SetCallbackOnConnect | This method sets the callback on connect. |
Method | UnsetCallbackOnConnect | This method unset the callback on connect. |
Method | SetCallbackOnDisconnect | This method sets the callback on disconnect. |
Method | UnsetCallbackOnDisconnect | This method unsets the callback on disconnect. |
Method | SetCallbackOnMessage | This method sets the callback on message. |
Method | UnsetCallbackOnMessage | This method unset the callback for the given subscription type. |
Method | GetCallbacks | This method retrieves all the callbacks. |
Method | Close | This method closes the mqtt connection. |
Inherited from CreateTopic:
Method | CreateIFDTopic | This method creates the IFD topic. |
Method | CreateIFLTopic | This method creates IFL topic. |
Method | CreateIFFTopic | This method creates IFF topic. |
Method | CreateIFATopic | This method creates IFA topic. |
Method | CreateFirewallTopic | This method creates firewall topic. |
Method | CreateRouteTopic | This method creates route topic. |
Method | CreateRouteTableTopic | This method creates route table topic. |
Method | CreateGenericTopic | This method creates a generic topic to subscribe all events. |
Method | CreateSyslogTopic | This method creates the syslog topic. |
Method | CreateConfigUpdateTopic | This method creates a topic to subscribe config-update events. |
This method will invoke the specified callback handler by the client app when a notification is received by the app based on the notification type.
Parameters | client | the client instance for this callback |
obj | the private user data as set in Client() or userdata_set() | |
msg | an instance of Message. This is a class with members topic, payload, qos, retain |
This method subscribes to a specific topic the client app is interested in. This takes subscription type and the callback function as parameters. When the notification for the subscribed topic is received, user passed callback function will be called. Callback function receives the notification message in json format.
Parameters | subscriptionType | Type of notification user wants to subscribe to |
handler | Callback function for each notification |
This method takes the topic as argument and unsubscribes to the given topic. If topic name is not given as argument (no arguments), this method unsubscribes to all the topics which app already subscribed for.
Parameters | subscriptionType | Notification type that user wants to unsubscribe from. @return 0 on successful unsubscription and -1 on failure |
This method sets the callback on connect.
Parameters | cb | callback to set. |
This method sets the callback on disconnect.
Parameters | cb | callback to set |
This method sets the callback on message.
Parameters | cb | callback to set |
subscriptionType | the message topic to set callback |