com.uwyn.rife.engine
Interface Request

All Known Implementing Classes:
HttpRequest, MockRequest

public interface Request

This interface contains all the methods that the web engine needs to be able to correctly handle incoming requests.

Since:
1.1
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)

Method Summary
 Object getAttribute(String name)
          See ServletRequest.getAttribute(String).
 Enumeration getAttributeNames()
          See ServletRequest.getAttributeNames().
 String getCharacterEncoding()
          See ServletRequest.getCharacterEncoding().
 String getContentType()
          See ServletRequest.getContentType().
 String getContextPath()
          See HttpServletRequest.getContextPath().
 Cookie getCookie(String name)
          Retrieves a cookie.
 Cookie[] getCookies()
          See HttpServletRequest.getCookies().
 long getDateHeader(String name)
          See HttpServletRequest.getDateHeader(String).
 UploadedFile getFile(String name)
          Retrieves an uploaded file.
 Map<String,UploadedFile[]> getFiles()
          Retrieves the files that were uploaded in this request.
 UploadedFile[] getFiles(String name)
          Retrieves all files that have been uploaded for a particular name.
 String getHeader(String name)
          See HttpServletRequest.getHeader(String).
 Enumeration getHeaderNames()
          See HttpServletRequest.getHeaderNames().
 Enumeration getHeaders(String name)
          See HttpServletRequest.getHeaders(String).
 HttpServletRequest getHttpServletRequest()
          Retrieves the underlying HttpServletRequest.
 int getIntHeader(String name)
          See HttpServletRequest.getIntHeader(String).
 Locale getLocale()
          See ServletRequest.getLocale().
 Enumeration getLocales()
          See ServletRequest.getLocales().
 RequestMethod getMethod()
          See HttpServletRequest.getMethod().
 Map<String,String[]> getParameters()
          Retrieves the parameters that were sent in this request.
 String getProtocol()
          See ServletRequest.getProtocol().
 String getRemoteAddr()
          See ServletRequest.getRemoteAddr().
 String getRemoteHost()
          See ServletRequest.getRemoteHost().
 String getRemoteUser()
          See HttpServletRequest.getRemoteUser().
 RequestDispatcher getRequestDispatcher(String url)
          See ServletRequest.getRequestDispatcher(String).
 String getScheme()
          See ServletRequest.getScheme().
 String getServerName()
          See ServletRequest.getServerName().
 int getServerPort()
          See ServletRequest.getServerPort().
 String getServerRootUrl(int port)
          Returns the root URL of the server that is running this web applications.
 HttpSession getSession()
          See HttpServletRequest.getSession().
 HttpSession getSession(boolean create)
          See HttpServletRequest.getSession(boolean).
 boolean hasAttribute(String name)
          Checks if a request attribute exists.
 boolean hasCookie(String name)
          Checks whether a cookie is present.
 boolean hasFile(String name)
          Checks if a particular file has been uploaded in this request.
 void init(StateStore stateStore)
          Initialize the state of this request from a StateStore.
 boolean isSecure()
          See ServletRequest.isSecure().
 void removeAttribute(String name)
          See ServletRequest.removeAttribute(String).
 void setAttribute(String name, Object object)
          See ServletRequest.setAttribute(String, Object).
 

Method Detail

init

void init(StateStore stateStore)
Initialize the state of this request from a StateStore.

This method is only there to be used by the web engine, it should never be called manually.

Parameters:
stateStore - the StateStore that will be used to initialize the request
Since:
1.1

getMethod

RequestMethod getMethod()
See HttpServletRequest.getMethod().

Since:
1.1

getParameters

Map<String,String[]> getParameters()
Retrieves the parameters that were sent in this request.

Returns:
a Map with all the parameter names and values
Since:
1.1

getFiles

Map<String,UploadedFile[]> getFiles()
Retrieves the files that were uploaded in this request.

Returns:
a Map with all the uploaded files
Since:
1.1
See Also:
hasFile(String), getFile(String), getFiles(String)

hasFile

boolean hasFile(String name)
Checks if a particular file has been uploaded in this request.

Parameters:
name - the name of the file, as declared in the submission
Returns:
true if the file was uploaded; or

false otherwise

Since:
1.1
See Also:
getFiles(), getFile(String), getFiles(String)

getFile

UploadedFile getFile(String name)
Retrieves an uploaded file.

Parameters:
name - the name of the file, as declared in the submission
Returns:
the uploaded file; or

