|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.abstracthorizon.mercury.smtp.command.SMTPCommand
org.abstracthorizon.mercury.smtp.command.DataCommand
public class DataCommand
SMTP DATA command.
Field Summary | |
---|---|
protected static byte[] |
CRLF
|
static SimpleDateFormat |
format
|
protected static org.slf4j.Logger |
logger
|
static javax.mail.Session |
mailSession
|
Constructor Summary | |
---|---|
DataCommand()
Constructor |
Method Summary | |
---|---|
protected void |
append(StringBuffer buf,
String part)
Appends elements to header value making it sure it is not over 999 chars. |
protected String |
composeDestMailboxes(List<Path> dest)
Composes Received header's list of destination mailboxes |
protected String |
composeReceivedHeader(SMTPSession connection)
Adds "Received:" header. |
protected void |
execute(SMTPSession connection)
Executed the command |
protected String |
getTCPInfo(Socket socket)
Returns inet address as string |
protected boolean |
postcheck(SMTPSession connection)
Returns true |
protected void |
postProcessing(SMTPSession connection,
boolean hasSuccessfuls)
Sets positive response if there are successful mailboxes |
protected boolean |
precheck(SMTPSession connection)
Returns true in case it is ok with proceeding with the
reading input stream. |
protected boolean |
processExternalMail(SMTPSession connection,
List<Path> externals,
javax.mail.internet.MimeMessage message)
Processes external mails - invokes transport protocol in sending mail further or caching it localing for delayed send. |
protected boolean |
processLocalMailbox(SMTPSession connection,
Path path,
javax.mail.internet.MimeMessage message)
Processes local storage mails. |
protected void |
processMail(SMTPSession connection,
javax.mail.internet.MimeMessage message)
Processes mail. |
protected void |
readExtraParameters(SMTPSession connection,
SMTPScanner scanner)
Obtains extra parameters. |
protected void |
readMail(InputStream in,
OutputStream mail)
Reads raw mail from the input stream. |
Methods inherited from class org.abstracthorizon.mercury.smtp.command.SMTPCommand |
---|
handleConnection |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final byte[] CRLF
public static final SimpleDateFormat format
protected static final org.slf4j.Logger logger
public static javax.mail.Session mailSession
Constructor Detail |
---|
public DataCommand()
Method Detail |
---|
protected void execute(SMTPSession connection) throws CommandException, IOException, ParserException
execute
in class SMTPCommand
connection
- smtp session
CommandException
IOException
ParserException
protected String composeReceivedHeader(SMTPSession connection) throws IOException
connection
- SMTP session
IOException
- io exceptionprotected String getTCPInfo(Socket socket)
socket
- socket
protected String composeDestMailboxes(List<Path> dest)
dest
- list of mailboxes
protected void append(StringBuffer buf, String part)
buf
- buffer to append topart
- new elemnt to added to header valueprotected void readMail(InputStream in, OutputStream mail) throws IOException
in
- input stream mail is read from. Usually input stream from the
socketmail
- output stream mail is written to
IOException
- in case of an exception while reading mailprotected void readExtraParameters(SMTPSession connection, SMTPScanner scanner) throws IOException, ParserException, CommandException
session
- SMTP sessionscanner
- STMP scanner
IOException
- io exception
ParserException
- parsing exception
CommandException
- command exceptionprotected boolean precheck(SMTPSession connection) throws CommandException, IOException
true
in case it is ok with proceeding with the
reading input stream. This method is responsible of sending response back
to the client
session
- SMTP session
true
in case it is ok with proceeding with the
reading input stream.
IOException
CommandException
protected boolean postcheck(SMTPSession connection) throws IOException
true
connection
- smtp session
true
IOException
protected void postProcessing(SMTPSession connection, boolean hasSuccessfuls) throws IOException
connection
- smtp sessionhasSuccessfuls
- has successful mailboxes
IOException
protected void processMail(SMTPSession connection, javax.mail.internet.MimeMessage message) throws IOException
connection
- SMTP sessionmessage
- mime message
IOException
- needed for sending responsesprotected boolean processLocalMailbox(SMTPSession connection, Path path, javax.mail.internet.MimeMessage message)
connection
- SMTP sessionpath
- path objectmessage
- message
true
in case it succededprotected boolean processExternalMail(SMTPSession connection, List<Path> externals, javax.mail.internet.MimeMessage message)
connection
- smtp sessionexternals
- list of Path
objectsmessage
- mime message to be forwarded
true
in case it succeded
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |