net.officefloor.plugin.socket.server.http.parse
Interface HttpRequestParser

All Known Implementing Classes:
HttpRequestParserImpl

public interface HttpRequestParser

Parses a HttpRequest.

Author:
Daniel Sagenschneider

Method Summary
 InputBufferStream getBody()
          Obtains the InputBufferStream to the body of the HttpRequest.
 List<HttpHeader> getHeaders()
          Obtains the HttpHeader instances in the order supplied.
 String getHttpVersion()
          Obtains the HTTP version.
 String getMethod()
          Obtains the method.
 String getRequestURI()
          Obtains the request URI.
 boolean parse(InputBufferStream inputBufferStream, char[] tempBuffer)
          Parses the HttpRequest bytes from the InputBufferStream.
 void reset()
          Resets for parsing another HttpRequest.
 

Method Detail

parse

boolean parse(InputBufferStream inputBufferStream,
              char[] tempBuffer)
              throws IOException,
                     HttpRequestParseException
Parses the HttpRequest bytes from the InputBufferStream.

Parameters:
inputBufferStream - InputBufferStream containing the data to be parsed for the HttpRequest.
tempBuffer - Temporary char buffer that is used to translate bytes into a String. This allows reducing memory size and creation of arrays. The size of the buffer indicates the maximum size for parts of the HttpRequest (except the body).
Returns:
true if the HttpRequest has been fully parsed. false indicates this method should be called again when further data is available on the InputBufferStream to obtain the full HttpRequest.
Throws:
IOException - If fails to read bytes.
HttpRequestParseException - If failure to parse HttpRequest.

reset

void reset()
Resets for parsing another HttpRequest.


getMethod

String getMethod()
Obtains the method.

Returns:
Method.

getRequestURI

String getRequestURI()
Obtains the request URI.

Returns:
Request URI.

getHttpVersion

String getHttpVersion()
Obtains the HTTP version.

Returns:
HTTP version.

getHeaders

List<HttpHeader> getHeaders()
Obtains the HttpHeader instances in the order supplied.

Returns:
HttpHeader instances in the order supplied.

getBody

InputBufferStream getBody()
Obtains the InputBufferStream to the body of the HttpRequest.

Returns:
InputBufferStream to the body of the HttpRequest.


Copyright © 2005-2011. All Rights Reserved.