org.apache.abdera.protocol.server.context
Class ResponseContextWrapper

java.lang.Object
  extended by org.apache.abdera.protocol.server.context.ResponseContextWrapper
All Implemented Interfaces:
Message, Response, ResponseContext, ProtocolConstants
Direct Known Subclasses:
CompressionFilter.CompressingResponseContextWrapper

public class ResponseContextWrapper
extends Object
implements ResponseContext


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.abdera.protocol.Response
Response.ResponseType
 
Field Summary
protected  ResponseContext response
           
 
Fields inherited from interface org.apache.abdera.protocol.util.ProtocolConstants
NOCACHE, NOSTORE, NOTRANSFORM, ONLYIFCACHED, PRIVATE, PROXYREVALIDATE, PUBLIC, REVALIDATE
 
Constructor Summary
ResponseContextWrapper(ResponseContext response)
           
 
Method Summary
 ResponseContext addEncodedHeader(String name, String charset, String value)
          Add an RFC 2047 encoded header in the response
 ResponseContext addEncodedHeaders(String name, String charset, String... vals)
          Add an RFC 2047 encoded header in the response
 ResponseContext addHeader(String name, Object value)
          Add a header to the response
 ResponseContext addHeaders(String name, Object... vals)
          Add a header to the response
 long getAge()
          Get the age of this response as specified by the server
 String getAllow()
          Get the value of the Allow response header
 String getCacheControl()
          Return the value of the Cache-Control header
 String getContentLanguage()
          Return the value of the Content-Language header
 long getContentLength()
          Get the value of the Content-Length response header
 IRI getContentLocation()
          Return the value of the Content-Location header
 javax.activation.MimeType getContentType()
          Return the value of the Content-Type header
 Date getDateHeader(String name)
          Return the value of a Date header
 String getDecodedHeader(String name)
          Get the decoded value of a RFC 2047 header
 String[] getDecodedHeaders(String name)
          Return multiple decoded values for the specified header
 org.apache.abdera.util.EntityTag getEntityTag()
          Get the Entity Tag returned by the server
 Date getExpires()
          Get the date/time this response expires
 String getHeader(String name)
          Get the value of the specified header
 String[] getHeaderNames()
          Return a listing of header names
 Object[] getHeaders(String name)
          Return multiple values for the specified header
 Date getLastModified()
          Get the value of the Last-Modified response header
 IRI getLocation()
          Get the value of the Location response header
 long getMaxAge()
          Return the maximum-age as specified by the Cache-Control header
 String[] getNoCacheHeaders()
           
 String[] getPrivateHeaders()
           
 String getSlug()
          Return the value of the Slug header
 long getSMaxAge()
           
 int getStatus()
          Get the specific response status code
 String getStatusText()
          Get the response status text
 Response.ResponseType getType()
          Get the response type classification
 boolean hasEntity()
          True if the response contains an entity
 boolean isBinary()
          True if the response contains a binary entity as opposed to a character based entity.
 boolean isMustRevalidate()
          True if the Cache-Control header specifies the must-revalidate directive
 boolean isNoCache()
          Return true if the Cache-Control header contains no-cache
 boolean isNoStore()
          Return true if the Cache-Control header contains no-store
 boolean isNoTransform()
          Return true if the Cache-Control header contains no-transform
 boolean isPrivate()
          True if the Cache-Control header specifies the private directive
 boolean isProxyRevalidate()
          True if the Cache-Control header specifies the proxy-revalidate directive
 boolean isPublic()
          True if the Cache-Control header specified the public directive
 ResponseContext removeHeader(String name)
          Remove the specified header from the response
 ResponseContext setAge(long age)
          Set the value of the Age header
 ResponseContext setAllow(String... methods)
          Specify the HTTP methods allowed
 ResponseContext setAllow(String method)
          Specify the HTTP methods allowed
 ResponseContext setBinary(boolean binary)
          True if the response contains a binary entity as opposed to a character based entity.
 ResponseContext setContentLanguage(String language)
          Set the value of the Content-Language header
 ResponseContext setContentLength(long length)
          Set the value of the Content-Length header
 ResponseContext setContentLocation(String uri)
          Set the value of the Content-Location header
 ResponseContext setContentType(String type)
          Set the value of the Content-Type header
 ResponseContext setContentType(String type, String charset)
          Set the value of the Content-Type header
 ResponseContext setEncodedHeader(String name, String charset, String... vals)
          Set an RFC 2047 encoded header in the response
 ResponseContext setEncodedHeader(String name, String charset, String value)
          Set an RFC 2047 encoded header in the response
 ResponseContext setEntityTag(org.apache.abdera.util.EntityTag etag)
          Set the value of the ETag header
 ResponseContext setEntityTag(String etag)
          Set the value of the ETag header
 ResponseContext setEscapedHeader(String name, CharUtils.Profile profile, String value)
          Set a pct-encoded header in the response
 ResponseContext setExpires(Date date)
          Set the value of the Expires header
 ResponseContext setHeader(String name, Object... vals)
          Set the value of a header in the response
 ResponseContext setHeader(String name, Object value)
          Set the value of a header in the response
 ResponseContext setLastModified(Date date)
          Set the value of the Last-Modified header
 ResponseContext setLocation(String uri)
          Set the value of the Location header
 ResponseContext setSlug(String slug)
          Set the value of the Slug header
 ResponseContext setStatus(int status)
          Set the response status code
 ResponseContext setStatusText(String text)
          Set the response status text
 ResponseContext setWriter(Writer writer)
          Set the Abdera Writer for this response.
 void writeTo(OutputStream out)
          Write the response out to the specified OutputStream
 void writeTo(OutputStream out, Writer writer)
          Write the response out to the specified OutputStream
 void writeTo(Writer javaWriter)
          Write the response out to the specified Writer
 void writeTo(Writer javaWriter, Writer abderaWriter)
          Write the response out to the specified Writer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

