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.
def __init__(self):
Undocumented
def on_message_cb(self, client, obj, msg):

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.

Parametersclientthe client instance for this callback
objthe private user data as set in Client() or userdata_set()
msgan instance of Message. This is a class with members topic, payload, qos, retain
def Subscribe(self, subscriptionType, handler=None):

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.

ParameterssubscriptionTypeType of notification user wants to subscribe to
handlerCallback function for each notification
def Unsubscribe(self, subscriptionType=None):

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.

ParameterssubscriptionTypeNotification type that user wants to unsubscribe from. @return 0 on successful unsubscription and -1 on failure
def SetCallbackOnConnect(self, cb):

This method sets the callback on connect.

Parameterscbcallback to set.
def UnsetCallbackOnConnect(self):

This method unset the callback on connect.

def SetCallbackOnDisconnect(self, cb):

This method sets the callback on disconnect.

Parameterscbcallback to set
def UnsetCallbackOnDisconnect(self):

This method unsets the callback on disconnect.

def SetCallbackOnMessage(self, cb, subscriptionType='#'):

This method sets the callback on message.

Parameterscbcallback to set
subscriptionTypethe message topic to set callback
def UnsetCallbackOnMessage(self, subscriptionType='#'):

This method unset the callback for the given subscription type.

ParameterssubscriptionTypemessage topic
def GetCallbacks(self):

This method retrieves all the callbacks.

def Close(self):

This method closes the mqtt connection.