com.sun.slamd.server
Class SMTPMailer

java.lang.Object
  extended bycom.sun.slamd.server.SMTPMailer
All Implemented Interfaces:
ConfigSubscriber

public class SMTPMailer
extends java.lang.Object
implements ConfigSubscriber

This class provides a means of sending an e-mail message over SMTP as defined in RFC 821.


Field Summary
static java.lang.String CONFIG_SUBSCRIBER_NAME
          The name used to register the mailer as a subscriber to the configuration handler.
 
Constructor Summary
SMTPMailer(SLAMDServer slamdServer)
          Creates a new instance of this SMTP mailer.
 
Method Summary
 java.lang.String getServletBaseURI()
          Retrieves the URL that can be used to access the admin interface.
 java.lang.String getSubscriberName()
          Retrieves the name that the scheduler uses to subscribe to the configuration handler in order to be notified of configuration changes.
 ParameterList getSubscriberParameters()
          Retrieves the set of configuration parameters associated with this configuration subscriber.
 boolean isEnabled()
          Indicates whether this mailer is currently enabled.
 void refreshSubscriberConfiguration()
          Re-reads all configuration information used by the SLAMD scheduler.
 void refreshSubscriberConfiguration(java.lang.String parameterName)
          Re-reads the configuration information for the specified parameter.
 void sendMessage(java.lang.String[] recipients, java.lang.String subject, java.lang.String message)
          Sends a mail message to all configured recipients to notify them that the specified critical event has occurred.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_SUBSCRIBER_NAME

public static final java.lang.String CONFIG_SUBSCRIBER_NAME
The name used to register the mailer as a subscriber to the configuration handler.

See Also:
Constant Field Values
Constructor Detail

SMTPMailer

public SMTPMailer(SLAMDServer slamdServer)
Creates a new instance of this SMTP mailer.

Parameters:
slamdServer - The SLAMD server instance with which this mailer is associated.
Method Detail

isEnabled

public boolean isEnabled()
Indicates whether this mailer is currently enabled.

Returns:
true if this mailer is enabled, or false if it is not.

getServletBaseURI

public java.lang.String getServletBaseURI()
Retrieves the URL that can be used to access the admin interface.

Returns:
The URL that can be used to access the admin interface.

sendMessage

public void sendMessage(java.lang.String[] recipients,
                        java.lang.String subject,
                        java.lang.String message)
Sends a mail message to all configured recipients to notify them that the specified critical event has occurred.

Parameters:
recipients - The addresses of the recipients to which the message should be sent.
subject - The subject to use for the message.
message - The body of the mail message to be sent.

getSubscriberName

public java.lang.String getSubscriberName()
Retrieves the name that the scheduler uses to subscribe to the configuration handler in order to be notified of configuration changes.

Specified by:
getSubscriberName in interface ConfigSubscriber
Returns:
The name that the scheduler uses to subscribe to the configuration handler in order to be notified of configuration changes.

getSubscriberParameters

public ParameterList getSubscriberParameters()
Retrieves the set of configuration parameters associated with this configuration subscriber.

Specified by:
getSubscriberParameters in interface ConfigSubscriber
Returns:
The set of configuration parameters associated with this configuration subscriber.

refreshSubscriberConfiguration

public void refreshSubscriberConfiguration()
Re-reads all configuration information used by the SLAMD scheduler. In this case, the only option is the delay between iterations of the scheduler loop.

Specified by:
refreshSubscriberConfiguration in interface ConfigSubscriber

refreshSubscriberConfiguration

public void refreshSubscriberConfiguration(java.lang.String parameterName)
Re-reads the configuration information for the specified parameter. In this case, the only option is the delay between iterations of the scheduler loop.

Specified by:
refreshSubscriberConfiguration in interface ConfigSubscriber
Parameters:
parameterName - The name of the parameter to re-read from the configuration.