Class CacheEntryAttributes
java.lang.Object
org.apache.commons.jcs3.engine.ElementAttributes
org.openstreetmap.josm.data.cache.CacheEntryAttributes
- All Implemented Interfaces:
Serializable,Cloneable,org.apache.commons.jcs3.engine.behavior.IElementAttributes
Class that contains attributes for JCS cache entries. Parameters are used to properly handle HTTP caching,
and metadata structures, that should be stored together with the cache entry
- Since:
- 8168
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns error message returned while retrieving this object.getEtag()Returns ETag header value, that was returned for this entry.Returns optional exception that was thrown when fetching resource.longReturns when the object expires in milliseconds from Epoch.longReturns last modification of the object in cache in milliseconds from Epoch.private longgetLongAttr(String key) Utility for conversion from String to int, with default to 0, in case of any errorsReturns an unmodifiable Map containing all metadata.intReturns HTTP response code.booleanDetermines if the entry is marked as "no tile at this zoom level".voidSets error related to this object.voidsetErrorMessage(String message) Sets error message related to this object.voidSets the ETag header that was set with this entryvoidSets exception that caused error.voidsetExpirationTime(long expirationTime) sets expiration time for the object in cachevoidsetLastModification(long lastModification) sets last modification of the object in cachevoidsetMetadata(Map<String, String> map) Sets the metadata about cache entry.voidsetNoTileAtZoom(boolean noTileAtZoom) Sets the marker for "no tile at this zoom level"voidsetResponseCode(int responseCode) Sets the HTTP response code that was sent with the cache entryMethods inherited from class org.apache.commons.jcs3.engine.ElementAttributes
addElementEventHandler, addElementEventHandlers, clone, getCreateTime, getElementEventHandlers, getIdleTime, getIsEternal, getIsLateral, getIsRemote, getIsSpool, getLastAccessTime, getMaxLife, getSize, getTimeFactorForMilliseconds, getTimeToLiveSeconds, setCreateTime, setIdleTime, setIsEternal, setIsLateral, setIsRemote, setIsSpool, setLastAccessTime, setLastAccessTimeNow, setMaxLife, setSize, setTimeFactorForMilliseconds, toString
-
Field Details
-
serialVersionUID
- See Also:
-
attrs
-
NO_TILE_AT_ZOOM
- See Also:
-
ETAG
- See Also:
-
LAST_MODIFICATION
- See Also:
-
EXPIRATION_TIME
- See Also:
-
HTTP_RESPONSE_CODE
- See Also:
-
ERROR_MESSAGE
- See Also:
-
EXCEPTION
- See Also:
-
RESERVED_KEYS
-
-
Constructor Details
-
CacheEntryAttributes
public CacheEntryAttributes()Constructs a newCacheEntryAttributes.
-
-
Method Details
-
isNoTileAtZoom
Determines if the entry is marked as "no tile at this zoom level".- Returns:
- if the entry is marked as "no tile at this zoom level"
-
setNoTileAtZoom
Sets the marker for "no tile at this zoom level"- Parameters:
noTileAtZoom- true if this entry is "no tile at this zoom level"
-
getEtag
Returns ETag header value, that was returned for this entry.- Returns:
- ETag header value, that was returned for this entry.
-
setEtag
Sets the ETag header that was set with this entry- Parameters:
etag- Etag header
-
getLongAttr
Utility for conversion from String to int, with default to 0, in case of any errors- Parameters:
key- - integer as string- Returns:
- int value of the string
-
getLastModification
Returns last modification of the object in cache in milliseconds from Epoch.- Returns:
- last modification of the object in cache in milliseconds from Epoch
-
setLastModification
sets last modification of the object in cache- Parameters:
lastModification- time in format of milliseconds from Epoch
-
getExpirationTime
Returns when the object expires in milliseconds from Epoch.- Returns:
- when the object expires in milliseconds from Epoch
-
setExpirationTime
sets expiration time for the object in cache- Parameters:
expirationTime- in format of milliseconds from epoch
-
setResponseCode
Sets the HTTP response code that was sent with the cache entry- Parameters:
responseCode- http status code- Since:
- 8389
-
getResponseCode
Returns HTTP response code.- Returns:
- http status code
- Since:
- 8389
-
setMetadata
Sets the metadata about cache entry. As it stores all data together, with other attributes in common map, some keys might not be stored.- Parameters:
map- metadata to save- Since:
- 8418
-
getMetadata
Returns an unmodifiable Map containing all metadata. Unmodifiable prevents access to metadata within attributes.- Returns:
- unmodifiable Map with cache element metadata
- Since:
- 8418
-
getErrorMessage
Returns error message returned while retrieving this object.- Returns:
- error message returned while retrieving this object
-
setError
Sets error related to this object.- Parameters:
error- error related to this object- Since:
- 10469
-
setErrorMessage
Sets error message related to this object.- Parameters:
message- error message related to this object
-
setException
Sets exception that caused error.- Parameters:
e- exception that caused error
-
getException
Returns optional exception that was thrown when fetching resource.- Returns:
- Optional exception that was thrown when fetching resource
-