org.apache.openejb.server.httpd
Interface HttpResponse

All Superinterfaces:
Serializable
All Known Implementing Classes:
HttpResponseImpl, ServletResponseAdapter

public interface HttpResponse
extends Serializable

This interface takes care of HTTP Responses. It sends data back to the browser.


Method Summary
 void flushBuffer()
          Flushes the output buffer to the client.
 String getContentType()
          Gets the content type that will be sent to the browser.
 String getHeader(String name)
          Gets a header based on the name passed in
 OutputStream getOutputStream()
          Gets the OutputStream to send data to the browser
 PrintWriter getPrintWriter()
          Gets the PrintWriter to send data to the browser
 int getStatusCode()
          Gets the response status code that will be sent to the browser
 void setContentType(String type)
          Sets the content type to be sent back to the browser.
 void setHeader(String name, String value)
          Sets a header to be sent back to the browser
 void setStatusCode(int code)
          Sets the HTTP response status code to be sent to the browser.
 void setStatusMessage(String responseString)
          Sets the response string to be sent to the browser
 

Method Detail

getHeader

String getHeader(String name)
Gets a header based on the name passed in

Parameters:
name - the header name
Returns:
the header value

setHeader

void setHeader(String name,
               String value)
Sets a header to be sent back to the browser

Parameters:
name - the header name
value - the header value

getPrintWriter

PrintWriter getPrintWriter()
                           throws IOException
Gets the PrintWriter to send data to the browser

Returns:
the PrintWriter to send data to the browser
Throws:
IOException

getOutputStream

OutputStream getOutputStream()
Gets the OutputStream to send data to the browser

Returns:
the OutputStream to send data to the browser

getContentType

String getContentType()
Gets the content type that will be sent to the browser.

Returns:
the content type (i.e. "text/html")

setContentType

void setContentType(String type)
Sets the content type to be sent back to the browser.

Parameters:
type - the type to be sent to the browser (i.e. "text/html")

getStatusCode

int getStatusCode()
Gets the response status code that will be sent to the browser

Returns:
the HTTP status code

setStatusCode

void setStatusCode(int code)
Sets the HTTP response status code to be sent to the browser.

Parameters:
code - the status code to be sent to the browser

setStatusMessage

void setStatusMessage(String responseString)
Sets the response string to be sent to the browser

Parameters:
responseString - the response string

flushBuffer

void flushBuffer()
                 throws IOException
Flushes the output buffer to the client.

Throws:
IOException


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.