public class POP3MailBox extends Object implements NewMailListener
| Modifier and Type | Class and Description |
|---|---|
static interface |
POP3MailBox.FetchRequest
Request for fetching email data with UIDL and header options.
|
| Constructor and Description |
|---|
POP3MailBox(String host,
int port,
String user,
String pass)
Does not connect.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) boolean |
blockingConnectToServer()
Connect to pop3 server if not connected.
|
void |
close()
Close without waiting for response.
|
(package private) void |
close(boolean shouldWait)
Close and optionally wait for response.
|
boolean |
connectToServer(NewMailListener nml)
Connect to pop3 server if not connected.
|
(package private) void |
deletePending(boolean noWait)
Delete all pending deletions at once.
|
void |
destroy()
Close without waiting for response,
and remove any delayed tasks and resources.
|
void |
foundNewMail(boolean yes)
Relay from the checker to the webmail session object,
which relays to MailCache, which will fetch the mail from us
in a big circle
|
void |
getBodies(Collection<POP3MailBox.FetchRequest> requests)
Fetch headers and/or bodies.
|
Buffer |
getBody(String uidl,
Buffer buffer)
Fetch the body.
|
Buffer |
getHeader(String uidl)
Fetch the header.
|
(package private) long |
getLastActivity()
Timestamp.
|
(package private) long |
getLastChecked()
Timestamp.
|
(package private) Object |
getLock()
For helper threads to lock
|
int |
getNumMails()
Warning - forces a connection.
|
int |
getSize(String uidl)
Get cached size of a message (via previous LIST command).
|
Collection<String> |
getUIDLs()
Only if connected.
|
(package private) boolean |
hasQueuedDeletions()
Do we have UIDLs to delete?
|
(package private) boolean |
isConnected()
Is the connection is still alive
|
String |
lastError() |
void |
queueForDeletion(Collection<String> uidls)
Queue for later deletion.
|
void |
queueForDeletion(String uidl)
Queue for later deletion.
|
void |
setNewMailListener(NewMailListener nml)
Relay from the checker to the webmail session object,
which relays to MailCache, which will fetch the mail from us
in a big circle
|
boolean blockingConnectToServer()
public void close()
void close(boolean shouldWait)
public boolean connectToServer(NewMailListener nml)
void deletePending(boolean noWait)
noWait - fire-and-forget mode, only if connectedpublic void destroy()
public void foundNewMail(boolean yes)
foundNewMail in interface NewMailListenerpublic void getBodies(Collection<POP3MailBox.FetchRequest> requests)
public Buffer getBody(String uidl, Buffer buffer)
uidl - public Buffer getHeader(String uidl)
uidl - long getLastActivity()
long getLastChecked()
Object getLock()
public int getNumMails()
public int getSize(String uidl)
uidl - public Collection<String> getUIDLs()
boolean hasQueuedDeletions()
boolean isConnected()
public String lastError()
public void queueForDeletion(Collection<String> uidls)
public void queueForDeletion(String uidl)
public void setNewMailListener(NewMailListener nml)