|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.test.smtp.SimpleSmtpServer
Dummy SMTP server for testing purposes.
Field Summary | |
private boolean |
doStop
Indicates if a stop request has been sent to this server. |
private java.util.List |
receivedMail
Stores all of the email received since this instance started up. |
static int |
SMTP_PORT
SMTP uses port 25. |
private boolean |
stopped
Indicates whether this server is stopped or not. |
Constructor Summary | |
SimpleSmtpServer()
Constructor. |
Method Summary | |
int |
getReceievedEmailSize()
Get the number of messages received. |
java.util.Iterator |
getReceivedEmail()
Get email received by this instance since start up. |
boolean |
isStopped()
Indicates whether this server is stopped or not. |
void |
run()
Main loop of the SMTP server. |
private void |
sendResponse(java.io.PrintWriter out,
SmtpResponse smtpResponse)
Send response to client. |
static SimpleSmtpServer |
start()
Creates an instance of SimpleSmtpServer and starts it. |
void |
stop()
Forces the server to stop after processing the current request. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.List receivedMail
public static final int SMTP_PORT
private volatile boolean stopped
private volatile boolean doStop
Constructor Detail |
public SimpleSmtpServer()
Method Detail |
public void run()
run
in interface java.lang.Runnable
private void sendResponse(java.io.PrintWriter out, SmtpResponse smtpResponse)
out
- socket output streamsmtpResponse
- response objectpublic java.util.Iterator getReceivedEmail()
public int getReceievedEmailSize()
public void stop()
public boolean isStopped()
public static SimpleSmtpServer start()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |