org.szegedi.nioserver.protocols.http
Interface NioHttpRequest


public interface NioHttpRequest

The interface that represents the parsed request as passed to an Adapter adapter for processing. It exposes the significant parsed request properties (method, URI, protocol, headers, and body), as well a stream for writing the response.

Version:
$Id : $
Author:
Attila Szegedi, szegedia at freemail dot hu

Method Summary
 int getContentLength()
          Retrieves the length of the request body.
 java.lang.String getHeader(java.lang.String name)
          Retrieves the value of the specified request header.
 java.util.Iterator getHeaderNames()
          Retrieves an iterator that returns all header names in the request
 java.lang.String getMethod()
          Retrieves the request method.
 java.lang.String getProtocol()
          Retrieves the request protocol.
 java.io.InputStream getRequestBodyInputStream()
          Retrieves an input stream suitable for reading the request body.
 java.io.OutputStream getResponseOutputStream()
          Retrieves the output stream to which the response should be written.
 java.lang.String getURI()
          Retrieves the request URI.
 

Method Detail

getContentLength

public int getContentLength()
Retrieves the length of the request body. This length is always known, as the request body is wholly buffered by the framework. If the request body had the "chunked" content encoding, the length corresponds to the decoded ("dechunked") content length.


getHeader

public java.lang.String getHeader(java.lang.String name)
Retrieves the value of the specified request header. Returns null if the requested header does not occur in the request.


getHeaderNames

public java.util.Iterator getHeaderNames()
Retrieves an iterator that returns all header names in the request


getMethod

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


getProtocol

public java.lang.String getProtocol()
Retrieves the request protocol.


getURI

public java.lang.String getURI()
Retrieves the request URI.


getRequestBodyInputStream

public java.io.InputStream getRequestBodyInputStream()
Retrieves an input stream suitable for reading the request body. If the original request body had the "chunked" transfer encoding, it is already decoded ("dechunked") by the framework.


getResponseOutputStream

public java.io.OutputStream getResponseOutputStream()
Retrieves the output stream to which the response should be written. This stream should be used to write the complete response, including the response line, headers, and the body.