public class AlertDefinitionManagerBean extends Object implements AlertDefinitionManagerLocal, AlertDefinitionManagerRemote
| Constructor and Description |
|---|
AlertDefinitionManagerBean() |
| Modifier and Type | Method and Description |
|---|---|
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 validateNotificationConfiguration)
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
AlertDefinitionManagerLocal.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 |
updateAlertDefinitionInternal(org.rhq.core.domain.auth.Subject subject,
int alertDefinitionId,
org.rhq.core.domain.alert.AlertDefinition alertDefinition,
boolean resetMatching,
boolean checkPerms,
boolean finalizeNotifications) |
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
AlertDefinitionManagerLocal.createDependentAlertDefinition(Subject, AlertDefinition, int). |
public 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)
findAlertDefinitions in interface AlertDefinitionManagerLocalpublic org.rhq.core.domain.alert.AlertDefinition getAlertDefinitionById(org.rhq.core.domain.auth.Subject subject,
int alertDefinitionId)
getAlertDefinitionById in interface AlertDefinitionManagerLocalpublic List<org.rhq.core.domain.common.composite.IntegerOptionItem> findAlertDefinitionOptionItemsForResource(org.rhq.core.domain.auth.Subject subject, int resourceId)
findAlertDefinitionOptionItemsForResource in interface AlertDefinitionManagerLocalpublic List<org.rhq.core.domain.common.composite.IntegerOptionItem> findAlertDefinitionOptionItemsForGroup(org.rhq.core.domain.auth.Subject subject, int groupId)
findAlertDefinitionOptionItemsForGroup in interface AlertDefinitionManagerLocalpublic int createDependentAlertDefinition(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.alert.AlertDefinition alertDefinition,
int resourceId)
throws InvalidAlertDefinitionException
AlertDefinitionManagerLocalAlertDefinitionManagerLocal.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).
createDependentAlertDefinition in interface AlertDefinitionManagerLocalsubject - the user that is creating the group or template alert definitionalertDefinition - the alert definition on the resourceresourceId - the resourceInvalidAlertDefinitionExceptionpublic int createAlertDefinition(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.alert.AlertDefinition alertDefinition,
Integer resourceId,
boolean validateNotificationConfiguration)
throws InvalidAlertDefinitionException
AlertDefinitionManagerLocalAlertDefinitionManagerLocal.createDependentAlertDefinition(Subject, AlertDefinition, int)
for further discussion of this.createAlertDefinition in interface AlertDefinitionManagerLocalsubject - the user creating the alert definitionalertDefinition - the new alert definition to persistresourceId - the resource id for which the def is being createdvalidateNotificationConfiguration - 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.InvalidAlertDefinitionExceptionpublic int removeAlertDefinitions(org.rhq.core.domain.auth.Subject subject,
int[] alertDefinitionIds)
removeAlertDefinitions in interface AlertDefinitionManagerLocalremoveAlertDefinitions in interface AlertDefinitionManagerRemotepublic int enableAlertDefinitions(org.rhq.core.domain.auth.Subject subject,
int[] alertDefinitionIds)
enableAlertDefinitions in interface AlertDefinitionManagerLocalenableAlertDefinitions in interface AlertDefinitionManagerRemotepublic boolean isEnabled(Integer definitionId)
isEnabled in interface AlertDefinitionManagerLocalpublic boolean isTemplate(Integer definitionId)
isTemplate in interface AlertDefinitionManagerLocalpublic boolean isGroupAlertDefinition(Integer definitionId)
isGroupAlertDefinition in interface AlertDefinitionManagerLocalpublic boolean isResourceAlertDefinition(Integer definitionId)
isResourceAlertDefinition in interface AlertDefinitionManagerLocalpublic int disableAlertDefinitions(org.rhq.core.domain.auth.Subject subject,
int[] alertDefinitionIds)
disableAlertDefinitions in interface AlertDefinitionManagerLocaldisableAlertDefinitions in interface AlertDefinitionManagerRemotepublic void copyAlertDefinitions(org.rhq.core.domain.auth.Subject subject,
Integer[] alertDefinitionIds)
copyAlertDefinitions in interface AlertDefinitionManagerLocalpublic List<org.rhq.core.domain.alert.AlertDefinition> findAllRecoveryDefinitionsById(org.rhq.core.domain.auth.Subject subject, Integer alertDefinitionId)
findAllRecoveryDefinitionsById in interface AlertDefinitionManagerLocalpublic 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
updateAlertDefinition in interface AlertDefinitionManagerLocalresetMatching - 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.InvalidAlertDefinitionExceptionAlertDefinitionUpdateExceptionpublic 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
AlertDefinitionManagerLocalAlertDefinitionManagerLocal.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 AlertDefinitionManagerLocal.updateAlertDefinition(Subject, int, AlertDefinition, boolean) but
does not perform any authorization checks.
updateDependentAlertDefinition in interface AlertDefinitionManagerLocalsubject - the user that is updating the alert definitionInvalidAlertDefinitionExceptionAlertDefinitionUpdateExceptionpublic org.rhq.core.domain.alert.AlertDefinition updateAlertDefinitionInternal(org.rhq.core.domain.auth.Subject subject,
int alertDefinitionId,
org.rhq.core.domain.alert.AlertDefinition alertDefinition,
boolean resetMatching,
boolean checkPerms,
boolean finalizeNotifications)
throws InvalidAlertDefinitionException,
AlertDefinitionUpdateException
updateAlertDefinitionInternal in interface AlertDefinitionManagerLocalInvalidAlertDefinitionExceptionAlertDefinitionUpdateExceptionpublic void purgeInternals(int alertDefinitionId)
purgeInternals in interface AlertDefinitionManagerLocalpublic int purgeUnusedAlertDefinitions()
purgeUnusedAlertDefinitions in interface AlertDefinitionManagerLocalpublic org.rhq.core.domain.alert.AlertDefinition getAlertDefinition(org.rhq.core.domain.auth.Subject subject,
int alertDefinitionId)
getAlertDefinition in interface AlertDefinitionManagerLocalgetAlertDefinition in interface AlertDefinitionManagerRemotepublic 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)
findAlertDefinitionsByCriteria in interface AlertDefinitionManagerLocalfindAlertDefinitionsByCriteria in interface AlertDefinitionManagerRemotepublic String[] getAlertNotificationConfigurationPreview(org.rhq.core.domain.auth.Subject sessionSubject, org.rhq.core.domain.alert.notification.AlertNotification[] notifications)
getAlertNotificationConfigurationPreview in interface AlertDefinitionManagerLocalgetAlertNotificationConfigurationPreview in interface AlertDefinitionManagerRemoteCopyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.