public class CacheService
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CACHE_NAME
Deprecated.
|
static java.lang.String |
CACHE_NAME_SERVERS_AUTO
Deprecated.
|
static java.lang.String |
CACHE_NAME_SERVERS_MANUAL
Deprecated.
|
Constructor and Description |
---|
CacheService(CacheProvider cachePropsProvider) |
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clear all cached data.
|
EndPoint[] |
convertServerMapListToServerList(java.util.List<java.util.Map> listOfServerMaps)
Convert a list of (server-data HashMaps) to an Array of EndPoint objects
ehcache stores (server-data HashMaps)
|
EndPoint[] |
getCachedServerList(java.lang.String cacheKey)
Get cached server list.
|
CacheProvider |
getCacheProvider()
Gets the cache Provider
|
java.util.List<java.util.Map> |
getCacheServersAutoRanking()
Returns the list of auto ranked servers
|
java.util.List<java.util.Map> |
getCacheServersManualRanking()
Returns the list of manual ranked servers
|
int |
getServerRankingLifetime()
Returns the server ranking cache lifetime
|
boolean |
getUseCache()
Is device data being cached by the API or not.
|
void |
setServerCache(EndPoint[] endPoints,
boolean isManual)
Write server list to cache.
|
void |
setServerRankingLifetime(int serverRankListLifetime)
Sets the server ranking cache lifetime
|
void |
setUseCache(boolean useCache)
Setter to cache or not to cache device data.
|
void |
shutdown()
This should be called when shutting down your application.
|
@Deprecated public static final java.lang.String CACHE_NAME
@Deprecated public static final java.lang.String CACHE_NAME_SERVERS_AUTO
@Deprecated public static final java.lang.String CACHE_NAME_SERVERS_MANUAL
public CacheService(CacheProvider cachePropsProvider) throws CacheException
CacheException
public int getServerRankingLifetime()
public void setServerRankingLifetime(int serverRankListLifetime)
serverRankListLifetime
- public CacheProvider getCacheProvider()
public boolean getUseCache()
public void setUseCache(boolean useCache)
useCache
- true = cache data after getting device data from DeviceAtlas cloudpublic void clearCache()
public void shutdown()
public EndPoint[] getCachedServerList(java.lang.String cacheKey) throws CacheException
cacheKey
- cache key Client.CACHE_NAME_SERVERS_AUTO or Client.CACHE_NAME_SERVERS_MANUALCacheException
public EndPoint[] convertServerMapListToServerList(java.util.List<java.util.Map> listOfServerMaps)
public void setServerCache(EndPoint[] endPoints, boolean isManual) throws CacheException
CacheException
public java.util.List<java.util.Map> getCacheServersAutoRanking() throws CacheException
CacheException
public java.util.List<java.util.Map> getCacheServersManualRanking() throws CacheException
CacheException