response

protected final ResponseContext response
Constructor Detail

ResponseContextWrapper

public ResponseContextWrapper(ResponseContext response)
Method Detail

addEncodedHeader

public ResponseContext addEncodedHeader(String name,
                                        String charset,
                                        String value)
Description copied from interface: ResponseContext
Add an RFC 2047 encoded header in the response

Specified by:
addEncodedHeader in interface ResponseContext

addEncodedHeaders

public ResponseContext addEncodedHeaders(String name,
                                         String charset,
                                         String... vals)
Description copied from interface: ResponseContext
Add an RFC 2047 encoded header in the response

Specified by:
addEncodedHeaders in interface ResponseContext

addHeader

public ResponseContext addHeader(String name,
                                 Object value)
Description copied from interface: ResponseContext
Add a header to the response

Specified by:
addHeader in interface ResponseContext

addHeaders

public ResponseContext addHeaders(String name,
                                  Object... vals)
Description copied from interface: ResponseContext
Add a header to the response

Specified by:
addHeaders in interface ResponseContext

hasEntity

public boolean hasEntity()
Description copied from interface: ResponseContext
True if the response contains an entity

Specified by:
hasEntity in interface ResponseContext

removeHeader

public ResponseContext removeHeader(String name)
Description copied from interface: ResponseContext
Remove the specified header from the response

Specified by:
removeHeader in interface ResponseContext

setAge

public ResponseContext setAge(long age)
Description copied from interface: ResponseContext
Set the value of the Age header

Specified by:
setAge in interface ResponseContext

setAllow

public ResponseContext setAllow(String method)
Description copied from interface: ResponseContext
Specify the HTTP methods allowed

Specified by:
setAllow in interface ResponseContext

setAllow

public ResponseContext setAllow(String... methods)
Description copied from interface: ResponseContext
Specify the HTTP methods allowed

Specified by:
setAllow in interface ResponseContext

setContentLanguage

public ResponseContext setContentLanguage(String language)
Description copied from interface: ResponseContext
Set the value of the Content-Language header

Specified by:
setContentLanguage in interface ResponseContext

setContentLength

public ResponseContext setContentLength(long length)
Description copied from interface: ResponseContext
Set the value of the Content-Length header

Specified by:
setContentLength in interface ResponseContext

setContentLocation

public ResponseContext setContentLocation(String uri)
Description copied from interface: ResponseContext
Set the value of the Content-Location header

Specified by:
setContentLocation in interface ResponseContext

setContentType

public ResponseContext setContentType(String type)
Description copied from interface: ResponseContext
Set the value of the Content-Type header

Specified by:
setContentType in interface ResponseContext

setContentType

public ResponseContext setContentType(String type,
                                      String charset)
Description copied from interface: ResponseContext
Set the value of the Content-Type header

