|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--de.trantor.mail.InboxClient
This class provides an abstraction for the various protocols that are used to access a mailbox (currently POP3 and IMAP). The first thing an application should do is create an instance of a concrete protocol using the getInstance() method. After a session has been established using the open() method on this instance, 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.
Pop3Client,
ImapClient| Field Summary | |
protected Connection |
connection
Holds the socket used for communication with the server. |
| Constructor Summary | |
protected |
InboxClient(Connection connection)
Initializes the Connection object belonging to this InboxClient. |
| Method Summary | |
abstract void |
close()
Ends the mailbox session. |
boolean |
connected()
Returns true, if the client is currently connected to an SMTP server. |
boolean |
getDebug()
Queries the current value of the debugging flag. |
abstract Message |
getHeaders(int index)
Retrieves a message's headers from the mailbox. |
abstract Message |
getMessage(int index)
Retrieves a message from the mailbox. |
abstract int |
getMessageCount()
Queries the number of messages currently available in the mailbox. |
abstract int |
getSize(int index)
Queries the size of a message. |
abstract java.lang.String |
getUniqueId(int index)
Queries the unique ID of a message as assigned by the server that holds the mailbox. |
abstract void |
open(java.lang.String host,
int port,
boolean ssl,
java.lang.String user,
java.lang.String pass)
Opens a mailbox session. |
void |
open(java.lang.String host,
java.lang.String user,
java.lang.String pass)
Opens a mailbox session. |
abstract void |
removeMessage(int index)
Removes a message from the mailbox. |
void |
setDebug(boolean debug)
Controls the output of debugging information to standard output. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Connection connection
| Constructor Detail |
protected InboxClient(Connection connection)
| Method Detail |
public void open(java.lang.String host,
java.lang.String user,
java.lang.String pass)
throws java.lang.Exception,
java.io.IOException,
MailException
java.lang.Exception
java.io.IOException
MailExceptionopen(String, int, boolean, String, String),
close(),
connected()
public abstract void open(java.lang.String host,
int port,
boolean ssl,
java.lang.String user,
java.lang.String pass)
throws java.lang.Exception,
java.io.IOException,
MailException
java.lang.Exception
java.io.IOException
MailExceptionopen(String, String, String),
close(),
connected()
public abstract void close()
throws java.io.IOException,
MailException
java.io.IOException
MailExceptionopen(java.lang.String, java.lang.String, java.lang.String),
connected()public boolean connected()
open(java.lang.String, java.lang.String, java.lang.String),
close()
public abstract int getMessageCount()
throws java.io.IOException,
MailException
java.io.IOException
MailExceptiongetMessage(int),
getHeaders(int),
removeMessage(int)
public abstract Message getMessage(int index)
throws java.io.IOException,
MailException
java.io.IOException
MailExceptiongetMessageCount(),
getHeaders(int)
public abstract Message getHeaders(int index)
throws java.io.IOException,
MailException
java.io.IOException
MailExceptiongetMessageCount(),
getMessage(int)
public abstract java.lang.String getUniqueId(int index)
throws java.io.IOException,
MailException
Message numbering follows the usual Java conventions for vectors. Thus the index must be a number ranging from 0 to getMessageCount() - 1.
java.io.IOException
MailExceptiongetMessageCount()
public abstract int getSize(int index)
throws java.io.IOException,
MailException
Message numbering follows the usual Java conventions for vectors. Thus the index must be a number ranging from 0 to getMessageCount() - 1.
java.io.IOException
MailExceptiongetMessageCount()
public abstract void removeMessage(int index)
throws java.io.IOException,
MailException
java.io.IOException
MailExceptiongetMessageCount()public void setDebug(boolean debug)
getDebug()public boolean getDebug()
setDebug(boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||