org.rhq.enterprise.server.alert
Interface AlertNotificationManagerLocal

All Known Implementing Classes:
AlertNotificationManagerBean

public interface AlertNotificationManagerLocal

Author:
Joseph Marques, Lukas Krejci

Method Summary
 org.rhq.core.domain.alert.notification.AlertNotification addAlertNotification(org.rhq.core.domain.auth.Subject user, int alertDefinitionId, org.rhq.core.domain.alert.notification.AlertNotification notification)
          Add a new AlertNotification to the passed definition
 int cleanseAlertNotificationByRole(int roleId)
           
 int cleanseAlertNotificationBySubject(int subjectId)
           
 boolean finalizeNotifications(org.rhq.core.domain.auth.Subject subject, List<org.rhq.core.domain.alert.notification.AlertNotification> notifications)
          This method calls out to the alert senders responsible to individual notifications and ask them to finalize and validate the notifications before they are processed further.
 AlertSenderInfo getAlertInfoForSender(String shortName)
           
 org.rhq.core.domain.alert.notification.AlertNotification getAlertNotification(org.rhq.core.domain.auth.Subject user, int alertNotificationId)
           
 CustomAlertSenderBackingBean getBackingBeanForSender(String shortName, Integer alertNotificationId)
          Return the backing bean for the AlertSender with the passed shortNama
 String getBackingBeanNameForSender(String shortName)
           
 org.rhq.core.domain.configuration.definition.ConfigurationDefinition getConfigurationDefinitionForSender(String shortName)
           
 List<org.rhq.core.domain.alert.notification.AlertNotification> getNotificationsForAlertDefinition(org.rhq.core.domain.auth.Subject user, int alertDefinitionId)
          Return notifications for a certain alertDefinitionId NOTE: this only returns notifications that have an AlertSender defined.
 List<String> listAllAlertSenders()
          Return a list of all available AlertSenders in the system by their shortname.
 void massReconfigure(List<Integer> alertNotificationIds, Map<String,String> newConfigurationValues)
          This method can be used to reconfigure a number of notifications en-masse.
 int purgeOrphanedAlertNotifications()
           
 int removeNotifications(org.rhq.core.domain.auth.Subject subject, Integer alertDefinitionId, Integer[] notificationIds)
          Remove the passed notifications from the passed alert definition (all identified by their id)
 void updateAlertNotification(org.rhq.core.domain.auth.Subject subject, int alertDefinitionId, org.rhq.core.domain.alert.notification.AlertNotification notification)
          Persist changes to the passed AlertNotification
 

Method Detail

addAlertNotification

org.rhq.core.domain.alert.notification.AlertNotification addAlertNotification(org.rhq.core.domain.auth.Subject user,
                                                                              int alertDefinitionId,
                                                                              org.rhq.core.domain.alert.notification.AlertNotification notification)
                                                                              throws AlertDefinitionUpdateException,
                                                                                     AlertNotificationValidationException
Add a new AlertNotification to the passed definition

Parameters:
user - subject of the caller
alertDefinitionId - Id of the alert definition
senderName - shortName of the AlertSender
configuration - Properties for this alert sender.
Throws:
AlertNotificationValidationException - if the alert sender of the notification failed to finalize and validate the provided notification's configuration
AlertDefinitionUpdateException

updateAlertNotification

void updateAlertNotification(org.rhq.core.domain.auth.Subject subject,
                             int alertDefinitionId,
                             org.rhq.core.domain.alert.notification.AlertNotification notification)
                             throws AlertDefinitionUpdateException,
                                    AlertNotificationValidationException
Persist changes to the passed AlertNotification

Parameters:
notification -
Throws:
AlertNotificationValidationException - if the alert sender of the notification failed to finalize and validate the notification's configuration
AlertDefinitionUpdateException

removeNotifications

int removeNotifications(org.rhq.core.domain.auth.Subject subject,
                        Integer alertDefinitionId,
                        Integer[] notificationIds)
Remove the passed notifications from the passed alert definition (all identified by their id)

Parameters:
subject - Caller
alertDefinitionId - alert definition to modify
notificationIds - Notifications to remove
Returns:
number of notifications removed

finalizeNotifications

boolean finalizeNotifications(org.rhq.core.domain.auth.Subject subject,
                              List<org.rhq.core.domain.alert.notification.AlertNotification> notifications)
This method calls out to the alert senders responsible to individual notifications and ask them to finalize and validate the notifications before they are processed further. This gives the alert senders the chance to transform their configurations from what's being input by the user to what needs to be persisted and to perform validation of the configurations.

The notifications can be modified during this call. New properties can be added to their configurations, etc.

Parameters:
subject - the subject that is requesting the changes
notifications - the notifications to process
Returns:
true if everything went ok, false if the validation fails. In this case one or more properties in the configuration or extra configuration of one or more of the notifications contains an error message describing the error.

purgeOrphanedAlertNotifications

int purgeOrphanedAlertNotifications()

listAllAlertSenders

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

Returns:
list of senders.

getConfigurationDefinitionForSender

org.rhq.core.domain.configuration.definition.ConfigurationDefinition getConfigurationDefinitionForSender(String shortName)

getNotificationsForAlertDefinition

List<org.rhq.core.domain.alert.notification.AlertNotification> getNotificationsForAlertDefinition(org.rhq.core.domain.auth.Subject user,
                                                                                                  int alertDefinitionId)
Return notifications for a certain alertDefinitionId NOTE: this only returns notifications that have an AlertSender defined.

Parameters:
user - Subject of the caller
alertDefinitionId - Id of the alert definition
Returns:
list of defined notification of the passed alert definition

getAlertInfoForSender

AlertSenderInfo getAlertInfoForSender(String shortName)

getBackingBeanForSender

CustomAlertSenderBackingBean getBackingBeanForSender(String shortName,
                                                     Integer alertNotificationId)
Return the backing bean for the AlertSender with the passed shortNama

Parameters:
shortName - name of a sender
alertNotificationId -
Returns:
an initialized BackingBean or null in case of error

getBackingBeanNameForSender

String getBackingBeanNameForSender(String shortName)

getAlertNotification

org.rhq.core.domain.alert.notification.AlertNotification getAlertNotification(org.rhq.core.domain.auth.Subject user,
                                                                              int alertNotificationId)

cleanseAlertNotificationBySubject

int cleanseAlertNotificationBySubject(int subjectId)

cleanseAlertNotificationByRole

int cleanseAlertNotificationByRole(int roleId)

massReconfigure

void massReconfigure(List<Integer> alertNotificationIds,
                     Map<String,String> newConfigurationValues)
This method can be used to reconfigure a number of notifications en-masse.

Parameters:
alertNotificationIds - the alert notifications to update
newConfigurationValues - a map where keys are the property names and values are the new property values


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