org.rhq.enterprise.server.alert
Class AlertManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.alert.AlertManagerBean
All Implemented Interfaces:
AlertManagerLocal, AlertManagerRemote

public class AlertManagerBean
extends java.lang.Object
implements AlertManagerLocal, AlertManagerRemote

Author:
Joseph Marques, Ian Springer

Constructor Summary
AlertManagerBean()
           
 
Method Summary
 void acknowledgeAlert(int alertId, Subject user)
          Mark the matching alert as acknowledged by the user
 Alert createAlert(Alert alert)
          Persist a detached alert.
 int deleteAlerts(long beginTime, long endTime)
          Remove alerts for the specified range of time.
 int deleteAlerts(Subject user, int resourceId)
           
 void deleteAlerts(Subject user, int resourceId, java.lang.Integer[] ids)
           
 void deleteAlertsForResourceGroup(Subject user, int resourceGroupId, java.lang.Integer[] ids)
           
 PageList<Alert> findAlerts(int resourceId, java.lang.Integer alertDefinitionId, AlertPriority priority, java.lang.Long beginDate, java.lang.Long endDate, PageControl pageControl)
           
 PageList<Alert> findAlerts(Subject subject, java.lang.Integer[] resourceIds, AlertPriority priority, long timeRange, PageControl pageControl)
           
 PageList<Alert> findAlertsByCriteria(Subject subject, AlertCriteria criteria)
           
 void fireAlert(int alertDefinitionId)
           
 int getAlertCountByMeasurementDefinitionAndAutoGroup(int measurementDefinitionId, int resourceParentId, int resourceTypeId, long beginDate, long endDate)
           
 int getAlertCountByMeasurementDefinitionAndResource(int measurementDefinitionId, int resourceId, long beginDate, long endDate)
           
 int getAlertCountByMeasurementDefinitionAndResourceGroup(int measurementDefinitionId, int groupId, long beginDate, long endDate)
           
 int getAlertCountByMeasurementDefinitionAndResources(int measurementDefinitionId, int[] resourceIds, long beginDate, long endDate)
           
 int getAlertCountByMeasurementDefinitionId(java.lang.Integer measurementDefinitionId, long begin, long end)
           
 java.util.Map<java.lang.Integer,java.lang.Integer> getAlertCountForSchedules(long begin, long end, java.util.List<java.lang.Integer> scheduleIds)
           
 AlertSenderPluginManager getAlertPluginManager()
          Return the plugin manager that is managing alert sender plugins
 Alert getById(int alertId)
          Get the alert with the specified id.
 java.lang.String prettyPrintAlertConditions(Alert alert)
          Create a human readable description of the conditions that led to this alert.
 java.lang.String prettyPrintAlertURL(Alert alert)
           
 int purgeAlerts()
           
 void sendAlertNotifications(Alert alert)
           
 void triggerOperation(AlertDefinition alertDefinition)
           
 Alert updateAlert(Alert alert)
           
 boolean willDefinitionBeDisabled(Alert alert)
          Tells us if the definition of the passed alert will be disabled after this alert was fired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlertManagerBean

public AlertManagerBean()
Method Detail

createAlert

public Alert createAlert(Alert alert)
Persist a detached alert.

Specified by:
createAlert in interface AlertManagerLocal
Returns:
an alert

updateAlert

public Alert updateAlert(Alert alert)
Specified by:
updateAlert in interface AlertManagerLocal

deleteAlerts

public void deleteAlerts(Subject user,
                         int resourceId,
                         java.lang.Integer[] ids)
Specified by:
deleteAlerts in interface AlertManagerLocal

deleteAlertsForResourceGroup

public void deleteAlertsForResourceGroup(Subject user,
                                         int resourceGroupId,
                                         java.lang.Integer[] ids)
Specified by:
deleteAlertsForResourceGroup in interface AlertManagerLocal

deleteAlerts

public int deleteAlerts(Subject user,
                        int resourceId)
Specified by:
deleteAlerts in interface AlertManagerLocal

deleteAlerts

public int deleteAlerts(long beginTime,
                        long endTime)
Remove alerts for the specified range of time.

Specified by:
deleteAlerts in interface AlertManagerLocal

purgeAlerts

public int purgeAlerts()

getById

public Alert getById(int alertId)
Get the alert with the specified id.

Specified by:
getById in interface AlertManagerLocal

getAlertCountByMeasurementDefinitionId

public int getAlertCountByMeasurementDefinitionId(java.lang.Integer measurementDefinitionId,
                                                  long begin,
                                                  long end)
