votorola.a.mail
Class MailResponder

java.lang.Object
  extended by MailResponder
All Implemented Interfaces:
Runnable

@ThreadSafe
public final class MailResponder
extends Object
implements Runnable

The mail responder daemon. The single instance of MailResponder is available via MailResponder.i().


Nested Class Summary
static class MailResponder.ConfigurationContext
          A context for configuring the mail responder daemon.
 
Field Summary
(package private)  MailResponder.ConfigurationContext cc
           
 
Constructor Summary
MailResponder()
          Creates the single instance of MailResponder, and makes it available via i().
 
Method Summary
static JavaScriptIncluder compileConfigurationScript(ElectoralSubserver subserver)
          Executes the configuration script of the mail responder (without making any configuration calls), thus compiling it for subsequent use.
(package private)  File configurationFile()
          The configuration file for this responder daemon.
(package private) static MailResponder i()
          The single instance of MailResponder.
(package private)  URLName inboxStoreURLName()
          The protocol and location of the inbox.
(package private)  boolean isDryRun()
          Returns true if this daemon is to run without making any persistent state changes.
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cc

MailResponder.ConfigurationContext cc
Constructor Detail

MailResponder

MailResponder()
        throws AddressException,
               IOException,
               ScriptException,
               SQLException
Creates the single instance of MailResponder, and makes it available via i().

Throws:
AddressException - if misconfigured
ScriptException - if misconfigured
SQLException - if unable to establish initial database connections
IOException
Method Detail

i

static MailResponder i()
The single instance of MailResponder.


compileConfigurationScript

public static JavaScriptIncluder compileConfigurationScript(ElectoralSubserver subserver)
                                                     throws ScriptException
Executes the configuration script of the mail responder (without making any configuration calls), thus compiling it for subsequent use.

Throws:
ScriptException

configurationFile

File configurationFile()
The configuration file for this responder daemon. It is located at:
votorolaDirectory/vomailrd.js

The language is JavaScript. There are restrictions on the character encoding.


inboxStoreURLName

URLName inboxStoreURLName()
The protocol and location of the inbox. Supported protocols are IMAP, Maildir and POP3. For example:
   "imap:?" (actually, we're unsure of IMAP syntax, and have not tested it), per:
     http://java.sun.com/products/javamail/javadocs/com/sun/mail/imap/package-summary.html

   "maildir:/home/subserverName/.mail"
     http://javamaildir.sourceforge.net/

   "pop3://subserverName:password@host:port" (not yet tested), per:
     http://java.sun.com/products/javamail/javadocs/com/sun/mail/pop3/package-summary.html
   

See Also:
MailResponder.ConfigurationContext.setInboxStoreURLName(String)

isDryRun

boolean isDryRun()
Returns true if this daemon is to run without making any persistent state changes. It will run as usual, in that case, but without actually writing to any database; nor replying to any incoming message; nor altering any other significant state that would persist and affect the next run.

Consequently, each dry run will read the messages of the inbox over and over again, in an endless loop.

See Also:
MailResponder.ConfigurationContext.setDryRun(boolean)

run

public void run()
Specified by:
run in interface Runnable