org.rhq.enterprise.server.alert
Interface AlertDefinitionManagerLocal

All Known Implementing Classes:
AlertDefinitionManagerBean

public interface AlertDefinitionManagerLocal

all methods that aren't getters appropriately update the contents of the AlertConditionCache

Author:
Joseph Marques

Method Summary
 void copyAlertDefinitions(org.rhq.core.domain.auth.Subject subject, Integer[] alertDefinitionIds)
           
 int createAlertDefinition(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.alert.AlertDefinition alertDefinition, Integer resourceId, boolean finalizeNotificationConfiguration)
          Creates a new alert definition.
 int createDependentAlertDefinition(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.alert.AlertDefinition alertDefinition, int resourceId)
          This is exactly the same as createAlertDefinition(Subject, AlertDefinition, Integer, boolean) but assumes the resource is part of a group (or has given resource type for templates) for which a group or template alert definition is being created.
 int disableAlertDefinitions(org.rhq.core.domain.auth.Subject subject, int[] alertDefinitionIds)
           
 int enableAlertDefinitions(org.rhq.core.domain.auth.Subject subject, int[] alertDefinitionIds)
           
 List<org.rhq.core.domain.common.composite.IntegerOptionItem> findAlertDefinitionOptionItemsForGroup(org.rhq.core.domain.auth.Subject subject, int groupId)
           
 List<org.rhq.core.domain.common.composite.IntegerOptionItem> findAlertDefinitionOptionItemsForResource(org.rhq.core.domain.auth.Subject subject, int resourceId)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.alert.AlertDefinition> findAlertDefinitions(org.rhq.core.domain.auth.Subject subject, int resourceId, org.rhq.core.domain.util.PageControl pageControl)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.alert.AlertDefinition> findAlertDefinitionsByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.AlertDefinitionCriteria criteria)
           
 List<org.rhq.core.domain.alert.AlertDefinition> findAllRecoveryDefinitionsById(org.rhq.core.domain.auth.Subject subject, Integer alertDefinitionId)
           
 org.rhq.core.domain.alert.AlertDefinition getAlertDefinition(org.rhq.core.domain.auth.Subject subject, int alertDefinitionId)
           
 org.rhq.core.domain.alert.AlertDefinition getAlertDefinitionById(org.rhq.core.domain.auth.Subject subject, int alertDefinitionId)
           
 String[] getAlertNotificationConfigurationPreview(org.rhq.core.domain.auth.Subject sessionSubject, org.rhq.core.domain.alert.notification.AlertNotification[] notifications)
           
 boolean isEnabled(Integer definitionId)
           
 boolean isGroupAlertDefinition(Integer definitionId)
           
 boolean isResourceAlertDefinition(Integer definitionId)
           
 boolean isTemplate(Integer definitionId)
           
 void purgeInternals(int alertDefinitionId)
           
 int purgeUnusedAlertDefinitions()
           
 int removeAlertDefinitions(org.rhq.core.domain.auth.Subject subject, int[] alertDefinitionIds)
           
 org.rhq.core.domain.alert.AlertDefinition updateAlertDefinition(org.rhq.core.domain.auth.Subject subject, int alertDefinitionId, org.rhq.core.domain.alert.AlertDefinition alertDefinition, boolean resetMatching)
           
 org.rhq.core.domain.alert.AlertDefinition updateDependentAlertDefinition(org.rhq.core.domain.auth.Subject subject, int alertDefinitionId, org.rhq.core.domain.alert.AlertDefinition alertDefinition, boolean resetMatching)
          This method is similar in use-case to createDependentAlertDefinition(Subject, AlertDefinition, int).
 

Method Detail

findAlertDefinitions

org.rhq.core.domain.util.PageList<org.rhq.core.domain.alert.AlertDefinition> findAlertDefinitions(org.rhq.core.domain.auth.Subject subject,
                                                                                                  int resourceId,
                                                                                                  org.rhq.core.domain.util.PageControl pageControl)

getAlertDefinitionById

org.rhq.core.domain.alert.AlertDefinition getAlertDefinitionById(org.rhq.core.domain.auth.Subject subject,
                                                                 int alertDefinitionId)

findAlertDefinitionOptionItemsForResource

List<org.rhq.core.domain.common.composite.IntegerOptionItem> findAlertDefinitionOptionItemsForResource(org.rhq.core.domain.auth.Subject subject,
                                                                                                       int resourceId)

findAlertDefinitionOptionItemsForGroup

List<org.rhq.core.domain.common.composite.IntegerOptionItem> findAlertDefinitionOptionItemsForGroup(org.rhq.core.domain.auth.Subject subject,
                                                                                                    int groupId)

createAlertDefinition

int createAlertDefinition(org.rhq.core.domain.auth.Subject subject,
                          org.rhq.core.domain.alert.AlertDefinition alertDefinition,
                          Integer resourceId,
                          boolean finalizeNotificationConfiguration)
                          throws InvalidAlertDefinitionException
Creates a new alert definition. Note that the suject is checked to have necessary authz, which might not be what you want in all use cases. See createDependentAlertDefinition(Subject, AlertDefinition, int) for further discussion of this.