Specified by:
getAlertCountByMeasurementDefinitionId in interface AlertManagerLocal

getAlertCountByMeasurementDefinitionAndResources

public int getAlertCountByMeasurementDefinitionAndResources(int measurementDefinitionId,
                                                            int[] resourceIds,
                                                            long beginDate,
                                                            long endDate)
Specified by:
getAlertCountByMeasurementDefinitionAndResources in interface AlertManagerLocal

getAlertCountByMeasurementDefinitionAndResourceGroup

public int getAlertCountByMeasurementDefinitionAndResourceGroup(int measurementDefinitionId,
                                                                int groupId,
                                                                long beginDate,
                                                                long endDate)
Specified by:
getAlertCountByMeasurementDefinitionAndResourceGroup in interface AlertManagerLocal

getAlertCountByMeasurementDefinitionAndAutoGroup

public int getAlertCountByMeasurementDefinitionAndAutoGroup(int measurementDefinitionId,
                                                            int resourceParentId,
                                                            int resourceTypeId,
                                                            long beginDate,
                                                            long endDate)
Specified by:
getAlertCountByMeasurementDefinitionAndAutoGroup in interface AlertManagerLocal

getAlertCountByMeasurementDefinitionAndResource

public int getAlertCountByMeasurementDefinitionAndResource(int measurementDefinitionId,
                                                           int resourceId,
                                                           long beginDate,
                                                           long endDate)
Specified by:
getAlertCountByMeasurementDefinitionAndResource in interface AlertManagerLocal

getAlertCountForSchedules

public java.util.Map<java.lang.Integer,java.lang.Integer> getAlertCountForSchedules(long begin,
                                                                                    long end,
                                                                                    java.util.List<java.lang.Integer> scheduleIds)
Specified by:
getAlertCountForSchedules in interface AlertManagerLocal

findAlerts

public PageList<Alert> findAlerts(Subject subject,
                                  java.lang.Integer[] resourceIds,
                                  AlertPriority priority,
                                  long timeRange,
                                  PageControl pageControl)
Specified by:
findAlerts in interface AlertManagerLocal

findAlerts

public PageList<Alert> findAlerts(int resourceId,
                                  java.lang.Integer alertDefinitionId,
                                  AlertPriority priority,
                                  java.lang.Long beginDate,
                                  java.lang.Long endDate,
                                  PageControl pageControl)
Specified by:
findAlerts in interface AlertManagerLocal

acknowledgeAlert

public void acknowledgeAlert(int alertId,
                             Subject user)
Mark the matching alert as acknowledged by the user

Specified by:
acknowledgeAlert in interface AlertManagerLocal
Parameters:
alertId - Id of the alert to acknowledge
user - user who acknowledged the alert

fireAlert

public void fireAlert(int alertDefinitionId)
Specified by:
fireAlert in interface AlertManagerLocal

triggerOperation

public void triggerOperation(AlertDefinition alertDefinition)
Specified by:
triggerOperation in interface AlertManagerLocal

sendAlertNotifications

public void sendAlertNotifications(Alert alert)
Specified by:
sendAlertNotifications in interface AlertManagerLocal

getAlertPluginManager

public AlertSenderPluginManager getAlertPluginManager()
Return the plugin manager that is managing alert sender plugins

Specified by:
getAlertPluginManager in interface AlertManagerLocal
Returns:
The alert sender plugin manager

prettyPrintAlertConditions

public java.lang.String prettyPrintAlertConditions(Alert alert)
Create a human readable description of the conditions that led to this alert.

Specified by:
prettyPrintAlertConditions in interface AlertManagerLocal
Parameters:
alert - Alert to create human readable condition description
Returns:
human readable condition log

prettyPrintAlertURL

public java.lang.String prettyPrintAlertURL(Alert alert)
Specified by:
prettyPrintAlertURL in interface AlertManagerLocal

willDefinitionBeDisabled

public boolean willDefinitionBeDisabled(Alert alert)
Tells us if the definition of the passed alert will be disabled after this alert was fired

Specified by:
willDefinitionBeDisabled in interface AlertManagerLocal
Parameters:
alert - alert to check
Returns:
true if the definition got disabled

findAlertsByCriteria

public PageList<Alert> findAlertsByCriteria(Subject subject,
                                            AlertCriteria criteria)
Specified by:
findAlertsByCriteria in interface AlertManagerLocal
Specified by:
findAlertsByCriteria in interface AlertManagerRemote


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