org.blojsom.plugin.notification
Class AbstractNotification

java.lang.Object
  extended byorg.blojsom.plugin.notification.AbstractNotification
All Implemented Interfaces:
Notification
Direct Known Subclasses:
AbstractVelocityEmailNotification

public abstract class AbstractNotification
extends java.lang.Object
implements Notification


Field Summary
protected  java.lang.String charEncoding
           
protected  java.lang.String contentType
           
protected  java.net.URL emailTemplate
           
protected  java.lang.String mailServer
           
 
Constructor Summary
AbstractNotification(java.net.URL emailTemplate, java.lang.String charEncoding, java.lang.String mailServer, java.lang.String contentType)
          Create a new abstract notification
 
Method Summary
protected  java.lang.String encodeRegexCharacters(java.lang.String string)
          Encode regex characters in a string
protected abstract  java.util.List getBlindCarbonCopyRecipients()
          Retrieve the list of BCC recipients
protected abstract  java.util.List getCarbonCopyRecipients()
          Retrieve the list of CC recipients
protected  java.net.URL getEmailTemplate()
          Retrieve the e-mail template
protected abstract  java.lang.String getMessage()
          Retrieve the e-mail message content
protected abstract  java.util.List getRecipients()
          Retrieve the list of recipients
protected abstract  java.lang.String getSender()
          Retrieve the sender
protected abstract  java.lang.String getSubject()
          Retrieve the subject
 void send()
          Send the e-mail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

charEncoding

protected java.lang.String charEncoding

emailTemplate

protected java.net.URL emailTemplate

mailServer

protected java.lang.String mailServer

contentType

protected java.lang.String contentType
Constructor Detail

AbstractNotification

public AbstractNotification(java.net.URL emailTemplate,
                            java.lang.String charEncoding,
                            java.lang.String mailServer,
                            java.lang.String contentType)
Create a new abstract notification

Parameters:
emailTemplate - E-mail template
charEncoding - Character encoding
mailServer - Mail server name
contentType - Content type
Method Detail

send

public void send()
          throws org.apache.commons.mail.EmailException
Send the e-mail

Specified by:
send in interface Notification
Throws:
org.apache.commons.mail.EmailException - If there is an error sending the e-mail

getSender

protected abstract java.lang.String getSender()
Retrieve the sender

Returns:
Sender

getRecipients

protected abstract java.util.List getRecipients()
Retrieve the list of recipients

Returns:
Recipients

getMessage

protected abstract java.lang.String getMessage()
                                        throws java.lang.Exception
Retrieve the e-mail message content

Returns:
E-mail message
Throws:
java.lang.Exception - If there is an error getting the content

getSubject

protected abstract java.lang.String getSubject()
Retrieve the subject

Returns:
Subject

getCarbonCopyRecipients

protected abstract java.util.List getCarbonCopyRecipients()
Retrieve the list of CC recipients

Returns:
List of CC recipients

getBlindCarbonCopyRecipients

protected abstract java.util.List getBlindCarbonCopyRecipients()
Retrieve the list of BCC recipients

Returns:
List of BCC recipients

encodeRegexCharacters

protected java.lang.String encodeRegexCharacters(java.lang.String string)
Encode regex characters in a string

Parameters:
string - Input
Returns:
Encoded regex characters

getEmailTemplate

protected java.net.URL getEmailTemplate()
Retrieve the e-mail template

Returns:
E-mail template