Parameters:
subject - the user creating the alert definition
alertDefinition - the new alert definition to persist
resourceId - the resource id for which the def is being created
finalizeNotificationConfiguration - if true, the configuration of the def's notifications is validated. This is NOT what you want if, for example, you are merely creating a copy of an existing definition. Some notifications might require more input when creating the notification than is then persisted in their configs (prominent example being the CLI alert sender). This would then cause the validation to fail every time you created a copy of a definition and tried to persist it. Note that passing false AND having new, unpersisted notifications in the alert definition can lead to invalid configuration being stored for the notifications.
Returns:
the id of the newly persisted alert definition
Throws:
InvalidAlertDefinitionException

createDependentAlertDefinition

int createDependentAlertDefinition(org.rhq.core.domain.auth.Subject subject,
                                   org.rhq.core.domain.alert.AlertDefinition alertDefinition,
                                   int resourceId)
This is exactly the same as createAlertDefinition(Subject, AlertDefinition, Integer, boolean) but assumes the resource is part of a group (or has given resource type for templates) for which a group or template alert definition is being created.

This method assumes the caller already checked the subject has permissions to create a group or template alert definition on a group / resource type the resource is member of.

In another words this method is a helper to GroupAlertDefinitionManagerLocal.createGroupAlertDefinitions(Subject, AlertDefinition, Integer) and AlertTemplateManagerLocal.createAlertTemplate(Subject, AlertDefinition, Integer).

Parameters:
subject - the user that is creating the group or template alert definition
alertDefinition - the alert definition on the resource
resourceId - the resource
Returns:
the id of the newly created alert definition

isEnabled

boolean isEnabled(Integer definitionId)

isTemplate

boolean isTemplate(Integer definitionId)

isGroupAlertDefinition

boolean isGroupAlertDefinition(Integer definitionId)

isResourceAlertDefinition

boolean isResourceAlertDefinition(Integer definitionId)

findAllRecoveryDefinitionsById

List<org.rhq.core.domain.alert.AlertDefinition> findAllRecoveryDefinitionsById(org.rhq.core.domain.auth.Subject subject,
                                                                               Integer alertDefinitionId)

copyAlertDefinitions

void copyAlertDefinitions(org.rhq.core.domain.auth.Subject subject,
                          Integer[] alertDefinitionIds)

updateAlertDefinition

org.rhq.core.domain.alert.AlertDefinition updateAlertDefinition(org.rhq.core.domain.auth.Subject subject,
                                                                int alertDefinitionId,
                                                                org.rhq.core.domain.alert.AlertDefinition alertDefinition,
                                                                boolean resetMatching)
                                                                throws InvalidAlertDefinitionException,
                                                                       AlertDefinitionUpdateException
Parameters:
subject -
alertDefinitionId -
alertDefinition -
resetMatching - Incur the overhead of resetting any partial alert matching that has taken place. This *must* be set true if updating conditions, dampening rules or the conditionExpressin (ANY vs ALL). If in doubt, set to true as the loss of partial matching is better than corrupted matching.
Returns:
Throws:
InvalidAlertDefinitionException
AlertDefinitionUpdateException

updateDependentAlertDefinition

org.rhq.core.domain.alert.AlertDefinition updateDependentAlertDefinition(org.rhq.core.domain.auth.Subject subject,
                                                                         int alertDefinitionId,
                                                                         org.rhq.core.domain.alert.AlertDefinition alertDefinition,
                                                                         boolean resetMatching)
                                                                         throws InvalidAlertDefinitionException,
                                                                                AlertDefinitionUpdateException
This method is similar in use-case to createDependentAlertDefinition(Subject, AlertDefinition, int). It assumes that the the update is part of some more complex operation (like updating alert definition on a group or a template) and that authz checks have already been performed.

This method is therefore identical to updateAlertDefinition(Subject, int, AlertDefinition, boolean) but does not perform any authorization checks.

Parameters:
subject - the user that is updating the alert definition
alertDefinitionId -
alertDefinition -
resetMatching -
Returns:
Throws:
InvalidAlertDefinitionException
AlertDefinitionUpdateException

purgeUnusedAlertDefinitions

int purgeUnusedAlertDefinitions()

purgeInternals

void purgeInternals(int alertDefinitionId)

getAlertDefinition

org.rhq.core.domain.alert.AlertDefinition getAlertDefinition(org.rhq.core.domain.auth.Subject subject,
                                                             int alertDefinitionId)

findAlertDefinitionsByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.alert.AlertDefinition> findAlertDefinitionsByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                            org.rhq.core.domain.criteria.AlertDefinitionCriteria criteria)

enableAlertDefinitions

int enableAlertDefinitions(org.rhq.core.domain.auth.Subject subject,
                           int[] alertDefinitionIds)

disableAlertDefinitions

int disableAlertDefinitions(org.rhq.core.domain.auth.Subject subject,
                            int[] alertDefinitionIds)

removeAlertDefinitions

int removeAlertDefinitions(org.rhq.core.domain.auth.Subject subject,
                           int[] alertDefinitionIds)

getAlertNotificationConfigurationPreview

String[] getAlertNotificationConfigurationPreview(org.rhq.core.domain.auth.Subject sessionSubject,
                                                  org.rhq.core.domain.alert.notification.AlertNotification[] notifications)


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