org.cruxframework.crux.core.server.rest.spi
Class HttpRequest

java.lang.Object
  extended by org.cruxframework.crux.core.server.rest.spi.HttpRequest

public class HttpRequest
extends Object

Abstraction for an inbound http request on the server, or a response from a server to a client

We have this abstraction so that we can reuse marshalling objects in a client framework and serverside framework

Version:
$Revision: 1 $
Author:
Bill Burke

Field Summary
protected  MultivaluedMap<String,String> decodedFormParameters
           
protected  MultivaluedMap<String,String> formParameters
           
protected  HttpHeaders httpHeaders
           
protected  String httpMethod
           
protected  javax.servlet.http.HttpServletRequest request
           
protected  UriInfo uri
           
 
Constructor Summary
HttpRequest(javax.servlet.http.HttpServletRequest request, HttpHeaders httpHeaders, UriInfo uri, String httpMethod)
           
 
Method Summary
 Object getAttribute(String attribute)
           
 Enumeration<String> getAttributeNames()
           
 String getContextPath()
           
 MultivaluedMap<String,String> getDecodedFormParameters()
           
 MultivaluedMap<String,String> getFormParameters()
           
 HttpHeaders getHttpHeaders()
           
 String getHttpMethod()
           
 InputStream getInputStream()
           
 Locale getLocale()
           
 MultivaluedMap<String,String> getPutDecodedFormParameters()
           
 MultivaluedMap<String,String> getPutFormParameters()
           
 String getRemoteAddr()
           
 String getRemoteHost()
           
 int getRemotePort()
           
 String getRemoteUser()
           
 javax.servlet.http.HttpSession getSession()
           
 javax.servlet.http.HttpSession getSession(boolean create)
           
 UriInfo getUri()
           
 Principal getUserPrincipal()
           
protected  MultivaluedMap<String,String> parseForm(InputStream entityStream)
           
 void removeAttribute(String name)
           
 void setAttribute(String name, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

httpHeaders

protected final HttpHeaders httpHeaders

request

protected final javax.servlet.http.HttpServletRequest request

uri

protected final UriInfo uri

httpMethod

protected final String httpMethod

formParameters

protected MultivaluedMap<String,String> formParameters

decodedFormParameters

protected MultivaluedMap<String,String> decodedFormParameters
Constructor Detail

HttpRequest

public HttpRequest(javax.servlet.http.HttpServletRequest request,
                   HttpHeaders httpHeaders,
                   UriInfo uri,
                   String httpMethod)
Method Detail

getPutFormParameters

public MultivaluedMap<String,String> getPutFormParameters()

getPutDecodedFormParameters

public MultivaluedMap<String,String> getPutDecodedFormParameters()

getAttribute

public Object getAttribute(String attribute)

setAttribute

public void setAttribute(String name,
                         Object value)

removeAttribute

public void removeAttribute(String name)

getUserPrincipal

public Principal getUserPrincipal()
See Also:
javax.servlet.http.HttpServletRequest.getUserPrincipal()

getAttributeNames

public Enumeration<String> getAttributeNames()

getFormParameters

public MultivaluedMap<String,String> getFormParameters()

getDecodedFormParameters

public MultivaluedMap<String,String> getDecodedFormParameters()

getHttpHeaders

public HttpHeaders getHttpHeaders()

getInputStream

public InputStream getInputStream()

getUri

public UriInfo getUri()

getHttpMethod

public String getHttpMethod()

parseForm

protected MultivaluedMap<String,String> parseForm(InputStream entityStream)
                                           throws IOException
Throws:
IOException

getSession

public javax.servlet.http.HttpSession getSession()
See Also:
javax.servlet.http.HttpServletRequest.getSession()

getSession

public javax.servlet.http.HttpSession getSession(boolean create)
See Also:
javax.servlet.http.HttpServletRequest.getSession(boolean)

getContextPath

public String getContextPath()
See Also:
javax.servlet.http.HttpServletRequest.getContextPath()

getLocale

public Locale getLocale()
Returns:
the current locale.
See Also:
request.getLocale();

getRemoteHost

public String getRemoteHost()
Returns:
a String container the remote host.
See Also:
request.getRemoteHost();

getRemoteAddr

public String getRemoteAddr()
Returns:
a String containing the fully qualified name of the client
See Also:
request.getRemoteAddr();

getRemotePort

public int getRemotePort()
Returns:
a int container the remote port.
See Also:
request.getRemotePort();

getRemoteUser

public String getRemoteUser()
Returns:
a String container the remote user.
See Also:
request.getRemoteUser();


Copyright © 2014. All rights reserved.