NAME
Wombat::Connector::HttpRequestBase - internal http request base class
SYNOPSIS
package My::Connector::HttpRequest;
use base qw(Wombat::Connector::HttpRequestBase);
DESCRIPTION
Convenience base implementation of Wombat::HttpRequest and Servlet::Http::HttpServletRequest which can be used for most connectors that implement the HTTP protocol. Only connector-specific methods need to be implemented. Extends Wombat::Connector::RequestBase.
CONSTRUCTOR
- new()
-
Construct and return a Wombat::Connector::Http::RequestBase instance, initializing fields appropriately. If subclasses override the constructor, they must be sure to call
$self->SUPER::new();
PUBLIC METHODS
- getAuthType()
-
Return the authentication type used for this Request.
- setAuthType($type)
-
Set the authentication type used for this request.
Parameters:
- getContextPath()
-
Return the portion of the request URI used to select the Application for the Request.
- setContextPath($path)
-
Set the context path for this Request. This will normally be called when the associated Application is mapping the Request to a particular Wrapper.
Parameters:
-
Add a Cookie to the set of Cookies for this Request. This will normally be called when the Connector is parsing the request headers.
Parameters:
-
the Servlet::Http::Cookie
-
- getCookies()
-
Return the set of Cookies received with this Request.
- clearCookies()
-
Remove all Cookies for this Request.
- getDateHeader($name)
-
Return the value of the named date header, or -1.
Parameters:
- addHeader($name, $value)
-
Add a value for the named request header.
Parameters:
- getHeader($name)
-
Return the first value for the named request header.
- getHeaderNames()
-
Return the names of all headers received for this Request.
- getHeaders($name)
-
Return the list of values for the named request header.
Parameters:
- clearHeaders()
-
Unset all headers for this Request.
- getMethod()
-
Return the HTTP request method used for this Request.
- setMethod($method)
-
Set the HTTP request method used for this Request.
Parameters:
- getParameter($name)
-
Return the value of the named request parameter. If more than one value is defined, return only the first one. Extract parameters from the request if not already done.
Parameters:
- getParameterMap()
-
Return a hash of the parameters of this Request. The keys of the hash are the parameter names, and the values of the hash are arrays of parameter values. Extract parameters from the request if not already done.
- getParameterNames()
-
Return an array containing the names of the parameters contained in this Request. Extract parameters from the request if not already done.
- getParameterValues($name)
-
Return an array containing all of the values of the named request parameter. Extract parameters from the request if not already done.
Parameters:
- getPathInfo()
-
Return the path information for this Request.
- setPathInfo($path)
-
Set the path information for this Request. This will normally be called when the associated Application is mapping the Request to a particular Wrapper.
Parameters:
- getPathTranslated()
-
turn extra path information for this request, translated to a real path.
- getQueryString()
-
Return the query string for this Request.
- setQueryString($query)
-
Set the query string for this Request. This is normally called by the Connector when it parses the request headers.
Parameters:
- getRemoteUser()
-
Return the name of the remote user that has been authenticated for this Request.
- isRequestedSessionIdFromCookie()
-
Return a flag indicating whether or not the requested session ID for this Request came in through a cookie.
- setRequestedSessionCookie($flag)
-
Set a flag indicating whether or not the requested session ID for this Request came in through a cookie. This is normally called by the Connector when it parses the request headers.
Parameters:
- getRequestedSessionId()
-
Return the session ID included in this Request, if any.
- setRequestedSessionId($id)
-
Set the requested session ID for this Request. This is normally called by the Connector when it parses the request headers.
Parameters:
- isRequestedSessionIdFromURL()
-
Return a flag indicating whether or not the requested session ID for this Request came in through the request URL.
- setRequestedSessionURL($flag)
-
Set a flag indicating whether or not the requested session ID for this Request came in through the request URL. This is normally called by the Connector when it parses the request headers.
Parameters:
- getRequestURI()
-
Return the request URI for this Request.
- setRequestURI($uri)
-
Set the unparsed request URI for this Request. This is normally called by the Connector when it parses the request headers.
Parameters:
- getRequestURL()
-
Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does no tinclude query string parameters.
This method is useful for creating redirect messages and for reporting errors.
- getServletPath()
-
Return the portion of the request URI used to select the servlet that will process this Request.
- setServletPath($path)
-
Set the servlet path for this Request. This is normally called when the associated Application is mapping the Request to a particular Wrapper.
Parameters:
- getSession($boolean)
-
Return the Session associated with this Request, creating one if necessary and requested.
Parameters:
- setSession($session)
-
Set the internal Session associated with this Request.
Parameters:
- getUserPrincipal()
-
Return the name of the current authenticated user.
- setUserPrincipal($principal)
-
Set the principal that has been authenticated for this Request. This value is also used to calculate the value to be returned by
getRemoteUser()
.Parameters:
PUBLIC METHODS
- isRequestedSessionIdValid()
-
Return a boolean value indicating whether or not the requested session ID is still valid.
- isUserInRole($role)
-
Return a boolean value indicating whether or not the authenticated user principal is associated with the named role.
Parameters:
- recycle()
-
Release all object references and initialize instances variables in preparation for use or reuse of this object.
SEE ALSO
Servlet::Http::HttpServletRequest, Servlet::Util::Principal, Wombat::HttpRequest, Wombat::HttpSession, Wombat::Connector::RequestBase
AUTHOR
Brian Moseley, bcm@maz.org