com.openexchange.mail.cache
Class JSONMessageCacheConfiguration

java.lang.Object
  extended by com.openexchange.mail.cache.JSONMessageCacheConfiguration

public final class JSONMessageCacheConfiguration
extends java.lang.Object

JSONMessageCacheConfiguration - The configuration for JSON message cache.

Author:
Thorben Betten

Method Summary
static JSONMessageCacheConfiguration getInstance()
          Gets the configuration for JSON message cache.
 int getMaxWaitTimeMillis()
          Gets the max. time in milliseconds to wait for a mail's JSON representation to become available in a folder map.
 int getShrinkerIntervalFolderMap()
          Gets the shrinker interval in seconds for folder maps.
 int getShrinkerIntervalUserMap()
          Gets the shrinker interval in seconds for the superior user map.
 int getTTLFolderMap()
          Gets the time-to-live in seconds for an ID-to-JSON mapping put into folder map.
 int getTTLUserMap()
          Gets the time-to-live in seconds for folder maps put into user map.
static void initInstance()
          Initializes the cache instance.
 boolean isEnabled()
          Indicates if the JSON mail cache is enabled.
 boolean isUnseenOnly()
          Whether to prefetch unseen mails only.
 void loadProperties()
          Loads the JSON message cache properties.
static void releaseInstance()
          Releases the cache instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static JSONMessageCacheConfiguration getInstance()
Gets the configuration for JSON message cache.

Returns:
The configuration for JSON message cache.

initInstance

public static void initInstance()
                         throws MailException
Initializes the cache instance.

Throws:
MailException - If initialization fails

releaseInstance

public static void releaseInstance()
Releases the cache instance.


loadProperties

public void loadProperties()
                    throws MailException
Loads the JSON message cache properties.

Throws:
MailException - If loading of properties fails

isEnabled

public boolean isEnabled()
Indicates if the JSON mail cache is enabled.

Returns:
true if the JSON mail cache is enabled; otherwise false

getShrinkerIntervalUserMap

public int getShrinkerIntervalUserMap()
Gets the shrinker interval in seconds for the superior user map.

Returns:
The shrinker interval in seconds for the superior user map

getShrinkerIntervalFolderMap

public int getShrinkerIntervalFolderMap()
Gets the shrinker interval in seconds for folder maps.

Returns:
The shrinker interval in seconds for folder maps

getTTLUserMap

public int getTTLUserMap()
Gets the time-to-live in seconds for folder maps put into user map.

Returns:
The time-to-live in seconds for folder maps put into user map

getTTLFolderMap

public int getTTLFolderMap()
Gets the time-to-live in seconds for an ID-to-JSON mapping put into folder map.

Returns:
The time-to-live in seconds for an ID-to-JSON mapping put into folder map

getMaxWaitTimeMillis

public int getMaxWaitTimeMillis()
Gets the max. time in milliseconds to wait for a mail's JSON representation to become available in a folder map.

Returns:
The max. time in milliseconds to wait for a mail's JSON representation to become available in a folder map

isUnseenOnly

public boolean isUnseenOnly()
Whether to prefetch unseen mails only.

Returns:
true if only unseen mails are prefetched; otherwise false