Specified by:
setContentType in interface ResponseContext

setEncodedHeader

public ResponseContext setEncodedHeader(String name,
                                        String charset,
                                        String value)
Description copied from interface: ResponseContext
Set an RFC 2047 encoded header in the response

Specified by:
setEncodedHeader in interface ResponseContext

setEncodedHeader

public ResponseContext setEncodedHeader(String name,
                                        String charset,
                                        String... vals)
Description copied from interface: ResponseContext
Set an RFC 2047 encoded header in the response

Specified by:
setEncodedHeader in interface ResponseContext

setEntityTag

public ResponseContext setEntityTag(String etag)
Description copied from interface: ResponseContext
Set the value of the ETag header

Specified by:
setEntityTag in interface ResponseContext

setEntityTag

public ResponseContext setEntityTag(org.apache.abdera.util.EntityTag etag)
Description copied from interface: ResponseContext
Set the value of the ETag header

Specified by:
setEntityTag in interface ResponseContext

setEscapedHeader

public ResponseContext setEscapedHeader(String name,
                                        CharUtils.Profile profile,
                                        String value)
Description copied from interface: ResponseContext
Set a pct-encoded header in the response

Specified by:
setEscapedHeader in interface ResponseContext

setExpires

public ResponseContext setExpires(Date date)
Description copied from interface: ResponseContext
Set the value of the Expires header

Specified by:
setExpires in interface ResponseContext

setHeader

public ResponseContext setHeader(String name,
                                 Object value)
Description copied from interface: ResponseContext
Set the value of a header in the response

Specified by:
setHeader in interface ResponseContext

setHeader

public ResponseContext setHeader(String name,
                                 Object... vals)
Description copied from interface: ResponseContext
Set the value of a header in the response

Specified by:
setHeader in interface ResponseContext

setLastModified

public ResponseContext setLastModified(Date date)
Description copied from interface: ResponseContext
Set the value of the Last-Modified header

Specified by:
setLastModified in interface ResponseContext

setLocation

public ResponseContext setLocation(String uri)
Description copied from interface: ResponseContext
Set the value of the Location header

Specified by:
setLocation in interface ResponseContext

setSlug

public ResponseContext setSlug(String slug)
Description copied from interface: ResponseContext
Set the value of the Slug header

Specified by:
setSlug in interface ResponseContext

setStatus

public ResponseContext setStatus(int status)
Description copied from interface: ResponseContext
Set the response status code

Specified by:
setStatus in interface ResponseContext

setStatusText

public ResponseContext setStatusText(String text)
Description copied from interface: ResponseContext
Set the response status text

Specified by:
setStatusText in interface ResponseContext

setWriter

public ResponseContext setWriter(Writer writer)
Description copied from interface: ResponseContext
Set the Abdera Writer for this response. This can be used to customize the serialization of the response

Specified by:
setWriter in interface ResponseContext

writeTo

public void writeTo(OutputStream out)
             throws IOException
Description copied from interface: ResponseContext
Write the response out to the specified OutputStream

Specified by:
writeTo in interface ResponseContext
Throws:
IOException

writeTo

public void writeTo(Writer javaWriter)
             throws IOException
Description copied from interface: ResponseContext
Write the response out to the specified Writer

Specified by:
writeTo in interface ResponseContext
Throws:
IOException

writeTo

public void writeTo(OutputStream out,
                    Writer writer)
             throws IOException
Description copied from interface: ResponseContext
Write the response out to the specified OutputStream

Specified by:
writeTo in interface ResponseContext
Throws:
IOException

writeTo

public void writeTo(Writer javaWriter,
                    Writer abderaWriter)
             throws IOException
Description copied from interface: ResponseContext
Write the response out to the specified Writer

Specified by:
writeTo in interface ResponseContext
Throws:
IOException

getAge

public long getAge()
Description copied from interface: Response
Get the age of this response as specified by the server

Specified by:
getAge in interface Response

getAllow

public String getAllow()
Description copied from interface: Response
Get the value of the Allow response header

Specified by:
getAllow in interface Response

getContentLength

public long getContentLength()
Description copied from interface: Response
Get the value of the Content-Length response header

Specified by:
getContentLength in interface Response

getEntityTag

public org.apache.abdera.util.EntityTag getEntityTag()
Description copied from interface: Response
Get the Entity Tag returned by the server

