org.rhq.enterprise.server.plugin.pc.alert
Class AlertSender<T extends ServerPluginComponent>

java.lang.Object
  extended by org.rhq.enterprise.server.plugin.pc.alert.AlertSender<T>

public abstract class AlertSender<T extends ServerPluginComponent>
extends java.lang.Object

Abstract base class for all Alert senders. In order to implement your AlertSender, you need to at least overwrite #send(). When the AlertSenderManager constructs this object, it will inject the preferences for your specific alert sender type. For each Alert a new instance of your implementation will be called and destroyed afterwards.

Author:
Heiko W. Rupp

Field Summary
protected  Configuration alertParameters
          Configuration from the per alert definition parameters
protected  T pluginComponent
          Global component holding persistent resources
protected  Configuration preferences
          Configuration from the global per plugin type preferences
 
Constructor Summary
AlertSender()
           
 
Method Summary
abstract  SenderResult send(Alert alert)
          This method is called to actually send an alert notification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

preferences

protected Configuration preferences
Configuration from the global per plugin type preferences


alertParameters

protected Configuration alertParameters
Configuration from the per alert definition parameters


pluginComponent

protected T extends ServerPluginComponent pluginComponent
Global component holding persistent resources

Constructor Detail

AlertSender

public AlertSender()
Method Detail

send

public abstract SenderResult send(Alert alert)
This method is called to actually send an alert notification. This is where you implement all functionality. The return value is a SenderResult object, which encodes a log message, success or failure and can contain email addresses that got computed by your AlertSender and which will be sent by the system after *all* senders have been run.

Parameters:
alert - the Alert to operate on
Returns:
result of sending - a ResultState and a message for auditing


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