org.apache.abdera.protocol.client
Class CommonsResponse

java.lang.Object
  extended by org.apache.abdera.protocol.util.AbstractResponse
      extended by org.apache.abdera.protocol.client.AbstractClientResponse
          extended by org.apache.abdera.protocol.client.CommonsResponse
All Implemented Interfaces:
ClientResponse, Response, ResponseInfo, ProtocolConstants

public class CommonsResponse
extends AbstractClientResponse
implements ClientResponse


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.AbstractClientResponse
abdera, in, now, parser, response_date
 
Fields inherited from class org.apache.abdera.protocol.util.AbstractResponse
flags, max_age, nocache_headers, private_headers, smax_age
 
Fields inherited from interface org.apache.abdera.protocol.util.ProtocolConstants
NOCACHE, NOSTORE, NOTRANSFORM, ONLYIFCACHED, PRIVATE, PROXYREVALIDATE, PUBLIC, REVALIDATE
 
Constructor Summary
protected CommonsResponse(Abdera abdera, org.apache.commons.httpclient.HttpMethod method)
           
 
Method Summary
 java.util.Date getDateHeader(java.lang.String header)
          Return the named HTTP header as a java.util.Date
 java.lang.String getHeader(java.lang.String header)
          Return the value of the named HTTP header
 java.lang.String[] getHeaderNames()
          Return a listing of HTTP header names
 java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getHeaders()
          Return all of the HTTP headers
 java.util.List<java.lang.Object> getHeaders(java.lang.String header)
          Return the values of the named HTTP header
 org.apache.commons.httpclient.HttpMethod getHttpMethod()
           
 java.io.InputStream getInputStream()
          Return the inputstream for reading the content of the response.
 java.lang.String getMethod()
          Return the request method
 int getStatus()
          Return the status code of the response
 java.lang.String getStatusText()
          Return the status text of the response
 java.lang.String getUri()
          Return the request URI
 void release()
          Release the resources associated with this response
 
Methods inherited from class org.apache.abdera.protocol.client.AbstractClientResponse
getDocument, getDocument, getDocument, getDocument, getParser, getServerDate, parse_cc, setInputStream
 
Methods inherited from class org.apache.abdera.protocol.util.AbstractResponse
getAge, getAllow, getCacheControl, getContentLanguage, getContentLength, getContentLocation, getContentType, getEntityTag, getExpires, getLastModified, getLocation, getMaxAge, getNoCacheHeaders, getPrivateHeaders, getSlug, getSMaxAge, getType, getUriHeader, isMustRevalidate, isNoCache, isNoStore, isNoTransform, isPrivate, isProxyRevalidate, isPublic, setMaxAge, setMustRevalidate, setNoCache, setNoCacheHeaders, setNoStore, setNoTransform, setPrivate, setPrivateHeaders, setProxyRevalidate, setPublic
 
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.ClientResponse
getDocument, getDocument, getDocument, getDocument, getServerDate, setInputStream
 
Methods inherited from interface org.apache.abdera.protocol.Response
getAge, getAllow, getCacheControl, getContentLanguage, getContentLength, getContentLocation, getContentType, getExpires, getLastModified, getLocation, getMaxAge, getNoCacheHeaders, getPrivateHeaders, getSlug, getSMaxAge, getType, getUriHeader, isMustRevalidate, isNoCache, isNoStore, isNoTransform, isPrivate, isProxyRevalidate, isPublic
 
Methods inherited from interface org.apache.abdera.protocol.ResponseInfo
getEntityTag
 

Constructor Detail

CommonsResponse

protected CommonsResponse(Abdera abdera,
                          org.apache.commons.httpclient.HttpMethod method)
Method Detail

getHttpMethod

public org.apache.commons.httpclient.HttpMethod getHttpMethod()

getMethod

public java.lang.String getMethod()
Return the request method

Specified by:
getMethod in interface ClientResponse

getStatus

public int getStatus()
Return the status code of the response

Specified by:
getStatus in interface Response

getStatusText

public java.lang.String getStatusText()
Return the status text of the response

Specified by:
getStatusText in interface Response

release

public void release()
Release the resources associated with this response

Specified by:
release in interface ClientResponse

getHeader

public java.lang.String getHeader(java.lang.String header)
Return the value of the named HTTP header

Specified by:
getHeader in interface Response

getHeaders

public java.util.List<java.lang.Object> getHeaders(java.lang.String header)
Return the values of the named HTTP header

Specified by:
getHeaders in interface Response

getHeaders

public java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getHeaders()
Return all of the HTTP headers

Specified by:
getHeaders in interface Response

getHeaderNames

public java.lang.String[] getHeaderNames()
Return a listing of HTTP header names

Specified by:
getHeaderNames in interface Response

getUri

public java.lang.String getUri()
Return the request URI

Specified by:
getUri in interface ClientResponse

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Return the inputstream for reading the content of the response. The InputStream returned will automatically decode Content-Encodings and will automatically release the response when the stream has been read fully.

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

getDateHeader

public java.util.Date getDateHeader(java.lang.String header)
Return the named HTTP header as a java.util.Date

Specified by:
getDateHeader in interface Response