i2p.susi.webmail
Class MailCache

java.lang.Object
  extended by i2p.susi.webmail.MailCache

 class MailCache
extends Object

Author:
user

Nested Class Summary
static class MailCache.FetchMode
           
 
Constructor Summary
MailCache(POP3MailBox mailbox, String host, int port, String user, String pass)
           
 
Method Summary
 void delete(Collection<String> uidls)
          Mark mail for deletion locally.
 void delete(String uidl)
          Mark mail for deletion locally.
 boolean getMail(MailCache.FetchMode mode)
          Fetch any needed data from pop3 server.
 Mail getMail(String uidl, MailCache.FetchMode mode)
          Fetch any needed data from pop3 server.
 String[] getUIDLs()
          The ones known locally, which will include any known on the server, if connected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailCache

MailCache(POP3MailBox mailbox,
          String host,
          int port,
          String user,
          String pass)
Parameters:
mailbox - non-null
Method Detail

getUIDLs

public String[] getUIDLs()
The ones known locally, which will include any known on the server, if connected. Will not include any marked for deletion.

Since:
0.9.13

getMail

public Mail getMail(String uidl,
                    MailCache.FetchMode mode)
Fetch any needed data from pop3 server.

Parameters:
uidl - message id to get
mode - CACHE_ONLY to not pull from pop server
Returns:
An e-mail or null

getMail

public boolean getMail(MailCache.FetchMode mode)
Fetch any needed data from pop3 server. Mail objects are inserted into the requests. After this, call getUIDLs() to get all known mail UIDLs. MUST already be connected, otherwise returns false.

Parameters:
mode - HEADER or ALL only
Returns:
true if any were fetched
Since:
0.9.13

delete

public void delete(String uidl)
Mark mail for deletion locally. Send delete requests to POP3 then quit and reconnect. No success/failure indication is returned.

Since:
0.9.13

delete

public void delete(Collection<String> uidls)
Mark mail for deletion locally. Send delete requests to POP3 then quit and reconnect. No success/failure indication is returned.

Since:
0.9.13