def on_start(self):

        super(NotificationWorker,self).on_start()

        self.notifications = load_notifications()

        def _load_notifications_callback(msg, headers):
            """ local callback method so this can be used as callback in EventSubscribers """
            self.notifications = load_notifications() # from uns_utility_methods


        # the subscriber for the ReloadUserInfoEvent (new subscriber, subscription deleted, notifications changed, etc)
        self.reload_user_info_subscriber = EventSubscriber(
            event_type=OT.ReloadUserInfoEvent,
            #origin='UserNotificationService',
            callback=_load_notifications_callback
        )
        self.add_endpoint(self.reload_user_info_subscriber)

        # the subscriber for the UserInfo resource update events
        self.userinfo_rsc_mod_subscriber = EventSubscriber(
            event_type=OT.ResourceModifiedEvent,
            sub_type="UPDATE",
            origin_type="UserInfo",
            callback=_load_notifications_callback
        )
        self.add_endpoint(self.userinfo_rsc_mod_subscriber)
    def on_start(self):

        super(NotificationWorker, self).on_start()

        self.notifications = load_notifications()

        def _load_notifications_callback(msg, headers):
            """ local callback method so this can be used as callback in EventSubscribers """
            self.notifications = load_notifications(
            )  # from uns_utility_methods

        # the subscriber for the ReloadUserInfoEvent (new subscriber, subscription deleted, notifications changed, etc)
        self.reload_user_info_subscriber = EventSubscriber(
            event_type=OT.ReloadUserInfoEvent,
            #origin='UserNotificationService',
            callback=_load_notifications_callback)
        self.add_endpoint(self.reload_user_info_subscriber)

        # the subscriber for the UserInfo resource update events
        self.userinfo_rsc_mod_subscriber = EventSubscriber(
            event_type=OT.ResourceModifiedEvent,
            sub_type="UPDATE",
            origin_type="UserInfo",
            callback=_load_notifications_callback)
        self.add_endpoint(self.userinfo_rsc_mod_subscriber)
 def _load_notifications_callback(msg, headers):
     """ local callback method so this can be used as callback in EventSubscribers """
     self.notifications = load_notifications() # from uns_utility_methods
 def _load_notifications_callback(msg, headers):
     """ local callback method so this can be used as callback in EventSubscribers """
     self.notifications = load_notifications(
     )  # from uns_utility_methods