org.weborganic.berlioz.servlet
Class HttpContentRequest

java.lang.Object
  extended by org.weborganic.berlioz.servlet.HttpRequestWrapper
      extended by org.weborganic.berlioz.servlet.HttpContentRequest
All Implemented Interfaces:
ContentRequest

public final class HttpContentRequest
extends HttpRequestWrapper
implements ContentRequest

Wraps a ServletRequest instance and provide methods to access the parameters and attributes in a consistent manner.

Since:
Berlioz 0.9
Version:
Berlioz 0.9.14 - 22 January 2013
Author:
Christophe Lauret

Method Summary
 ContentGenerator generator()
          Returns the generator for which this request is used for.
 String getRedirectURL()
          Returns the URL to redirect to.
 Service getService()
          Service the generator is part of.
 ContentStatus getStatus()
          Returns the status of this request.
 void setRedirect(String url, ContentStatus status)
          Sets the status of this request.
 void setStatus(ContentStatus status)
          Sets the status of this request.
 
Methods inherited from class org.weborganic.berlioz.servlet.HttpRequestWrapper
getAttribute, getBerliozPath, getBerliozPath, getCookies, getDateParameter, getEnvironment, getHttpRequest, getHttpResponse, getIntParameter, getLocation, getParameter, getParameter, getParameterNames, getParameterValues, getPathInfo, getSession, isMultipartContent, setAttribute
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.weborganic.berlioz.content.ContentRequest
getAttribute, getBerliozPath, getCookies, getDateParameter, getEnvironment, getIntParameter, getLocation, getParameter, getParameter, getParameterNames, getParameterValues, getPathInfo, getSession, setAttribute
 

Method Detail

setStatus

public void setStatus(ContentStatus status)
Sets the status of this request.

Specified by:
setStatus in interface ContentRequest
Parameters:
status - the status of this request.
Throws:
NullPointerException - if the status is null.
IllegalArgumentException - if the status is a redirect status.

setRedirect

public void setRedirect(String url,
                        ContentStatus status)
Sets the status of this request. Sets the status of this request for redirection.

Specified by:
setRedirect in interface ContentRequest
Parameters:
url - The URL to redirect to.
status - The status code to use (required).
Throws:
NullPointerException - if the URL is null.
IllegalArgumentException - if the status is not a redirect status.

getStatus

public ContentStatus getStatus()
Returns the status of this request.

Returns:
the status of this request.

generator

public ContentGenerator generator()
Returns the generator for which this request is used for.

Returns:
the generator for which this request is used for.

getService

public Service getService()
Service the generator is part of.

Returns:
the service the generator is part of.

getRedirectURL

public String getRedirectURL()
Returns the URL to redirect to.

Returns:
the URL to redirect to (may be null).