org.alfresco.email.server
Class EmailServer

java.lang.Object
  extended by org.springframework.extensions.surf.util.AbstractLifecycleBean
      extended by org.alfresco.email.server.EmailServer
All Implemented Interfaces:
java.util.EventListener, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener
Direct Known Subclasses:
SubethaEmailServer

public abstract class EmailServer
extends org.springframework.extensions.surf.util.AbstractLifecycleBean

Base implementation of an email server.

Since:
2.2

Field Summary
 
Fields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
log
 
Constructor Summary
protected EmailServer()
           
 
Method Summary
protected  void filterSender(java.lang.String sender)
          Filter incoming message by its sender e-mail address.
protected  java.lang.String getDomain()
           
protected  EmailService getEmailService()
           
protected  int getMaxConnections()
          Returns the maximum number of connection accepted by the server.
protected  int getPort()
           
static void main(java.lang.String[] args)
           
protected  void onBootstrap(org.springframework.context.ApplicationEvent event)
          
protected  void onShutdown(org.springframework.context.ApplicationEvent event)
          
 void setAllowedSenders(java.lang.String allowedSenders)
          Set the allowed senders as a comma separated list.
 void setAllowedSendersList(java.util.List allowedSenders)
           
 void setBlockedSenders(java.lang.String blockedSenders)
          Set the blocked senders as a comma separated list.
 void setBlockedSendersList(java.util.List blockedSenders)
           
 void setDomain(java.lang.String domain)
           
 void setEmailService(EmailService emailService)
           
 void setEnabled(boolean enabled)
           
 void setMaxConnections(int maxConnections)
          Sets the maximum number of connection accepted by the server
 void setPort(int port)
           
abstract  void shutdown()
          Method is called when server is shutting down.
abstract  void startup()
          Method is called when server is starting up.
 
Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailServer

protected EmailServer()
Parameters:
serverConfiguration - Server configuration
Method Detail

setEnabled

public void setEnabled(boolean enabled)
Parameters:
enabled - Enable/disable server

getDomain

protected java.lang.String getDomain()

setDomain

public void setDomain(java.lang.String domain)

getPort

protected int getPort()

setPort

public void setPort(int port)
Parameters:
port - SMTP port (25 is default)

getMaxConnections

protected int getMaxConnections()
Returns the maximum number of connection accepted by the server.

Returns:
the maximum number of connections

setMaxConnections

public void setMaxConnections(int maxConnections)
Sets the maximum number of connection accepted by the server

Parameters:
maxConnections -

setBlockedSenders

public void setBlockedSenders(java.lang.String blockedSenders)
Set the blocked senders as a comma separated list. The entries will be trimmed of all whitespace.

Parameters:
blockedSenders - a comman separated list of blocked senders

setBlockedSendersList

public void setBlockedSendersList(java.util.List blockedSenders)
Parameters:
blockedSenders - a list of senders that are not allowed to email in

setAllowedSenders

public void setAllowedSenders(java.lang.String allowedSenders)
Set the allowed senders as a comma separated list. The entries will be trimmed of all whitespace.

Parameters:
allowedSenders - a comman separated list of blocked senders

setAllowedSendersList

public void setAllowedSendersList(java.util.List allowedSenders)
Parameters:
allowedSenders - a list of senders that are allowed to email in

getEmailService

protected EmailService getEmailService()
Returns:
the service interface to interact with

setEmailService

public void setEmailService(EmailService emailService)
Parameters:
emailService - the service interface to interact with

filterSender

protected void filterSender(java.lang.String sender)
Filter incoming message by its sender e-mail address.

Parameters:
sender - An e-mail address of sender
Throws:
EmailMessageException - if the e-mail is rejected accordingly with blocked and allowed lists

startup

public abstract void startup()
Method is called when server is starting up.


shutdown

public abstract void shutdown()
Method is called when server is shutting down.


onBootstrap

protected void onBootstrap(org.springframework.context.ApplicationEvent event)

Specified by:
onBootstrap in class org.springframework.extensions.surf.util.AbstractLifecycleBean

onShutdown

protected void onShutdown(org.springframework.context.ApplicationEvent event)

Specified by:
onShutdown in class org.springframework.extensions.surf.util.AbstractLifecycleBean

main

public static void main(java.lang.String[] args)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.