org.rhq.enterprise.server.alert
Class AlertNotificationManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.alert.AlertNotificationManagerBean
All Implemented Interfaces:
AlertNotificationManagerLocal

public class AlertNotificationManagerBean
extends java.lang.Object
implements AlertNotificationManagerLocal

Author:
Joseph Marques

Constructor Summary
AlertNotificationManagerBean()
           
 
Method Summary
 void addAlertNotification(Subject user, int alertDefinitionId, java.lang.String senderName, Configuration configuration)
          Add a new AlertNotification to the passed definition
 int addEmailNotifications(Subject subject, java.lang.Integer alertDefinitionId, java.lang.String[] emails)
           
 int addRoleNotifications(Subject subject, java.lang.Integer alertDefinitionId, java.lang.Integer[] roleIds)
           
 int addSubjectNotifications(Subject user, java.lang.Integer alertDefinitionId, java.lang.Integer[] subjectIds)
           
 AlertSenderInfo getAlertInfoForSender(java.lang.String shortName)
           
 Configuration getAlertPropertiesConfiguration(AlertNotification notification)
           
 ConfigurationDefinition getConfigurationDefinitionForSender(java.lang.String shortName)
           
 PageList<EmailNotification> getEmailNotifications(java.lang.Integer[] alertNotificationIds, PageControl pageControl)
           
 PageList<EmailNotification> getEmailNotifications(java.lang.Integer alertDefinitionId, PageControl pageControl)
           
 java.util.List<AlertNotification> getNotificationsForAlertDefinition(Subject user, int alertDefinitionId)
          Return notifications for a certain alertDefinitionId NOTE: this only returns notifications that have an AlertSender defined.
 PageList<RoleNotification> getRoleNotifications(java.lang.Integer[] alertNotificationIds, PageControl pageControl)
           
 PageList<RoleNotification> getRoleNotifications(java.lang.Integer alertDefinitionId, PageControl pageControl)
           
 PageList<RoleNotification> getRoleNotificationsByRoles(java.lang.Integer[] roleIds, PageControl pageControl)
           
 PageList<SnmpNotification> getSnmpNotifications(java.lang.Integer alertDefinitionId, PageControl pageControl)
           
 PageList<SubjectNotification> getSubjectNotifications(java.lang.Integer[] alertNotificationIds, PageControl pageControl)
           
 PageList<SubjectNotification> getSubjectNotifications(java.lang.Integer alertDefinitionId, PageControl pageControl)
           
 PageList<SubjectNotification> getSubjectNotificationsBySubjects(java.lang.Integer[] subjectIds, PageControl pageControl)
           
 java.util.List<java.lang.String> listAllAlertSenders()
          Return a list of all available AlertSenders in the system by their shortname.
 int purgeOrphanedAlertNotifications()
           
 int removeNotifications(Subject subject, java.lang.Integer alertDefinitionId, java.lang.Integer[] notificationIds)
          Remove the passed notifications from the passed alert definition (all identified by their id)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlertNotificationManagerBean

public AlertNotificationManagerBean()
Method Detail

addEmailNotifications

public int addEmailNotifications(Subject subject,
                                 java.lang.Integer alertDefinitionId,
                                 java.lang.String[] emails)
Specified by:
addEmailNotifications in interface AlertNotificationManagerLocal

getEmailNotifications

public PageList<EmailNotification> getEmailNotifications(java.lang.Integer alertDefinitionId,
                                                         PageControl pageControl)
Specified by:
getEmailNotifications in interface AlertNotificationManagerLocal

getEmailNotifications

public PageList<EmailNotification> getEmailNotifications(java.lang.Integer[] alertNotificationIds,
                                                         PageControl pageControl)
Specified by:
getEmailNotifications in interface AlertNotificationManagerLocal

addRoleNotifications

public int addRoleNotifications(Subject subject,
                                java.lang.Integer alertDefinitionId,
                                java.lang.Integer[] roleIds)
Specified by:
addRoleNotifications in interface AlertNotificationManagerLocal

getRoleNotifications

public PageList<RoleNotification> getRoleNotifications(java.lang.Integer alertDefinitionId,
                                                       PageControl pageControl)
Specified by:
getRoleNotifications in interface AlertNotificationManagerLocal

getRoleNotifications

