|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.impl.client.cache.CacheConfig
public class CacheConfig
Java Beans-style configuration for a
CachingHttpClient
.
Field Summary | |
---|---|
static boolean |
DEFAULT_HEURISTIC_CACHING_ENABLED
Default setting for heuristic caching |
static float |
DEFAULT_HEURISTIC_COEFFICIENT
Default coefficient used to heuristically determine freshness lifetime from cache entry. |
static long |
DEFAULT_HEURISTIC_LIFETIME
Default lifetime to be assumed when we cannot calculate freshness heuristically |
static int |
DEFAULT_MAX_CACHE_ENTRIES
Default setting for the maximum number of cache entries that will be retained. |
static int |
DEFAULT_MAX_OBJECT_SIZE_BYTES
Default setting for the maximum object size that will be cached, in bytes. |
static int |
DEFAULT_MAX_UPDATE_RETRIES
Default setting for the number of retries on a failed cache update |
Constructor Summary | |
---|---|
CacheConfig()
|
Method Summary | |
---|---|
float |
getHeuristicCoefficient()
Returns coefficient used in heuristic freshness caching |
long |
getHeuristicDefaultLifetime()
Get the default lifetime to be used if heuristic freshness calculation is not possible |
int |
getMaxCacheEntries()
Returns the maximum number of cache entries the cache will retain. |
int |
getMaxObjectSizeBytes()
Returns the current maximum object size that will be cached. |
int |
getMaxUpdateRetries()
Returns the number of times to retry a cache update on failure |
boolean |
isHeuristicCachingEnabled()
Returns if heuristic freshness caching is in enabled |
boolean |
isSharedCache()
Returns whether the cache will behave as a shared cache or not. |
void |
setHeuristicCachingEnabled(boolean heuristicCachingEnabled)
Set if heuristic freshness caching is enabled |
void |
setHeuristicCoefficient(float heuristicCoefficient)
Set coefficient to be used in heuristic freshness caching |
void |
setHeuristicDefaultLifetime(long heuristicDefaultLifetime)
Set default lifetime to be used if heuristic freshness calculation is not possible |
void |
setMaxCacheEntries(int maxCacheEntries)
Sets the maximum number of cache entries the cache will retain. |
void |
setMaxObjectSizeBytes(int maxObjectSizeBytes)
Specifies the maximum object size that will be eligible for caching. |
void |
setMaxUpdateRetries(int maxUpdateRetries)
Sets the number of times to retry a cache update on failure |
void |
setSharedCache(boolean isSharedCache)
Sets whether the cache should behave as a shared cache or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_MAX_OBJECT_SIZE_BYTES
public static final int DEFAULT_MAX_CACHE_ENTRIES
public static final int DEFAULT_MAX_UPDATE_RETRIES
public static final boolean DEFAULT_HEURISTIC_CACHING_ENABLED
public static final float DEFAULT_HEURISTIC_COEFFICIENT
public static final long DEFAULT_HEURISTIC_LIFETIME
Constructor Detail |
---|
public CacheConfig()
Method Detail |
---|
public int getMaxObjectSizeBytes()
public void setMaxObjectSizeBytes(int maxObjectSizeBytes)
maxObjectSizeBytes
- size in bytespublic boolean isSharedCache()
public void setSharedCache(boolean isSharedCache)
isSharedCache
- true to behave as a shared cache, false to
behave as a non-shared (private) cache.public int getMaxCacheEntries()
public void setMaxCacheEntries(int maxCacheEntries)
public int getMaxUpdateRetries()
public void setMaxUpdateRetries(int maxUpdateRetries)
public boolean isHeuristicCachingEnabled()
public void setHeuristicCachingEnabled(boolean heuristicCachingEnabled)
public float getHeuristicCoefficient()
public void setHeuristicCoefficient(float heuristicCoefficient)
public long getHeuristicDefaultLifetime()
public void setHeuristicDefaultLifetime(long heuristicDefaultLifetime)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |