SK.gnome.dwarf.mail.smtp.proc.agent
Class ListServer

java.lang.Object
  extended bySK.gnome.dwarf.GenericService
      extended bySK.gnome.dwarf.GenericServer
          extended bySK.gnome.dwarf.thread.ThreadServer
              extended bySK.gnome.dwarf.mail.smtp.proc.MailAgent
                  extended bySK.gnome.dwarf.mail.smtp.proc.agent.ListServer
All Implemented Interfaces:
Preprocessing, SK.gnome.dwarf.Reportable, java.lang.Runnable, SK.gnome.dwarf.Server, SK.gnome.dwarf.Service
Direct Known Subclasses:
FileListServer

public abstract class ListServer
extends MailAgent
implements Preprocessing

Provides generic listserver agent.

A special console ListServer.Command is automatically added to this service to manage the subscription list.


Nested Class Summary
static class ListServer.Command
          Provides a console command for managing the list server.
static class ListServer.Subscriber
          This class represents a list subscriber.
 
Field Summary
 
Fields inherited from class SK.gnome.dwarf.mail.smtp.proc.MailAgent
context, required
 
Fields inherited from class SK.gnome.dwarf.thread.ThreadServer
daemon, thread
 
Fields inherited from class SK.gnome.dwarf.GenericService
initParameters, parent
 
Fields inherited from interface SK.gnome.dwarf.Service
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED
 
Constructor Summary
ListServer(java.lang.String name)
           
 
Method Summary
protected abstract  void addSubscriber(ListServer.Subscriber subscriber)
           
protected abstract  ListServer.Subscriber getSubscriber(java.lang.String address)
           
protected abstract  java.util.Collection getSubscribers()
           
protected  void init(MailAgentContext context)
          Initializes the mail agent.
 void init(SK.gnome.dwarf.Server parent)
          Initializes the service.
protected  void preprocess(MailAgentMessage message, java.util.Collection recipients)
          Processes the message.
protected abstract  void removeSubscriber(ListServer.Subscriber subscriber)
           
 void setAllowLocalPosting(boolean enable)
           
 void setDescription(java.lang.String description)
           
 void setDomain(java.lang.String domain)
           
 void setHelpURL(java.lang.String url)
           
 void setMaintainers(java.lang.String[] addresses)
           
 void setName(java.lang.String name)
           
 void setNotifyRejected(boolean enable)
           
 void setOpen(boolean enable)
           
 void setPassword(java.lang.String password)
           
 void setProtectList(boolean enable)
           
 void setReplyToSender(boolean enable)
           
 void setSubscribeURL(java.lang.String url)
           
 void setUnsubscribeURL(java.lang.String url)
           
protected abstract  void updateSubscriber(ListServer.Subscriber subscriber)
           
 
Methods inherited from class SK.gnome.dwarf.mail.smtp.proc.MailAgent
destroy, filter, isRequired, postprocess, setRequired, storeMessage
 
Methods inherited from class SK.gnome.dwarf.thread.ThreadServer
enableThread, finish, loop, run, setDaemon, shutdown, start, stop
 
Methods inherited from class SK.gnome.dwarf.GenericServer
addService, addService, getAuthenticator, getLogger, getParameters, getService, getServices, getServices, removeService, report
 
Methods inherited from class SK.gnome.dwarf.GenericService
getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getName, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface SK.gnome.dwarf.Service
getFullName, getName, getState, log, log, login, logout
 

Constructor Detail

ListServer

public ListServer(java.lang.String name)
Method Detail

setName

public void setName(java.lang.String name)

setDomain

public void setDomain(java.lang.String domain)

setDescription

public void setDescription(java.lang.String description)

setHelpURL

public void setHelpURL(java.lang.String url)

setSubscribeURL

public void setSubscribeURL(java.lang.String url)

setUnsubscribeURL

public void setUnsubscribeURL(java.lang.String url)

setMaintainers

public void setMaintainers(java.lang.String[] addresses)

setPassword

public void setPassword(java.lang.String password)

setOpen

public void setOpen(boolean enable)

setAllowLocalPosting

public void setAllowLocalPosting(boolean enable)

setProtectList

public void setProtectList(boolean enable)

setReplyToSender

public void setReplyToSender(boolean enable)

setNotifyRejected

public void setNotifyRejected(boolean enable)

init

public void init(SK.gnome.dwarf.Server parent)
          throws SK.gnome.dwarf.ServiceException
Description copied from class: MailAgent
Initializes the service.

Specified by:
init in interface SK.gnome.dwarf.Service
Overrides:
init in class MailAgent
Throws:
SK.gnome.dwarf.ServiceException

init

protected void init(MailAgentContext context)
             throws MailException
Description copied from class: MailAgent
Initializes the mail agent.

Initializes the contained MailFilter instances.

Overrides:
init in class MailAgent
Parameters:
context - the mail context associated with this agent
Throws:
MailException - if an error occured

preprocess

protected void preprocess(MailAgentMessage message,
                          java.util.Collection recipients)
                   throws java.io.IOException,
                          MailException
Description copied from class: MailAgent
Processes the message.

This method is called on the agent only once for each message, just after it has arrived to the mail queue. In order to let this happen, the agent must implement the Preprocessing interface.

The recipients argument is a collection of Recipient objects representing the message recipients, as returned after processing by the mail filter chain. This collection is always non-empty.

Overrides:
preprocess in class MailAgent
Parameters:
message - the queued message
recipients - collection of recipients
Throws:
MailException - if an error occured
java.io.IOException - if an I/O error occured

addSubscriber

protected abstract void addSubscriber(ListServer.Subscriber subscriber)
                               throws MailException
Throws:
MailException

updateSubscriber

protected abstract void updateSubscriber(ListServer.Subscriber subscriber)
                                  throws MailException
Throws:
MailException

removeSubscriber

protected abstract void removeSubscriber(ListServer.Subscriber subscriber)
                                  throws MailException
Throws:
MailException

getSubscriber

protected abstract ListServer.Subscriber getSubscriber(java.lang.String address)
                                                throws MailException
Throws:
MailException

getSubscribers

protected abstract java.util.Collection getSubscribers()
                                                throws MailException
Throws:
MailException


Copyright (c) 2004-2005, Gnome Ltd. All rights reserved.