|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.cache.MailMessageCache
public final class MailMessageCache
MailMessageCache - Caches instances of MailMessage which are prepared for caching by invoking
MailPart.prepareForCaching(); meaning to release all kept content references. Thus only message's header data is going to be
cached.
This cache is highly volatile. With every new list request all caches entries belonging to requesting user are removed. See this cache region's configuration settings in file "@conf-path@/mailcache.ccf" for further information.
| Method Summary | |
|---|---|
boolean |
containsFolderMessages(int accountId,
java.lang.String fullname,
int userId,
int cid)
Detects if cache holds messages belonging to a certain folder. |
boolean |
containsUserMessages(int userId,
int cid)
Detects if cache holds messages belonging to given user. |
static MailMessageCache |
getInstance()
Gets the singleton instance. |
MailMessage[] |
getMessages(java.lang.String[] uids,
int accountId,
java.lang.String fullname,
int userId,
int cid)
Gets the corresponding messages from cache. |
void |
initCache()
Initializes cache reference. |
void |
putMessages(int accountId,
MailMessage[] mails,
int userId,
int cid)
Puts given messages into cache. |
void |
releaseCache()
Releases cache reference. |
static void |
releaseInstance()
Releases the singleton instance. |
void |
removeFolderMessages(int accountId,
java.lang.String fullname,
int userId,
int cid)
Removes cached messages belonging to a certain folder. |
void |
removeMessages(java.lang.String[] uids,
int accountId,
java.lang.String fullname,
int userId,
int cid)
Removes the messages appearing in given UIDs belonging to a certain folder. |
void |
removeUserMessages(int userId,
int cid)
Removes the messages cached for a user. |
void |
updateCachedMessages(int accountId,
java.lang.String fullname,
int userId,
int cid,
MailListField[] changedFields,
java.lang.Object[] newValues)
Updates cached message |
void |
updateCachedMessages(java.lang.String[] uids,
int accountId,
java.lang.String fullname,
int userId,
int cid,
MailListField[] changedFields,
java.lang.Object[] newValues)
Updates cached message |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void initCache()
throws com.openexchange.cache.OXCachingException
com.openexchange.cache.OXCachingException - If initializing the cache reference fails
public void releaseCache()
throws com.openexchange.cache.OXCachingException
com.openexchange.cache.OXCachingException - If clearing cache fails
public static MailMessageCache getInstance()
throws com.openexchange.cache.OXCachingException
com.openexchange.cache.OXCachingException - If instance initialization failedpublic static void releaseInstance()
public void updateCachedMessages(java.lang.String[] uids,
int accountId,
java.lang.String fullname,
int userId,
int cid,
MailListField[] changedFields,
java.lang.Object[] newValues)
uids - The messages' identifiers; pass null update all cached message of given folderaccountId - The account IDfullname - The fullnameuserId - The user identifiercid - The context identifierchangedFields - The changed fieldsnewValues - The new values
public void updateCachedMessages(int accountId,
java.lang.String fullname,
int userId,
int cid,
MailListField[] changedFields,
java.lang.Object[] newValues)
accountId - The account IDfullname - The fullnameuserId - The user identifiercid - The context identifierchangedFields - The changed fieldsnewValues - The new values
public boolean containsUserMessages(int userId,
int cid)
userId - The user IDcid - The context ID
true if messages are present; otherwise false
public boolean containsFolderMessages(int accountId,
java.lang.String fullname,
int userId,
int cid)
accountId - The account IDfullname - The folder fullnameuserId - The user IDcid - The context ID
true if cache holds messages belonging to a certain folder; otherwise false
public void removeUserMessages(int userId,
int cid)
throws com.openexchange.cache.OXCachingException
userId - The user IDcid - The context ID
com.openexchange.cache.OXCachingException
public void removeFolderMessages(int accountId,
java.lang.String fullname,
int userId,
int cid)
accountId - The account IDfullname - The folder fullnameuserId - The user IDcid - The context ID
public void removeMessages(java.lang.String[] uids,
int accountId,
java.lang.String fullname,
int userId,
int cid)
uids - The mail IDs; pass null to remove all associated with folderaccountId - The account IDfullname - The folder fullnameuserId - The user IDcid - The context ID
public MailMessage[] getMessages(java.lang.String[] uids,
int accountId,
java.lang.String fullname,
int userId,
int cid)
null is returned to force a reload from
mail server.
uids - The UIDsaccountId - The account IDfullname - The folder fullnameuserId - The user IDcid - The context ID
MailMessage containing the fetched messages or null
public void putMessages(int accountId,
MailMessage[] mails,
int userId,
int cid)
throws com.openexchange.cache.OXCachingException
accountId - The account IDmails - The messages to cacheuserId - The user IDcid - The context ID
com.openexchange.cache.OXCachingException - If cache put fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||