org.sakaiproject.component.framework.email
Class TestEmailService

java.lang.Object
  extended byorg.sakaiproject.component.framework.email.TestEmailService
All Implemented Interfaces:
EmailService

public class TestEmailService
extends Object
implements EmailService

BasicEmailService implements the EmailService.

See the EmailService interface for details.

Version:
$Revision: 5554 $
Author:
University of Michigan, Sakai Software Development Team

Field Summary
protected  Logger m_logger
          Dependency: logging service.
protected  ServerConfigurationService m_serverConfigurationService
          Dependency: ServerConfigurationService.
protected  String m_smtp
          Configuration: smtp server to use.
protected  String m_smtpFrom
          Configuration: optional smtp mail envelope return address.
protected  String m_smtpPort
          Configuration: smtp server port to use.
 
Constructor Summary
TestEmailService()
           
 
Method Summary
protected  String arrayToStr(Object[] array)
           
 void destroy()
          Final cleanup.
 void init()
          Final initialization, once all dependencies are set.
protected  String listToStr(List list)
          Work interface methods: org.sakai.service.email.EmailService
 void send(String fromStr, String toStr, String subject, String content, String headerToStr, String replyToStr, List additionalHeaders)
          Creates and sends a generic text MIME message to the address contained in to.
 void sendMail(InternetAddress from, InternetAddress[] to, String subject, String content, InternetAddress[] headerTo, InternetAddress[] replyTo, List additionalHeaders)
          Creates and sends a generic text MIME message to the address contained in to.
 void setLogger(Logger service)
          Dependency: logging service.
 void setServerConfigurationService(ServerConfigurationService service)
          Dependency: ServerConfigurationService.
 void setSmtp(String value)
          Configuration: smtp server to use.
 void setSmtpFrom(String value)
          Configuration: smtp mail envelope return address.
 void setSmtpPort(String value)
          Configuration: smtp server port to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_logger

protected Logger m_logger
Dependency: logging service.


m_serverConfigurationService

protected ServerConfigurationService m_serverConfigurationService
Dependency: ServerConfigurationService.


m_smtp

protected String m_smtp
Configuration: smtp server to use.


m_smtpPort

protected String m_smtpPort
Configuration: smtp server port to use.


m_smtpFrom

protected String m_smtpFrom
Configuration: optional smtp mail envelope return address.

Constructor Detail

TestEmailService

public TestEmailService()
Method Detail

setLogger

public void setLogger(Logger service)
Dependency: logging service.

Parameters:
service - The logging service.

setServerConfigurationService

public void setServerConfigurationService(ServerConfigurationService service)
Dependency: ServerConfigurationService.

Parameters:
service - The ServerConfigurationService.

setSmtp

public void setSmtp(String value)
Configuration: smtp server to use.

Parameters:
value - The smtp server string.

setSmtpPort

public void setSmtpPort(String value)
Configuration: smtp server port to use.

Parameters:
value - The smtp server port string.

setSmtpFrom

public void setSmtpFrom(String value)
Configuration: smtp mail envelope return address.

Parameters:
value - The smtp mail from address string.

init

public void init()
Final initialization, once all dependencies are set.


destroy

public void destroy()
Final cleanup.


listToStr

protected String listToStr(List list)
Work interface methods: org.sakai.service.email.EmailService


arrayToStr

protected String arrayToStr(Object[] array)

sendMail

public void sendMail(InternetAddress from,
                     InternetAddress[] to,
                     String subject,
                     String content,
                     InternetAddress[] headerTo,
                     InternetAddress[] replyTo,
                     List additionalHeaders)
Creates and sends a generic text MIME message to the address contained in to.

Specified by:
sendMail in interface EmailService
Parameters:
from - The address this message is to be listed as coming from.
to - The address(es) this message should be sent to.
subject - The subject of this message.
content - The body of the message.
replyTo - If specified, this is the reply to header address(es).
additionalHeaders - Additional email headers to send (List of String). For example, content type or forwarded headers (may be null)

send

public void send(String fromStr,
                 String toStr,
                 String subject,
                 String content,
                 String headerToStr,
                 String replyToStr,
                 List additionalHeaders)
Creates and sends a generic text MIME message to the address contained in to.

Specified by:
send in interface EmailService
Parameters:
fromStr - The address this message is to be listed as coming from.
toStr - The address(es) this message should be sent to.
subject - The subject of this message.
content - The body of the message.
headerToStr - If specified, this is placed into the message header, but "too" is used for the recipients.
replyToStr - If specified, the reply-to header value.
additionalHeaders - Additional email headers to send (List of String). For example, content type or forwarded headers (may be null)