|
GigaSpaces XAP 10.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AlertManager
The AlertManager is a manager for configuring of alerts, firing of alerts, and registering for alert events.
The alert manager provides two options for configuration of alert configurations - as bulk or one
by one. The AlertConfiguration is the main interface of an alert configuration - a
configuration based on String key-value property pairs.
To configure with a bulk of alert configurations, the configure(AlertConfiguration[])
method can be used. These configurations can be extracted from a resource using an
AlertConfigurationParser. The parser AlertConfigurationParser.parse() returns an
array of AlertConfiguration. The XmlAlertConfigurationParser can be used to parse
the alerts.xml configuration file located under config/alerts.
To Register/Unregister for alert events (of all types), use the AlertTriggeredEventManager to
add/remove AlertTriggeredEventListeners.
The triggerAlert(Alert) method call allows alert triggers to 'fire' an alert and
trigger an event to be sent to all registered alert event listeners.
| Method Summary | ||
|---|---|---|
void |
configure(AlertConfiguration... configurations)
Define an alert configuration for a 'bulk' of configurations. |
|
void |
disableAlert(Class<? extends AlertConfiguration> clazz)
Disables a previously enabled alert. |
|
void |
enableAlert(Class<? extends AlertConfiguration> clazz)
Enable a previously set alert configuration. |
|
AlertTriggeredEventManager |
getAlertTriggered()
|
|
|
getConfig(Class<T> clazz)
Get the currently set alert configuration. |
|
boolean |
isAlertEnabled(Class<? extends AlertConfiguration> clazz)
|
|
boolean |
removeConfig(Class<? extends AlertConfiguration> clazz)
Removes a previously set alert configuration. |
|
void |
setConfig(AlertConfiguration config)
Defines an alert configuration. |
|
void |
triggerAlert(Alert alert)
Trigger an alert event for registered alert event listeners. |
|
| Methods inherited from interface org.openspaces.admin.AdminAware |
|---|
getAdmin |
| Method Detail |
|---|
void configure(AlertConfiguration... configurations)
throws AlertConfigurationException
See the XmlAlertConfigurationParser which can be used to parse the default
alerts.xml configuration file located under config/alerts.
If AlertConfiguration.isEnabled() returns true it is equivalent to
calling (for a predefined alert) disableAlert(Class), followed by
setConfig(AlertConfiguration) followed by enableAlert(Class).
If it returns false it is equivalent to calling (for a predefined alert)
disableAlert(Class) followed by setConfig(AlertConfiguration).
if an alert configuration was not previously set, the current setting will be used.
configurations - the alert configurations (as varargs).
AlertConfigurationException - if the alert is already enabled (need to disable it first).AlertConfigurationParser
void setConfig(AlertConfiguration config)
throws AlertConfigurationException
The AlertConfiguration.isEnabled() is ignored. To enable, call enableAlert(Class).
To perform both operations in a single call, use configure(AlertConfiguration[]).
An exception is raised if the alert is already enabled.
config - the alert configuration
AlertConfigurationException - if the alert is already enabled (need to disable it first).
void enableAlert(Class<? extends AlertConfiguration> clazz)
throws AlertConfigurationException
If the alert is already enabled, the request is silently ignored.
clazz - the class of the alert configuration
AlertConfigurationException - if the alert can't be enabled for any of the following reasons:
void disableAlert(Class<? extends AlertConfiguration> clazz)
throws AlertConfigurationException
If the alert is already disabled, the request is silently ignored.
clazz - the class of the alert configuration
AlertConfigurationException - if the alert configuration was not previously set.boolean isAlertEnabled(Class<? extends AlertConfiguration> clazz)
clazz - the class of the alert configuration
true if the alert is already enabled, false if the alert is
disabled or if it's configuration was not found.
boolean removeConfig(Class<? extends AlertConfiguration> clazz)
throws AlertConfigurationException
An exception is raised if the alert is currently enabled. Disable the alert prior to this call.
clazz - the class of the alert configuration
true if removed ,false if it did not exist in the first
place.
AlertConfigurationException - if the alert configuration can't be removed for any of the following reasons:
<T extends AlertConfiguration> T getConfig(Class<T> clazz)
throws AlertConfigurationException
clazz - the class of the alert configuration
AlertConfigurationException - if the alert configuration was not previously set.void triggerAlert(Alert alert)
alert - an alert.AlertTriggeredEventManager getAlertTriggered()
|
GigaSpaces XAP 10.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||