org.nnsoft.shs.http
Interface Request

All Known Implementing Classes:
MutableRequest

public interface Request

HTTP Request representation.


Nested Class Summary
static class Request.Method
          HTTP method representation.
 
Method Summary
 String getClientHost()
          Return the client host connected to the server.
 long getContentLength()
          Returns the request body content length.
 List<Cookie> getCookies()
          Returns the list of cookies.
 MultiValued<String,String> getHeaders()
          Returns the HTTP headers.
 Request.Method getMethod()
          Returns the HTTP method.
 MultiValued<String,String> getParameters()
          Returns the parameters, populated only if HTTP method is Request.Method.POST and Content-Type is set to application/x-www-form-urlencoded.
 String getPath()
          Returns the request path.
 String getProtocolName()
          Returns the protocol name.
 String getProtocolVersion()
          Returns the protocol version.
 MultiValued<String,String> getQueryStringParameters()
          Returns the Query String parameters, populated only if HTTP method is Request.Method.GET.
 String getServerHost()
          Return the server host.
 int getServerPort()
          Return the server port.
 Session getSession()
          Returns the current HTTP Session.
<T> T
readRequestBody(RequestBodyReader<T> requestBodyReader)
          Reads and converts the request body input stream.
 

Method Detail

getClientHost

String getClientHost()
Return the client host connected to the server.

Returns:
the client host connected to the server.

getServerHost

String getServerHost()
Return the server host.

Returns:
the server host.

getServerPort

int getServerPort()
Return the server port.

Returns:
the server port.

getPath

String getPath()
Returns the request path.

Returns:
the request path

getMethod

Request.Method getMethod()
Returns the HTTP method.

Returns:
the HTTP method.

getProtocolName

String getProtocolName()
Returns the protocol name.

Returns:
the protocol name.

getProtocolVersion

String getProtocolVersion()
Returns the protocol version.

Returns:
the protocol version.

getHeaders

MultiValued<String,String> getHeaders()
Returns the HTTP headers.

Returns:
the HTTP headers.

getCookies

List<Cookie> getCookies()
Returns the list of cookies.

Returns:
the list of cookies.

getQueryStringParameters

MultiValued<String,String> getQueryStringParameters()
Returns the Query String parameters, populated only if HTTP method is Request.Method.GET.

Returns:
the Query String parameters

getParameters

MultiValued<String,String> getParameters()
Returns the parameters, populated only if HTTP method is Request.Method.POST and Content-Type is set to application/x-www-form-urlencoded.

Returns:
the parameters

getSession

Session getSession()
Returns the current HTTP Session.

Returns:
the current HTTP Session.

getContentLength

long getContentLength()
Returns the request body content length.

Returns:
the request body content length, -1 if it is unknown.

readRequestBody

<T> T readRequestBody(RequestBodyReader<T> requestBodyReader)
                  throws IOException
Reads and converts the request body input stream.

Parameters:
the - user defined
Returns:
the request body input stream.
Throws:
IOException - if any error occurs while opening the request body stream.


Copyright © 2012 99 Software Foundation. All Rights Reserved.