public PageList<RoleNotification> getRoleNotifications(java.lang.Integer[] alertNotificationIds,
                                                       PageControl pageControl)
Specified by:
getRoleNotifications in interface AlertNotificationManagerLocal

getRoleNotificationsByRoles

public PageList<RoleNotification> getRoleNotificationsByRoles(java.lang.Integer[] roleIds,
                                                              PageControl pageControl)
Specified by:
getRoleNotificationsByRoles in interface AlertNotificationManagerLocal

addSubjectNotifications

public int addSubjectNotifications(Subject user,
                                   java.lang.Integer alertDefinitionId,
                                   java.lang.Integer[] subjectIds)
Specified by:
addSubjectNotifications in interface AlertNotificationManagerLocal

getSubjectNotifications

public PageList<SubjectNotification> getSubjectNotifications(java.lang.Integer alertDefinitionId,
                                                             PageControl pageControl)
Specified by:
getSubjectNotifications in interface AlertNotificationManagerLocal

getSnmpNotifications

public PageList<SnmpNotification> getSnmpNotifications(java.lang.Integer alertDefinitionId,
                                                       PageControl pageControl)
Specified by:
getSnmpNotifications in interface AlertNotificationManagerLocal

getSubjectNotifications

public PageList<SubjectNotification> getSubjectNotifications(java.lang.Integer[] alertNotificationIds,
                                                             PageControl pageControl)
Specified by:
getSubjectNotifications in interface AlertNotificationManagerLocal

getSubjectNotificationsBySubjects

public PageList<SubjectNotification> getSubjectNotificationsBySubjects(java.lang.Integer[] subjectIds,
                                                                       PageControl pageControl)
Specified by:
getSubjectNotificationsBySubjects in interface AlertNotificationManagerLocal

removeNotifications

public int removeNotifications(Subject subject,
                               java.lang.Integer alertDefinitionId,
                               java.lang.Integer[] notificationIds)
Description copied from interface: AlertNotificationManagerLocal
Remove the passed notifications from the passed alert definition (all identified by their id)

Specified by:
removeNotifications in interface AlertNotificationManagerLocal
Parameters:
subject - Caller
alertDefinitionId - alert definition to modify
notificationIds - Notifications to remove
Returns:
number of notifications removed

purgeOrphanedAlertNotifications

public int purgeOrphanedAlertNotifications()
Specified by:
purgeOrphanedAlertNotifications in interface AlertNotificationManagerLocal

getAlertPropertiesConfiguration

public Configuration getAlertPropertiesConfiguration(AlertNotification notification)
Specified by:
getAlertPropertiesConfiguration in interface AlertNotificationManagerLocal

getConfigurationDefinitionForSender

public ConfigurationDefinition getConfigurationDefinitionForSender(java.lang.String shortName)
Specified by:
getConfigurationDefinitionForSender in interface AlertNotificationManagerLocal

listAllAlertSenders

public java.util.List<java.lang.String> listAllAlertSenders()
Return a list of all available AlertSenders in the system by their shortname.

Specified by:
listAllAlertSenders in interface AlertNotificationManagerLocal
Returns:
list of senders.

getAlertInfoForSender

public AlertSenderInfo getAlertInfoForSender(java.lang.String shortName)
Specified by:
getAlertInfoForSender in interface AlertNotificationManagerLocal

addAlertNotification

public void addAlertNotification(Subject user,
                                 int alertDefinitionId,
                                 java.lang.String senderName,
                                 Configuration configuration)
Add a new AlertNotification to the passed definition

Specified by:
addAlertNotification in interface AlertNotificationManagerLocal
Parameters:
user - subject of the caller
alertDefinitionId - Id of the alert definition
senderName - shortName of the AlertSender
configuration - Properties for this alert sender.

getNotificationsForAlertDefinition

public java.util.List<AlertNotification> getNotificationsForAlertDefinition(Subject user,
                                                                            int alertDefinitionId)
Return notifications for a certain alertDefinitionId NOTE: this only returns notifications that have an AlertSender defined.

Specified by:
getNotificationsForAlertDefinition in interface AlertNotificationManagerLocal
Parameters:
user - Subject of the caller
alertDefinitionId - Id of the alert definition
Returns:
list of defined notification of the passed alert definition


Copyright © 2008-2009 Red Hat, Inc.. All Rights Reserved.