null if no file was uploaded

Since:
1.1
See Also:
getFiles(), hasFile(String), getFiles(String)

getFiles

UploadedFile[] getFiles(String name)
Retrieves all files that have been uploaded for a particular name.

Parameters:
name - the name of the file, as declared in the submission
Returns:
the uploaded files; or

null if no files were uploaded for that name

Since:
1.1
See Also:
getFiles(), hasFile(String), getFile(String)

getServerRootUrl

String getServerRootUrl(int port)
Returns the root URL of the server that is running this web applications.

This includes the protocol, the server name and the server port, for example: http://www.somehost.com:8080.

Returns:
the server's root url
Since:
1.1

hasCookie

boolean hasCookie(String name)
Checks whether a cookie is present.

Parameters:
name - the name of the cookie
Returns:
true if the cookie was present; or

false otherwise

Since:
1.1
See Also:
getCookie(String), getCookies()

getCookie

Cookie getCookie(String name)
Retrieves a cookie.

Parameters:
name - the name of the cookie.
Returns:
the instance of the cookie; or

null if no such cookie is present

Since:
1.1
See Also:
hasCookie(String), getCookies()

getCookies

Cookie[] getCookies()
See HttpServletRequest.getCookies().

Since:
1.1

getAttribute

Object getAttribute(String name)
See ServletRequest.getAttribute(String).

Since:
1.1

hasAttribute

boolean hasAttribute(String name)
Checks if a request attribute exists.

Parameters:
name - a String specifying the name of the attribute

false otherwise

Since:
1.1

getAttributeNames

Enumeration getAttributeNames()
See ServletRequest.getAttributeNames().

Since:
1.1

removeAttribute

void removeAttribute(String name)
See ServletRequest.removeAttribute(String).

Since:
1.1

setAttribute

void setAttribute(String name,
                  Object object)
See ServletRequest.setAttribute(String, Object).

Since:
1.1

getCharacterEncoding

String getCharacterEncoding()
See ServletRequest.getCharacterEncoding().

Since:
1.1

getContentType

String getContentType()
See ServletRequest.getContentType().

Since:
1.1

getDateHeader

long getDateHeader(String name)
See HttpServletRequest.getDateHeader(String).

Since:
1.1

getHeader

String getHeader(String name)
See HttpServletRequest.getHeader(String).

Since:
1.1

getHeaderNames

Enumeration getHeaderNames()
See HttpServletRequest.getHeaderNames().

Since:
1.1

getHeaders

Enumeration getHeaders(String name)
See HttpServletRequest.getHeaders(String).

Since:
1.1

getIntHeader

int getIntHeader(String name)
See HttpServletRequest.getIntHeader(String).

Since:
1.1

getLocale

Locale getLocale()
See ServletRequest.getLocale().

Since:
1.1

getLocales

Enumeration getLocales()
See ServletRequest.getLocales().

Since:
1.1

getProtocol

String getProtocol()
See ServletRequest.getProtocol().

Since:
1.1

getRemoteAddr

String getRemoteAddr()
See ServletRequest.getRemoteAddr().

Since:
1.1

getRemoteUser

String getRemoteUser()
See HttpServletRequest.getRemoteUser().

Since:
1.1

getRemoteHost

String getRemoteHost()
See ServletRequest.getRemoteHost().

Since:
1.1

getRequestDispatcher

RequestDispatcher getRequestDispatcher(String url)
See ServletRequest.getRequestDispatcher(String).

Since:
1.1

getSession

HttpSession getSession()
See HttpServletRequest.getSession().

Since:
1.1

getSession

HttpSession getSession(boolean create)
See HttpServletRequest.getSession(boolean).

Since:
1.1

getServerPort

int getServerPort()
See ServletRequest.getServerPort().

Since:
1.1

getScheme

String getScheme()
See ServletRequest.getScheme().

Since:
1.1

getServerName

String getServerName()
See ServletRequest.getServerName().

Since:
1.1

getContextPath

String getContextPath()
See HttpServletRequest.getContextPath().

Since:
1.1

isSecure

boolean isSecure()
See ServletRequest.isSecure().

Since:
1.1

getHttpServletRequest

HttpServletRequest getHttpServletRequest()
Retrieves the underlying HttpServletRequest.

Returns:
the underlying HttpServletRequest instance; or

null if this request isn't backed by HttpServletRequest

Since:
1.1


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.