public final class MailSessionCache
extends java.lang.Object
MailSessionCache - The main session-bound cache for mail module.| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears this cache.
|
boolean |
containsParameter(int accountId,
java.lang.String parameterName)
Checks if a parameter is associated with given account ID and parameter name.
|
static void |
dropInstance(com.openexchange.session.Session session)
Drops the session-bound mail cache.
|
static MailSessionCache |
getInstance(com.openexchange.session.Session session)
Gets the session-bound mail cache.
|
<T> T |
getParameter(int accountId,
java.lang.String parameterName)
Gets the parameter associated with given account ID and parameter name.
|
void |
putParameter(int accountId,
java.lang.String parameterName,
java.lang.Object parameterValue)
Puts parameter into this cache.
|
java.lang.Object |
putParameterIfAbsent(int accountId,
java.lang.String parameterName,
java.lang.Object parameterValue)
(Atomically) Puts parameter into this cache only if no other parameter is associated with given account ID and parameter name.
|
void |
removeAccountParameters(int accountId)
Removes the parameters associated with given account ID
|
java.lang.Object |
removeParameter(int accountId,
java.lang.String parameterName)
Removes the parameter associated with given account ID and parameter name.
|
public static MailSessionCache getInstance(com.openexchange.session.Session session)
session - The session whose mail cache shall be returnedpublic static void dropInstance(com.openexchange.session.Session session)
session - The session whose mail cache shall be droppedpublic <T> T getParameter(int accountId,
java.lang.String parameterName)
accountId - The account IDparameterName - The parameter nameclazz - The parameter value's classnullpublic boolean containsParameter(int accountId,
java.lang.String parameterName)
accountId - The account IDparameterName - The parameter nametrue if a parameter is associated with given account ID and parameter name; otherwise falsepublic void putParameter(int accountId,
java.lang.String parameterName,
java.lang.Object parameterValue)
null value removes the parameter.accountId - The account IDparameterName - The parameter nameparameterValue - The parameter valuepublic java.lang.Object putParameterIfAbsent(int accountId,
java.lang.String parameterName,
java.lang.Object parameterValue)
null value removes the parameter.accountId - The account IDparameterName - The parameter nameparameterValue - The parameter valuepublic java.lang.Object removeParameter(int accountId,
java.lang.String parameterName)
accountId - The account IDparameterName - The parameter namenullpublic void removeAccountParameters(int accountId)
accountId - The account IDpublic void clear()