GigaSpaces XAP 10.0.1 API

org.openspaces.admin.alert.config.parser
Class XmlAlertConfigurationParser

java.lang.Object
  extended by org.openspaces.admin.alert.config.parser.XmlAlertConfigurationParser
All Implemented Interfaces:
AlertConfigurationParser

public class XmlAlertConfigurationParser
extends Object
implements AlertConfigurationParser

A simple XML alert configuration parser.

The alert configurations are read from an XML file. For example, the following alert.xml file specifies a CPU Utilization alert configuration, which is enabled, and has three configuration properties.

 <alerts>
     <alert
         class="org.openspaces.admin.alert.config.CpuUtilizationAlertConfiguration"
         enabled="true">
         <property key="high-threshold-perc" value="80" />
         <property key="low-threshold-perc" value="60" />
         <property key="measurement-period-milliseconds" value="60000" />
     </alert>
     
     <alert ...> 
          ...
     </alert>
     
 </alerts>
 
 

The alert XML configuration file can be located using a direct path to the file, or by reference to a resource located in the classpath. The default classpath config directory is "config/alerts/" and the default alert XML configuration file name is "alerts.xml".

Since:
8.0
Author:
Moran Avigdor

Field Summary
static String DEFAULT_ALERT_CONFIG_DIRECTORY
          default alert classpath relative configuration directory
static String DEFAULT_ALERT_RESOURCE_NAME
          default alert configuration file name
 
Constructor Summary
XmlAlertConfigurationParser()
           
XmlAlertConfigurationParser(String resourceName)
           
 
Method Summary
 AlertConfiguration[] parse()
          Parse and return an array of AlertConfiguration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ALERT_CONFIG_DIRECTORY

public static final String DEFAULT_ALERT_CONFIG_DIRECTORY
default alert classpath relative configuration directory

See Also:
Constant Field Values

DEFAULT_ALERT_RESOURCE_NAME

public static final String DEFAULT_ALERT_RESOURCE_NAME
default alert configuration file name

See Also:
Constant Field Values
Constructor Detail

XmlAlertConfigurationParser

public XmlAlertConfigurationParser()
                            throws AlertConfigurationParserException
Throws:
AlertConfigurationParserException

XmlAlertConfigurationParser

public XmlAlertConfigurationParser(String resourceName)
                            throws AlertConfigurationParserException
Throws:
AlertConfigurationParserException
Method Detail

parse

public AlertConfiguration[] parse()
                           throws AlertConfigurationParserException
Description copied from interface: AlertConfigurationParser
Parse and return an array of AlertConfiguration.

Specified by:
parse in interface AlertConfigurationParser
Returns:
a non-null array of AlertConfigurations.
Throws:
AlertConfigurationParserException - if failed to parse.

GigaSpaces XAP 10.0.1 API

Copyright © GigaSpaces.