javatools.smtp
Class SmtpProcessor

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--javatools.smtp.SmtpProcessor
All Implemented Interfaces:
java.lang.Runnable

public abstract class SmtpProcessor
extends java.lang.Thread

A class which can process a single incoming email message. You need to inherit this class and implement one or both of the process() methods, the accountExists method and the canRelay method.


Field Summary
(package private)  java.lang.String cr
           
(package private)  int maxThreads
           
(package private)  java.net.Socket socket
           
(package private)  int timeout
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SmtpProcessor(java.net.Socket socket, java.lang.ThreadGroup group)
           
 
Method Summary
abstract  java.lang.String cannotAccept(AcceptRequest ar)
           
 java.net.Socket getSocket()
           
 void print(java.io.PrintWriter out, java.lang.String msg)
           
 void process(EmailPath sender, EmailPath recipient, byte[] data)
          Processes and email message with one recipient.
 void process(StoreRequest sr)
          Processes an email message with possibly multiple recipients.
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

socket

java.net.Socket socket

timeout

int timeout

maxThreads

int maxThreads

cr

java.lang.String cr
Constructor Detail

SmtpProcessor

public SmtpProcessor(java.net.Socket socket,
                     java.lang.ThreadGroup group)
Method Detail

getSocket

public java.net.Socket getSocket()

print

public void print(java.io.PrintWriter out,
                  java.lang.String msg)

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

process

public void process(EmailPath sender,
                    EmailPath recipient,
                    byte[] data)
             throws SmtpException
Processes and email message with one recipient.

Parameters:
sender - Description of Parameter
recipient - Description of Parameter
data - Description of Parameter
Throws:
SmtpException - Description of Exception

process

public void process(StoreRequest sr)
             throws SmtpException
Processes an email message with possibly multiple recipients. An inheriting implementation can either redefine this method or else use this default implementation and implement the single recipient process method.

Parameters:
sr - Description of Parameter
Throws:
SmtpException - Description of Exception

cannotAccept

public abstract java.lang.String cannotAccept(AcceptRequest ar)
                                       throws SmtpException
SmtpException