Specified by:
getEntityTag in interface Response

getExpires

public Date getExpires()
Description copied from interface: Response
Get the date/time this response expires

Specified by:
getExpires in interface Response

getLastModified

public Date getLastModified()
Description copied from interface: Response
Get the value of the Last-Modified response header

Specified by:
getLastModified in interface Response

getLocation

public IRI getLocation()
Description copied from interface: Response
Get the value of the Location response header

Specified by:
getLocation in interface Response

getNoCacheHeaders

public String[] getNoCacheHeaders()
Specified by:
getNoCacheHeaders in interface Response

getPrivateHeaders

public String[] getPrivateHeaders()
Specified by:
getPrivateHeaders in interface Response

getSMaxAge

public long getSMaxAge()
Specified by:
getSMaxAge in interface Response

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

getType

public Response.ResponseType getType()
Description copied from interface: Response
Get the response type classification

Specified by:
getType in interface Response

isMustRevalidate

public boolean isMustRevalidate()
Description copied from interface: Response
True if the Cache-Control header specifies the must-revalidate directive

Specified by:
isMustRevalidate in interface Response

isPrivate

public boolean isPrivate()
Description copied from interface: Response
True if the Cache-Control header specifies the private directive

Specified by:
isPrivate in interface Response

isProxyRevalidate

public boolean isProxyRevalidate()
Description copied from interface: Response
True if the Cache-Control header specifies the proxy-revalidate directive

Specified by:
isProxyRevalidate in interface Response

isPublic

public boolean isPublic()
Description copied from interface: Response
True if the Cache-Control header specified the public directive

Specified by:
isPublic in interface Response

getCacheControl

public String getCacheControl()
Description copied from interface: Message
Return the value of the Cache-Control header

Specified by:
getCacheControl in interface Message

getContentLanguage

public String getContentLanguage()
Description copied from interface: Message
Return the value of the Content-Language header

Specified by:
getContentLanguage in interface Message

getContentLocation

public IRI getContentLocation()
Description copied from interface: Message
Return the value of the Content-Location header

Specified by:
getContentLocation in interface Message

getContentType

public javax.activation.MimeType getContentType()
Description copied from interface: Message
Return the value of the Content-Type header

Specified by:
getContentType in interface Message

getDateHeader

public Date getDateHeader(String name)
Description copied from interface: Message
Return the value of a Date header

Specified by:
getDateHeader in interface Message

getDecodedHeader

public String getDecodedHeader(String name)
Description copied from interface: Message
Get the decoded value of a RFC 2047 header

Specified by:
getDecodedHeader in interface Message

getDecodedHeaders

public String[] getDecodedHeaders(String name)
Description copied from interface: Message
Return multiple decoded values for the specified header

Specified by:
getDecodedHeaders in interface Message

getHeader

public String getHeader(String name)
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 name)
Description copied from interface: Message
Return multiple values for the specified header

Specified by:
getHeaders in interface Message

getMaxAge

public long getMaxAge()
Description copied from interface: Message
Return the maximum-age as specified by the Cache-Control header

Specified by:
getMaxAge in interface Message

getSlug

public String getSlug()
Description copied from interface: Message
Return the value of the Slug header

Specified by:
getSlug in interface Message

isNoCache

public boolean isNoCache()
Description copied from interface: Message
Return true if the Cache-Control header contains no-cache

Specified by:
isNoCache in interface Message

isNoStore

public boolean isNoStore()
Description copied from interface: Message
Return true if the Cache-Control header contains no-store

Specified by:
isNoStore in interface Message

isNoTransform

public boolean isNoTransform()
Description copied from interface: Message
Return true if the Cache-Control header contains no-transform

Specified by:
isNoTransform in interface Message

isBinary

public boolean isBinary()
Description copied from interface: ResponseContext
True if the response contains a binary entity as opposed to a character based entity. Default is false. If true, the AbderaServlet will pass in the OutputStream for writing out, if false, the AbderaServlet will pass in the Writer.

Specified by:
isBinary in interface ResponseContext

setBinary

public ResponseContext setBinary(boolean binary)
Description copied from interface: ResponseContext
True if the response contains a binary entity as opposed to a character based entity. Default is false. If true, the AbderaServlet will pass in the OutputStream for writing out, if false, the AbderaServlet will pass in the Writer.

Specified by:
setBinary in interface ResponseContext


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