/** * This function builds the required configuration object for Notification sender and pass it * to the notification sender with the relevant event. * * @param operation Type or operation took place in user operation listener * @param username username of the subjected user for attribute change */ private void sendNotification(String operation, String username) { NotificationSender notificationSender = IdentityMgtServiceComponent.getNotificationSender(); if (notificationSender != null) { try { PublisherEvent event = new PublisherEvent(eventName); event.addEventProperty(operationLabel, operation); event.addEventProperty(usernameLabel, username); if (log.isDebugEnabled()) { log.debug("Invoking notification sender"); } notificationSender.invoke(event); } catch (NotificationManagementException e) { log.error("Error while sending notifications on user operations", e); } } else { log.error("No registered notification sender found. Notification sending aborted"); } } }
/** * This method is called from all service consumers of this bundle, whenever messageSendingModules need to be * fired. This method will check whether the registered message sending modules can handle the event type and if * can, it will invoke sendMessage * * @param event Publisher event * @throws NotificationManagementException */ public void invoke(PublisherEvent event) throws NotificationManagementException { if (event == null) { throw new NotificationManagementException("No publisher event found to send notification"); } if (log.isDebugEnabled()) { log.debug("Adding event to the event queue " + event.getEventName()); } eventDistributionTask.addEventToQueue(event); }
/** * This function builds the required configuration object for Notification sender and pass it * to the notification sender with the relevant event. * * @param operation Type or operation took place in user operation listener * @param username username of the subjected user for attribute change */ private void sendNotification(String operation, String username) { NotificationSender notificationSender = IdentityMgtServiceComponent.getNotificationSender(); if (notificationSender != null) { try { PublisherEvent event = new PublisherEvent(eventName); event.addEventProperty(operationLabel, operation); event.addEventProperty(usernameLabel, username); if (log.isDebugEnabled()) { log.debug("Invoking notification sender"); } notificationSender.invoke(event); } catch (NotificationManagementException e) { log.error("Error while sending notifications on user operations", e); } } else { log.error("No registered notification sender found. Notification sending aborted"); } } }
/** * This method is called from all service consumers of this bundle, whenever messageSendingModules need to be * fired. This method will check whether the registered message sending modules can handle the event type and if * can, it will invoke sendMessage * * @param event Publisher event * @throws NotificationManagementException */ public void invoke(PublisherEvent event) throws NotificationManagementException { if (event == null) { throw new NotificationManagementException("No publisher event found to send notification"); } if (log.isDebugEnabled()) { log.debug("Adding event to the event queue " + event.getEventName()); } eventDistributionTask.addEventToQueue(event); }
PublisherEvent event = new PublisherEvent(eventName); event.addEventProperty(NotificationConstants.TARGET_ID_PROPERTY_LABEL, statusHolder.getKey()); event.addEventProperty(NotificationConstants.USERNAME_PROPERTY_LABEL, statusHolder.getUser()); event.addEventProperty(NotificationConstants.TARGET_PROPERTY_LABEL, statusHolder.getTarget()); event.addEventProperty(NotificationConstants.ACTION_PROPERTY_LABEL, action); if (log.isDebugEnabled()) { log.debug("Invoking notification sender");
/** * This method is called from all service consumers of this bundle, whenever messageSendingModules need to be * fired. This method will check whether the registered message sending modules can handle the event type and if * can, it will invoke sendMessage * * @param event Publisher event * @throws NotificationManagementException */ public void invoke(PublisherEvent event) throws NotificationManagementException { if (event == null) { throw new NotificationManagementException("No publisher event found to send notification"); } if (log.isDebugEnabled()) { log.debug("Adding event to the event queue " + event.getEventName()); } eventDistributionTask.addEventToQueue(event); }
PublisherEvent event = new PublisherEvent(eventName); event.addEventProperty(NotificationConstants.TARGET_ID_PROPERTY_LABEL, statusHolder.getKey()); event.addEventProperty(NotificationConstants.USERNAME_PROPERTY_LABEL, statusHolder.getUser()); event.addEventProperty(NotificationConstants.TARGET_PROPERTY_LABEL, statusHolder.getTarget()); event.addEventProperty(NotificationConstants.ACTION_PROPERTY_LABEL, action); if (log.isDebugEnabled()) { log.debug("Invoking notification sender");
@Override public void run() { if (log.isDebugEnabled()) { log.debug("Executing " + module.getModuleName() + " on event" + event. getEventName()); } try { module.sendMessage(event); } catch (NotificationManagementException e) { log.error("Error while invoking notification sending module " + module. getModuleName(), e); } } };
PublisherEvent event = new PublisherEvent(eventName); event.addEventProperty(NotificationConstants.TARGET_ID_PROPERTY_LABEL, statusHolder.getKey()); event.addEventProperty(NotificationConstants.USERNAME_PROPERTY_LABEL, statusHolder.getUser()); event.addEventProperty(NotificationConstants.TARGET_PROPERTY_LABEL, statusHolder.getTarget()); event.addEventProperty(NotificationConstants.ACTION_PROPERTY_LABEL, action); if (log.isDebugEnabled()) { log.debug("Invoking notification sender");
@Override public void run() { if (log.isDebugEnabled()) { log.debug("Executing " + module.getModuleName() + " on event" + event. getEventName()); } try { module.sendMessage(event); } catch (NotificationManagementException e) { log.error("Error while invoking notification sending module " + module. getModuleName(), e); } } };
@Override public void run() { if (log.isDebugEnabled()) { log.debug("Executing " + module.getModuleName() + " on event" + event. getEventName()); } try { module.sendMessage(event); } catch (NotificationManagementException e) { log.error("Error while invoking notification sending module " + module. getModuleName(), e); } } };