com.mulesoft.mmc.alert.builder
Class AlertActionBuilder

java.lang.Object
  extended by com.mulesoft.mmc.alert.builder.AlertActionBuilder

public class AlertActionBuilder
extends java.lang.Object

Creates a listener for alerts within the system which takes specified actions. Alerts can be filtered by server name or through a custom AlertFilter. Actions can be taken through an AlertAction class which are typically generated through builders like the EmailActionBuilder or the SnmpActionBuilder.


Constructor Summary
AlertActionBuilder()
           
 
Method Summary
 AlertActionBuilder doAction(AlertAction action)
          The action to take when we receive an alert which makes it through the filter.
 AlertActionBuilder filter(AlertFilter filter)
          An optional filter for alerts.
 AlertListener install(org.springframework.context.ApplicationContext context)
          Installs an AlertListener which will listen for alerts within the system and take a specified action according to the parameters specified when building this class.
 AlertActionBuilder name(java.lang.String name)
          The name of the alert action.
 AlertActionBuilder servers(java.lang.String... servers)
          A list of server names which the action applies to.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlertActionBuilder

public AlertActionBuilder()
Method Detail

name

public AlertActionBuilder name(java.lang.String name)
The name of the alert action. This is used to uninstall previous versions of the action before a new version is installed. It is required.


servers

public AlertActionBuilder servers(java.lang.String... servers)
A list of server names which the action applies to.

Parameters:
servers -
Returns:

filter

public AlertActionBuilder filter(AlertFilter filter)
An optional filter for alerts.

Parameters:
filter -
Returns:

doAction

public AlertActionBuilder doAction(AlertAction action)
The action to take when we receive an alert which makes it through the filter.

Parameters:
action -
Returns:

install

public AlertListener install(org.springframework.context.ApplicationContext context)
                      throws java.lang.Exception
Installs an AlertListener which will listen for alerts within the system and take a specified action according to the parameters specified when building this class.

Throws:
java.lang.Exception