public class CmsFlexRequestContextInfo
extends java.lang.Object
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.
构造器和说明 |
---|
CmsFlexRequestContextInfo()
Public constructor.
|
限定符和类型 | 方法和说明 |
---|---|
long |
getDateExpires()
Returns the "expires" date for this context.
|
long |
getDateLastModified()
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.
|
public long getDateExpires()
public long getDateLastModified()
public void merge(CmsFlexRequestContextInfo other)
other
- the context info to merge withpublic void updateDateExpires(long dateExpires)
dateExpires
- the value to update the "expires" date withpublic void updateDateLastModified(long dateLastModified)
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.
dateLastModified
- the value to update the "last modified" date withpublic void updateDates(long dateLastModified, long dateExpires)
dateLastModified
- the value to update the "last modified" date withdateExpires
- the value to update the "expires" date withpublic void updateFromResource(CmsResource resource)
The "expires" date is the calculated from the given date values of resource release and expiration and also the current time.
resource
- the resource to use for updating the context values