|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.cache.MailAccessCache
public final class MailAccessCache
MailAccessCache - A very volatile cache for already connected instances of MailAccess.
Only one mail access can be cached per user and is dedicated to fasten sequential mail requests
| Method Summary | |
|---|---|
void |
clearUserEntries(com.openexchange.session.Session session)
Clears the cache entries kept for specified user. |
boolean |
containsMailAccess(com.openexchange.session.Session session,
int accountId)
Checks if cache already holds a user-bound mail access for specified account. |
static MailAccessCache |
getInstance()
Gets the singleton instance. |
void |
initCache()
Initializes cache reference. |
boolean |
putMailAccess(com.openexchange.session.Session session,
int accountId,
MailAccess<? extends IMailFolderStorage,? extends IMailMessageStorage> mailAccess)
Puts given mail access into cache if none user-bound connection is already contained in cache. |
void |
releaseCache()
Releases cache reference. |
static void |
releaseInstance()
Releases the singleton instance. |
MailAccess<? extends IMailFolderStorage,? extends IMailMessageStorage> |
removeMailAccess(com.openexchange.session.Session session,
int accountId)
Removes and returns a mail access from cache. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static MailAccessCache getInstance()
throws MailException
MailException - If instance initialization failspublic static void releaseInstance()
public void initCache()
throws MailException
MailException - If initializing the time-out map reference failspublic void releaseCache()
public MailAccess<? extends IMailFolderStorage,? extends IMailMessageStorage> removeMailAccess(com.openexchange.session.Session session,
int accountId)
session - The sessionaccountId - The account ID
MailAccess or null
public boolean putMailAccess(com.openexchange.session.Session session,
int accountId,
MailAccess<? extends IMailFolderStorage,? extends IMailMessageStorage> mailAccess)
session - The sessionaccountId - The account IDmailAccess - The mail access to put into cache
true if mail access could be successfully cached; otherwise false
public boolean containsMailAccess(com.openexchange.session.Session session,
int accountId)
session - The sessionaccountId - The account ID
true if a user-bound mail access is already present in cache; otherwise false
public void clearUserEntries(com.openexchange.session.Session session)
throws MailException
session - The session
MailException - If clearing user entries fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||