Package org.opencms.staticexport
Class CmsSharedCachePolicy
java.lang.Object
org.opencms.staticexport.CmsSharedCachePolicy
A cache policy for the shared cache delivery mode.
A policy without a content type is the default policy. Other policies match either an exact content type
or a top-level content type wildcard such as image/*.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longValue used for an optional duration which has not been configured. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the maximum client cache age in seconds.Returns the configured content type selector.longReturns the maximum shared cache age in seconds.longReturns the stale-if-error duration in seconds.booleanReturns whether this is the default policy.voidsetClientMaxAge(String clientMaxAge) Sets the maximum client cache age in seconds.voidsetContentType(String contentType) Sets the content type selector.voidsetSharedMaxAge(String sharedMaxAge) Sets the maximum shared cache age in seconds.voidsetStaleIfError(String staleIfError) Sets the stale-if-error duration in seconds.
-
Field Details
-
DURATION_UNSET
Value used for an optional duration which has not been configured.- See Also:
-
-
Constructor Details
-
CmsSharedCachePolicy
public CmsSharedCachePolicy()
-
-
Method Details
-
getClientMaxAge
Returns the maximum client cache age in seconds.- Returns:
- the maximum client cache age
-
getContentType
Returns the configured content type selector.- Returns:
- the content type selector, or
nullfor the default policy
-
getStaleIfError
Returns the stale-if-error duration in seconds.- Returns:
- the stale-if-error duration, or
DURATION_UNSETif it is not configured
-
isDefault
Returns whether this is the default policy.- Returns:
trueif this is the default policy
-
setClientMaxAge
Sets the maximum client cache age in seconds.- Parameters:
clientMaxAge- the maximum client cache age
-
setContentType
Sets the content type selector.- Parameters:
contentType- the content type selector
-
setStaleIfError
Sets the stale-if-error duration in seconds.- Parameters:
staleIfError- the stale-if-error duration
-