|
Jacson | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.spieleck.app.jacson.PluginBase de.spieleck.app.jacson.source.ChunkSourceBase de.spieleck.app.jacson.source.MailSource
This class implements a JacsonChunkSource for emails using.
It supports the POP3 and the IMAP protocolls. When using IMAP processed
mails are marked as being seen and at default only unseen mails are
processed. So you can avoid double processing by using IMAP. If you have to
use POP3 and have to avoid double processing - :( Not possible at the
moment. But remember, it's open source :-)
This class needs the JavaMail and the Java activation framework.
Notice that a mail consists of an header and a body. The header contains
information like subject, sender or receiver. The body contains the actual
text of the mail. To indicate to which part a chunk belongs, the name of
the header field or the value of the constant @link MailSouce#BODY is stored
within the JacsonState connected to @link MailSource#JACSON_STATE_CHUNK_TYPE.
Furthermore a mail starts with a header so whenever you get a header
chunk and the last was a body chunk a new mail began.
For details see
RFC 822.
Nested Class Summary | |
class |
MailSource.MessageParserThread
threaded class for parsing the messages and writing the single lines in a Stack |
Field Summary | |
static java.lang.String |
BODY
indicates that the current chunk is part of the mail's body |
static java.lang.String |
IMAP
String constant used to say that MailSource that it should use the IMAP protocoll for receiving mails |
static java.lang.String |
JACSON_STATE_CHUNK_TYPE
name of the parameter used to indicate the chunk type within JacsonState |
static java.lang.String |
POP3
String constant used to say that MailSource that it should use the POP3 protocoll for receiving mails |
Constructor Summary | |
MailSource(java.lang.String user,
java.lang.String password,
java.lang.String mailServer)
Creates a new instance of Pop3Source with the given settings. |
|
MailSource(java.lang.String user,
java.lang.String password,
java.lang.String mailServer,
javax.mail.search.SearchTerm searchTerm)
A using the given settings but only receives messages that match the given SearchTerm |
Method Summary | |
protected void |
cleanUp()
Cleaning up resources |
protected void |
finalize()
|
static void |
main(java.lang.String[] args)
main method for testing functionality |
java.lang.String |
message()
implementation analog to LineChunkSource |
java.lang.String |
nextChunk()
Deliver a sequence of chunks (that is Strings). |
void |
setProtocoll(java.lang.String protocoll)
sets the protocoll used to retrieve emails. |
void |
startMessageFetching()
receives the message, filters them and starts a new Thread to parse the Messages |
void |
summary()
implementation analog to LineChunkSource |
Methods inherited from class de.spieleck.app.jacson.PluginBase |
getRegReport, getRegState, registerReport, registerState |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.spieleck.app.jacson.JacsonStately |
registerState |
Methods inherited from interface de.spieleck.app.jacson.JacsonReporting |
registerReport |
Field Detail |
public static final java.lang.String BODY
public static final java.lang.String JACSON_STATE_CHUNK_TYPE
public static final java.lang.String IMAP
public static final java.lang.String POP3
Constructor Detail |
public MailSource(java.lang.String user, java.lang.String password, java.lang.String mailServer) throws JacsonException
user
- user of the mailbox readpassword
- users password at the mailbox readmailServer
- server of the mailbox readpublic MailSource(java.lang.String user, java.lang.String password, java.lang.String mailServer, javax.mail.search.SearchTerm searchTerm) throws JacsonException
user
- user of the mailbox readpassword
- users password at the mailbox readmailServer
- server of the mailbox readsearchTerm
- a SearchTerm to select messages to readMethod Detail |
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
protected void cleanUp() throws JacsonException
JacsonException
public void setProtocoll(java.lang.String protocoll)
public void startMessageFetching() throws JacsonException
JacsonException
public java.lang.String message()
public void summary()
summary
in interface JacsonReporting
summary
in class PluginBase
public java.lang.String nextChunk() throws JacsonException
JacsonException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
Spieleck | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |