Package org.opencms.flex
Class CmsFlexRequestContextInfo
java.lang.Object
org.opencms.flex.CmsFlexRequestContextInfo
Contains information about the OpenCms request context required by the
Flex implementation.
An instance of this class is attached to every CmsRequestContext
as
an attribute as soon as the request context is wrapped in a flex response.
Information about the "last modified" and "expire" times of VFS resources are
stored in this Object.
- Since:
- 6.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the "expires" date for this context.long
Returns the "last modified" date for this context.void
merge
(CmsFlexRequestContextInfo other) Merges this context info with the values from the other context info.void
updateDateExpires
(long dateExpires) Updates the "expires" date for this context with the given value.void
updateDateLastModified
(long dateLastModified) Updates the "last modified" date for this context with the given value.void
updateDates
(long dateLastModified, long dateExpires) Updates both the "last modified" and the "expires" date for this context with the given values.void
updateFromResource
(CmsResource resource) Updates the "last modified" date for this context as well as the "expires" date with the values from a given resource.
-
Constructor Details
-
CmsFlexRequestContextInfo
public CmsFlexRequestContextInfo()Public constructor.
-
-
Method Details
-
getDateExpires
Returns the "expires" date for this context.- Returns:
- the "expires" date for this context
-
getDateLastModified
Returns the "last modified" date for this context.- Returns:
- the "last modified" date for this context
-
merge
Merges this context info with the values from the other context info.- Parameters:
other
- the context info to merge with
-
updateDateExpires
Updates the "expires" date for this context with the given value.- Parameters:
dateExpires
- the value to update the "expires" date with
-
updateDateLastModified
Updates the "last modified" date for this context with the given value.The currently stored value is only updated with the new value if the new value is either larger (i.e. newer) then the stored value, or if the new value is less then zero, which indicates that the "last modified" optimization can not be used because the element is dynamic.
- Parameters:
dateLastModified
- the value to update the "last modified" date with
-
updateDates
Updates both the "last modified" and the "expires" date for this context with the given values.- Parameters:
dateLastModified
- the value to update the "last modified" date withdateExpires
- the value to update the "expires" date with
-
updateFromResource
Updates the "last modified" date for this context as well as the "expires" date with the values from a given resource.The "expires" date is the calculated from the given date values of resource release and expiration and also the current time.
- Parameters:
resource
- the resource to use for updating the context values
-