public class CachedResponse extends Object
| Modifier and Type | Field and Description |
|---|---|
static Set<String> |
NON_CACHEABLE_HEADERS
Names of HTTP headers that are automatically excluded from the cached response headers.
|
| Constructor and Description |
|---|
CachedResponse(int statusCode,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
byte[] content) |
| Modifier and Type | Method and Description |
|---|---|
static CachedResponse |
build(int statusCode,
javax.ws.rs.core.MultivaluedMap<String,Object> headers,
byte[] content) |
boolean |
equals(Object obj) |
com.google.common.base.Optional<javax.ws.rs.core.CacheControl> |
getCacheControl()
Get the
HttpHeaders.CACHE_CONTROL header, if set. |
org.joda.time.DateTime |
getDate()
Get the date the response was generated.
|
com.google.common.base.Optional<org.joda.time.DateTime> |
getExpires() |
byte[] |
getResponseContent() |
javax.ws.rs.core.MultivaluedMap<String,String> |
getResponseHeaders()
Immutable map from response header name (case insensitive) to list of header values.
|
int |
getStatusCode() |
boolean |
hasExpiration()
True if this response has a configured expiration time.
|
int |
hashCode() |
boolean |
isExpired(org.joda.time.DateTime now)
True if the response has an expiration time and that expiration is after the provided instant.
|
javax.ws.rs.core.Response.ResponseBuilder |
response(org.joda.time.DateTime now) |
public static CachedResponse build(int statusCode, javax.ws.rs.core.MultivaluedMap<String,Object> headers, byte[] content)
public javax.ws.rs.core.Response.ResponseBuilder response(org.joda.time.DateTime now)
public boolean hasExpiration()
public boolean isExpired(org.joda.time.DateTime now)
public org.joda.time.DateTime getDate()
HttpHeaders.DATE header or current time if no date header is found.public com.google.common.base.Optional<javax.ws.rs.core.CacheControl> getCacheControl()
HttpHeaders.CACHE_CONTROL header, if set.public com.google.common.base.Optional<org.joda.time.DateTime> getExpires()
public byte[] getResponseContent()
public javax.ws.rs.core.MultivaluedMap<String,String> getResponseHeaders()
public int getStatusCode()
Copyright © 2014. All Rights Reserved.