inline void Logger::handleNewNotification(const MoleQueue::LogEntry ¬if) { if (m_printNotifications) { qDebug() << "Notification:" << "Message: " << notif.message() << "MoleQueueId: (" << notif.moleQueueId() << ")"; } emit newNotification(notif); }
/** * Verify the contents in the notification. * We use the myNotificationFilterHandles to know which notifications to expect. */ static void saNtfNotificationCallbackT( SaNtfSubscriptionIdT subscriptionId, const SaNtfNotificationsT *notification) { switch(notification->notificationType) { case SA_NTF_TYPE_OBJECT_CREATE_DELETE: ntfRecieved.objectCreateDeleteFilterHandle += 1; if(myNotificationFilterHandles.objectCreateDeleteFilterHandle == 0) errors +=1; else errors += verifyObjectCreateDeleteNotification(&myObjCrDelNotfification, &(notification->notification.objectCreateDeleteNotification)); break; case SA_NTF_TYPE_ATTRIBUTE_CHANGE: ntfRecieved.attributeChangeFilterHandle += 1; if(myNotificationFilterHandles.attributeChangeFilterHandle == 0) errors += 1; else errors += verifyAttributeChangeNotification(&myAttrChangeNotification, &(notification->notification.attributeChangeNotification)); break; case SA_NTF_TYPE_STATE_CHANGE: ntfRecieved.stateChangeFilterHandle += 1; if(myNotificationFilterHandles.stateChangeFilterHandle == 0) errors += 1; else errors += verifyStateChangeNotification(&myStateChangeNotification, &(notification->notification.stateChangeNotification)); break; case SA_NTF_TYPE_ALARM: ntfRecieved.alarmFilterHandle += 1; if(myNotificationFilterHandles.alarmFilterHandle == 0) errors +=1; else errors += verifyAlarmNotification(&myAlarmNotification, &(notification->notification.alarmNotification)); break; case SA_NTF_TYPE_SECURITY_ALARM: ntfRecieved.securityAlarmFilterHandle += 1; if(myNotificationFilterHandles.securityAlarmFilterHandle == 0) errors += 1; else errors += verifySecurityAlarmNotification(&mySecAlarmNotification, &(notification->notification.securityAlarmNotification)); break; default: errors +=1; break; } last_not_id = get_ntf_id(notification); if(verbose) { newNotification(subscriptionId, notification); } }
bool RemDev::sendNotification(const QString &method, const QJsonObject ¶ms) { if ( ! registered) return false; sendObject(newNotification(method, params)); return true; }
QJsonObject RemDev::newRequest(LocalId id, const QString &method, const QJsonObject ¶ms) const { QJsonObject o(newNotification(method, params)); o.insert("id", id); return o; }