|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--de.trantor.mail.InboxClient
|
+--de.trantor.mail.Pop3Client
Encapsulates the POP3 protocol as specified in RFC 1939. This class provides a simple interface to a POP3 mailbox. After a session has been established using the open() method, the number of available messages can be queried by calling the getMessageCount() method, and arbitrary messages or their headers can be retrieved from the mailbox using getMessage() or getHeaders(), respectively. Deleting messages is possible using removeMessage(). Each session should be terminated by a call to the close() method.
Note that all message numbering follows the usual Java conventions for vectors. Thus message indices must be numbers ranging from 0 to getMessageCount() - 1, regardless of what the conventions for the actual protocols are. Implementors of new concrete protocol classes have to keep that in mind, too, of course.
SmtpClient,
ImapClient,
Message| Field Summary |
| Fields inherited from class de.trantor.mail.InboxClient |
connection |
| Constructor Summary | |
Pop3Client()
Constructs an instance of the POP3 client. |
|
Pop3Client(Connection connection)
Constructs an instance of the POP3 client with a given Connection instance. |
|
| Method Summary | |
void |
close()
Ends the mailbox session. |
Message |
getHeaders(int index)
Retrieves a message's headers from the mailbox. |
Message |
getMessage(int index)
Retrieves a message from the mailbox. |
Message |
getMessage(int index,
int maxLines)
Retrieves a message from the POP3 mailbox. |
int |
getMessageCount()
Queries the number of messages currently available in the mailbox. |
int |
getSize(int index)
Queries the size of a message. |
java.lang.String |
getUniqueId(int index)
Queries the unique ID of a message as assigned by the server that holds the mailbox. |
void |
open(java.lang.String host,
int port,
boolean ssl,
java.lang.String user,
java.lang.String pass)
Opens a mailbox session. |
void |
removeMessage(int index)
Removes a message from the mailbox. |
| Methods inherited from class de.trantor.mail.InboxClient |
connected, getDebug, open, setDebug |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Pop3Client()
public Pop3Client(Connection connection)
| Method Detail |
public void open(java.lang.String host,
int port,
boolean ssl,
java.lang.String user,
java.lang.String pass)
throws java.io.IOException,
MailException
InboxClient
open in class InboxClientjava.io.IOException
MailExceptionInboxClient.open(String, String, String),
InboxClient.close(),
InboxClient.connected()
public void close()
throws java.io.IOException,
MailException
InboxClient
close in class InboxClientjava.io.IOException
MailExceptionInboxClient.open(java.lang.String, java.lang.String, java.lang.String),
InboxClient.connected()
public int getMessageCount()
throws java.io.IOException,
MailException
InboxClient
getMessageCount in class InboxClientjava.io.IOException
MailExceptionInboxClient.getMessage(int),
InboxClient.getHeaders(int),
InboxClient.removeMessage(int)
public Message getMessage(int index,
int maxLines)
throws java.io.IOException,
MailException
java.io.IOException
MailExceptiongetMessageCount(),
getHeaders(int),
getMessage(int)
public Message getMessage(int index)
throws java.io.IOException,
MailException
InboxClient
getMessage in class InboxClientjava.io.IOException
MailExceptionInboxClient.getMessageCount(),
InboxClient.getHeaders(int)
public Message getHeaders(int index)
throws java.io.IOException,
MailException
InboxClient
getHeaders in class InboxClientjava.io.IOException
MailExceptionInboxClient.getMessageCount(),
InboxClient.getMessage(int)
public void removeMessage(int index)
throws java.io.IOException,
MailException
InboxClient
removeMessage in class InboxClientjava.io.IOException
MailExceptionInboxClient.getMessageCount()
public java.lang.String getUniqueId(int index)
throws java.io.IOException,
MailException
InboxClientMessage numbering follows the usual Java conventions for vectors. Thus the index must be a number ranging from 0 to getMessageCount() - 1.
getUniqueId in class InboxClientjava.io.IOException
MailExceptionInboxClient.getMessageCount()
public int getSize(int index)
throws java.io.IOException,
MailException
InboxClientMessage numbering follows the usual Java conventions for vectors. Thus the index must be a number ranging from 0 to getMessageCount() - 1.
getSize in class InboxClientjava.io.IOException
MailExceptionInboxClient.getMessageCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||