|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.ehcache.constructs.web.PageInfo
public class PageInfo
A Serializable representation of a HttpServletResponse.
| Constructor Summary | |
|---|---|
PageInfo(int statusCode,
java.lang.String contentType,
java.util.Collection cookies,
byte[] body,
boolean storeGzipped,
long timeToLiveSeconds,
java.util.Collection<Header<? extends java.io.Serializable>> headers)
Creates a PageInfo object representing the "page". |
|
PageInfo(int statusCode,
java.lang.String contentType,
java.util.Collection headers,
java.util.Collection cookies,
byte[] body,
boolean storeGzipped,
long timeToLiveSeconds)
Deprecated. use #PageInfo(int, String, Collection, Collection, Collection, Collection, byte[], boolean, long) |
|
| Method Summary | |
|---|---|
java.lang.String |
getContentType()
|
java.util.Date |
getCreated()
The Date this PageInfo object was created |
byte[] |
getGzippedBody()
|
java.util.List<Header<? extends java.io.Serializable>> |
getHeaders()
|
java.util.List |
getResponseHeaders()
Deprecated. use getHeaders() |
java.util.List |
getSerializableCookies()
Returns the cookies of the response. |
int |
getStatusCode()
Returns the status code of the response. |
long |
getTimeToLiveSeconds()
The time to live in seconds. |
byte[] |
getUngzippedBody()
|
boolean |
hasGzippedBody()
|
boolean |
hasUngzippedBody()
|
static boolean |
isGzipped(byte[] candidate)
Checks the first two bytes of the candidate byte array for the magic number 0x677a. |
boolean |
isOk()
Returns true if the response is Ok. |
protected void |
setTimeToLiveWithCheckForNeverExpires(long timeToLiveSeconds)
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html To mark a response as "never expires," an origin server sends an Expires date approximately one year from the time the response is sent. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Deprecated
public PageInfo(int statusCode,
java.lang.String contentType,
java.util.Collection headers,
java.util.Collection cookies,
byte[] body,
boolean storeGzipped,
long timeToLiveSeconds)
throws AlreadyGzippedException
#PageInfo(int, String, Collection, Collection, Collection, Collection, byte[], boolean, long)
statusCode - contentType - headers - cookies - body - storeGzipped - set this to false for images and page fragments which should nevertimeToLiveSeconds - the time to Live in seconds. 0 means maximum, which is one year per RFC2616.
AlreadyGzippedException
public PageInfo(int statusCode,
java.lang.String contentType,
java.util.Collection cookies,
byte[] body,
boolean storeGzipped,
long timeToLiveSeconds,
java.util.Collection<Header<? extends java.io.Serializable>> headers)
throws AlreadyGzippedException
statusCode - contentType - cookies - body - storeGzipped - set this to false for images and page fragments which should nevertimeToLiveSeconds - the time to Live in seconds. 0 means maximum, which is one year per RFC2616.headers -
AlreadyGzippedException| Method Detail |
|---|
protected void setTimeToLiveWithCheckForNeverExpires(long timeToLiveSeconds)
timeToLiveSeconds - accepts 0, which means eternal. If the time is 0 or > one year, it is set to one
year in accordance with the RFC.
Note: PageInfo does not hold a reference to the ehcache Element and therefore does not know what the
Element ttl is. It would normally make most sense to set the TTL to the same as the element expiry.public static boolean isGzipped(byte[] candidate)
>>14 beshort 0x677a (gzipped)
candidate - the byte array to check
public java.lang.String getContentType()
public byte[] getGzippedBody()
@Deprecated public java.util.List getResponseHeaders()
getHeaders()
public java.util.List<Header<? extends java.io.Serializable>> getHeaders()
public java.util.List getSerializableCookies()
public int getStatusCode()
public byte[] getUngzippedBody()
throws java.io.IOException
java.io.IOExceptionpublic boolean hasGzippedBody()
public boolean hasUngzippedBody()
public boolean isOk()
public java.util.Date getCreated()
Date this PageInfo object was created
public long getTimeToLiveSeconds()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||