org.apache.abdera.protocol.client.cache
Class InMemoryCachedResponse

java.lang.Object
  extended by org.apache.abdera.protocol.util.AbstractMessage
      extended by org.apache.abdera.protocol.util.AbstractResponse
          extended by org.apache.abdera.protocol.client.AbstractClientResponse
              extended by org.apache.abdera.protocol.client.cache.CachedResponseBase
                  extended by org.apache.abdera.protocol.client.cache.InMemoryCachedResponse
All Implemented Interfaces:
CachedResponse, ClientResponse, Message, Response, ProtocolConstants

public class InMemoryCachedResponse
extends CachedResponseBase
implements CachedResponse


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.abdera.protocol.Response
Response.ResponseType
 
Field Summary
 
Fields inherited from class org.apache.abdera.protocol.client.cache.CachedResponseBase
cache, initial_age, key
 
Fields inherited from class org.apache.abdera.protocol.client.AbstractClientResponse
abdera, in, now, parser, response_date
 
Fields inherited from class org.apache.abdera.protocol.util.AbstractResponse
nocache_headers, private_headers, smax_age
 
Fields inherited from class org.apache.abdera.protocol.util.AbstractMessage
flags, max_age
 
Fields inherited from interface org.apache.abdera.protocol.util.ProtocolConstants
NOCACHE, NOSTORE, NOTRANSFORM, ONLYIFCACHED, PRIVATE, PROXYREVALIDATE, PUBLIC, REVALIDATE
 
Constructor Summary
InMemoryCachedResponse(Abdera abdera, Cache cache, Object key, ClientResponse response)
           
 
Method Summary
 String getHeader(String header)
          Get the value of the specified header
 String[] getHeaderNames()
          Return a listing of header names
 Map<String,Object[]> getHeaders()
           
 Object[] getHeaders(String header)
          Return multiple values for the specified header
 InputStream getInputStream()
          Get the response payload as an input stream
 String getMethod()
          Return the request method
 int getStatus()
          Get the specific response status code
 String getStatusText()
          Get the response status text
 String getUri()
          Return the request URI.
 void setInputStream(InputStream in)
          Set the response input stream (used internally by Abdera)
 
Methods inherited from class org.apache.abdera.protocol.client.cache.CachedResponseBase
getCache, getCachedTime, getCurrentAge, getFreshnessLifetime, getHowStale, getInitialAge, getKey, getResidentAge, isFresh, release
 
Methods inherited from class org.apache.abdera.protocol.client.AbstractClientResponse
getCharacterEncoding, getDateHeader, getDocument, getDocument, getDocument, getDocument, getParser, getReader, getReader, getServerDate, initResponseDate, parse_cc
 
Methods inherited from class org.apache.abdera.protocol.util.AbstractResponse
getAge, getAllow, getContentLength, getEntityTag, getExpires, getLastModified, getLocation, getNoCacheHeaders, getPrivateHeaders, getSMaxAge, getType, isMustRevalidate, isPrivate, isProxyRevalidate, isPublic, setMaxAge, setMustRevalidate, setNoCache, setNoCacheHeaders, setNoStore, setNoTransform, setPrivate, setPrivateHeaders, setProxyRevalidate, setPublic
 
Methods inherited from class org.apache.abdera.protocol.util.AbstractMessage
check, getCacheControl, getContentLanguage, getContentLocation, getContentType, getDecodedHeader, getDecodedHeaders, getMaxAge, getSlug, isNoCache, isNoStore, isNoTransform, toggle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.abdera.protocol.client.cache.CachedResponse
getCache, getCachedTime, getCurrentAge, getFreshnessLifetime, getHowStale, getInitialAge, getKey, getResidentAge, isFresh
 
Methods inherited from interface org.apache.abdera.protocol.client.ClientResponse
getCharacterEncoding, getDocument, getDocument, getDocument, getDocument, getReader, getReader, getServerDate, release
 
Methods inherited from interface org.apache.abdera.protocol.Response
getAge, getAllow, getContentLength, getEntityTag, getExpires, getLastModified, getLocation, getNoCacheHeaders, getPrivateHeaders, getSMaxAge, getType, isMustRevalidate, isPrivate, isProxyRevalidate, isPublic
 
Methods inherited from interface org.apache.abdera.protocol.Message
getCacheControl, getContentLanguage, getContentLocation, getContentType, getDateHeader, getDecodedHeader, getDecodedHeaders, getMaxAge, getSlug, isNoCache, isNoStore, isNoTransform
 

Constructor Detail

InMemoryCachedResponse

public InMemoryCachedResponse(Abdera abdera,
                              Cache cache,
                              Object key,
                              ClientResponse response)
                       throws IOException
Throws:
IOException
Method Detail

getHeaders

public Map<String,Object[]> getHeaders()

getMethod

public String getMethod()
Description copied from interface: ClientResponse
Return the request method

Specified by:
getMethod in interface ClientResponse

getHeader

public String getHeader(String header)
Description copied from interface: Message
Get the value of the specified header

Specified by:
getHeader in interface Message

getHeaderNames

public String[] getHeaderNames()
Description copied from interface: Message
Return a listing of header names

Specified by:
getHeaderNames in interface Message

getHeaders

public Object[] getHeaders(String header)
Description copied from interface: Message
Return multiple values for the specified header

Specified by:
getHeaders in interface Message

getStatus

public int getStatus()
Description copied from interface: Response
Get the specific response status code

Specified by:
getStatus in interface Response

getStatusText

public String getStatusText()
Description copied from interface: Response
Get the response status text

Specified by:
getStatusText in interface Response

getUri

public String getUri()
Description copied from interface: ClientResponse
Return the request URI. The request was redirected, this will return the new URI

Specified by:
getUri in interface ClientResponse

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from class: AbstractClientResponse
Get the response payload as an input stream

Specified by:
getInputStream in interface ClientResponse
Overrides:
getInputStream in class AbstractClientResponse
Throws:
IOException

setInputStream

public void setInputStream(InputStream in)
Description copied from class: AbstractClientResponse
Set the response input stream (used internally by Abdera)

Specified by:
setInputStream in interface ClientResponse
Overrides:
setInputStream in class AbstractClientResponse


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.