org.apache.abdera.protocol.server
Interface ResponseContext

All Superinterfaces:
Message, ProtocolConstants, Response
All Known Implementing Classes:
AbstractResponseContext, BaseResponseContext, CompressionFilter.CompressingResponseContextWrapper, EmptyResponseContext, EntityProviderResponseContext, JsonObjectResponseContext, MediaResponseContext, ResponseContextWrapper, SimpleResponseContext, StreamWriterResponseContext

public interface ResponseContext
extends Response

The ResponseContext encapsulates a server response


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.abdera.protocol.Response
Response.ResponseType
 
Field Summary
 
Fields inherited from interface org.apache.abdera.protocol.util.ProtocolConstants
NOCACHE, NOSTORE, NOTRANSFORM, ONLYIFCACHED, PRIVATE, PROXYREVALIDATE, PUBLIC, REVALIDATE
 
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
 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.
 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 interface org.apache.abdera.protocol.Response
getAge, getAllow, getContentLength, getEntityTag, getExpires, getLastModified, getLocation, getNoCacheHeaders, getPrivateHeaders, getSMaxAge, getStatus, getStatusText, getType, isMustRevalidate, isPrivate, isProxyRevalidate, isPublic
 
Methods inherited from interface org.apache.abdera.protocol.Message
getCacheControl, getContentLanguage, getContentLocation, getContentType, getDateHeader, getDecodedHeader, getDecodedHeaders, getHeader, getHeaderNames, getHeaders, getMaxAge, getSlug, isNoCache, isNoStore, isNoTransform
 

Method Detail

isBinary

boolean isBinary()
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.


setBinary

ResponseContext setBinary(boolean binary)
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.


hasEntity

boolean hasEntity()
True if the response contains an entity


writeTo

void writeTo(OutputStream out)
             throws IOException
Write the response out to the specified OutputStream

Throws:
IOException

writeTo

void writeTo(Writer javaWriter)
             throws IOException
Write the response out to the specified Writer

Throws:
IOException

writeTo

void writeTo(OutputStream out,
             Writer writer)
             throws IOException
Write the response out to the specified OutputStream

Throws:
IOException

writeTo

void writeTo(Writer javaWriter,
             Writer abderaWriter)
             throws IOException
Write the response out to the specified Writer

Throws:
IOException

setWriter

ResponseContext setWriter(Writer writer)
Set the Abdera Writer for this response. This can be used to customize the serialization of the response


removeHeader

ResponseContext removeHeader(String name)
Remove the specified header from the response


setEncodedHeader

ResponseContext setEncodedHeader(String name,
                                 String charset,
                                 String value)
Set an RFC 2047 encoded header in the response


setEncodedHeader

ResponseContext setEncodedHeader(String name,
                                 String charset,
                                 String... vals)
Set an RFC 2047 encoded header in the response


setEscapedHeader

ResponseContext setEscapedHeader(String name,
                                 CharUtils.Profile profile,
                                 String value)
Set a pct-encoded header in the response


setHeader

ResponseContext setHeader(String name,
                          Object value)
Set the value of a header in the response


setHeader

ResponseContext setHeader(String name,
                          Object... vals)
Set the value of a header in the response


addEncodedHeader

ResponseContext addEncodedHeader(String name,
                                 String charset,
                                 String value)
Add an RFC 2047 encoded header in the response


addEncodedHeaders

ResponseContext addEncodedHeaders(String name,
                                  String charset,
                                  String... vals)
Add an RFC 2047 encoded header in the response


addHeader

ResponseContext addHeader(String name,
                          Object value)
Add a header to the response


addHeaders

ResponseContext addHeaders(String name,
                           Object... vals)
Add a header to the response


setAge

ResponseContext setAge(long age)
Set the value of the Age header


setContentLanguage

ResponseContext setContentLanguage(String language)
Set the value of the Content-Language header


setContentLength

ResponseContext setContentLength(long length)
Set the value of the Content-Length header


setContentLocation

ResponseContext setContentLocation(String uri)
Set the value of the Content-Location header


setSlug

ResponseContext setSlug(String slug)
Set the value of the Slug header


setContentType

ResponseContext setContentType(String type)
Set the value of the Content-Type header


setContentType

ResponseContext setContentType(String type,
                               String charset)
Set the value of the Content-Type header


setEntityTag

ResponseContext setEntityTag(String etag)
Set the value of the ETag header


setEntityTag

ResponseContext setEntityTag(org.apache.abdera.util.EntityTag etag)
Set the value of the ETag header


setExpires

ResponseContext setExpires(Date date)
Set the value of the Expires header


setLastModified

ResponseContext setLastModified(Date date)
Set the value of the Last-Modified header


setLocation

ResponseContext setLocation(String uri)
Set the value of the Location header


setStatus

ResponseContext setStatus(int status)
Set the response status code


setStatusText

ResponseContext setStatusText(String text)
Set the response status text


setAllow

ResponseContext setAllow(String method)
Specify the HTTP methods allowed


setAllow

ResponseContext setAllow(String... methods)
Specify the HTTP methods allowed



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