Request Class
- public class Request
extends HttpConfigurableEntity
implements HttpServletRequest, Serializable
The Personalization Server implementation of the Http Servlet Request
interface.
This object is used by the Personalization Server
to get properties on an Http Request in a format understandable
to Personalization Core Services such as the RulesService.
This will use a DefaultRequestFilter to
filter out attributes. After loading the request attributes, this will
additionally call out to any Request.AttributeLoader
specified by the AttributeLoaderMBean's RequestLoaders attribute.
-
Hierarchy
-
Object
HttpConfigurableEntity
Request
-
All Implemented Interfaces
-
ConfigurableEntity, HttpServletRequest, Serializable, ServletRequest
public static interface | Request.AttributeLoader
An object which is capable of loading additional attributes into a
Request.
|
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods from interface javax.servlet.http.HttpServletRequest |
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole |
Methods from interface javax.servlet.ServletRequest |
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding |
AUTHORIZATION_SCHEME
public static final String AUTHORIZATION_SCHEME
CHAR_ENCODING
public static final String CHAR_ENCODING
CONTENT_LENGTH
public static final String CONTENT_LENGTH
CONTENT_TYPE
public static final String CONTENT_TYPE
CONTEXT_PATH
public static final String CONTEXT_PATH
LOCALE
public static final String LOCALE
PATH_INFO
public static final String PATH_INFO
PATH_TRANSLATED
public static final String PATH_TRANSLATED
QUERY_STRING
public static final String QUERY_STRING
REMOTE_ADDRESS
public static final String REMOTE_ADDRESS
REMOTE_HOST
public static final String REMOTE_HOST
REMOTE_USER
public static final String REMOTE_USER
REQUEST_METHOD
public static final String REQUEST_METHOD
REQUEST_PROPERTY_SET_TYPE
public static final String REQUEST_PROPERTY_SET_TYPE
- request property set type
REQUEST_PROTOCOL
public static final String REQUEST_PROTOCOL
REQUEST_URI
public static final String REQUEST_URI
REQUEST_URL
public static final String REQUEST_URL
SCHEME
public static final String SCHEME
SERVER_NAME
public static final String SERVER_NAME
SERVER_PORT
public static final String SERVER_PORT
SERVLET_PATH
public static final String SERVLET_PATH
Request
public Request()
- Default Constructor
Request
public Request(HttpServletRequest request,
boolean createSession)
- Creates a P13N HTTP Request and, possibly, Session.
This object copies values from the supplied HttpServletRequest.
Related Topics
Request.setP13NSession(Session)
Session
Request
public Request(HttpServletRequest request)
- Creates a P13N HTTP Request.
This object copies values from the supplied HttpServletRequest. This
does not automatically create the Session.
createP13NRequest(HttpServletRequest) Method
public static Request createP13NRequest(HttpServletRequest request)
throws IllegalArgumentException
Returns a P13N Request that acts as a surrogate for an
HTTP request.
Parameters
-
request
- the request used to create the Session object.
Returns
- a new ConfigurableEntity that allows access to an
HttpServletRequest
Exceptions
-
IllegalArgumentException
- If the paramater is null.
getAttribute(String) Method
public Object getAttribute(String name)
getAttributeNames() Method
public Enumeration getAttributeNames()
getAuthType() Method
public String getAuthType()
getCharacterEncoding() Method
public String getCharacterEncoding()
getContentLength() Method
public int getContentLength()
getContentType() Method
public String getContentType()
getContextPath() Method
public String getContextPath()
getCookies() Method
public Cookie[] getCookies()
getDateHeader(String) Method
public long getDateHeader(String name)
getHeader(String) Method
public String getHeader(String name)
getHeaderNames() Method
public Enumeration getHeaderNames()
getHeaders(String) Method
public Enumeration getHeaders(String name)
getInputStream() Method
public ServletInputStream getInputStream()
getIntHeader(String) Method
public int getIntHeader(String name)
getLocale() Method
public Locale getLocale()
getLocales() Method
public Enumeration getLocales()
getMethod(String) Method
public String getMethod(String name)
getMethod() Method
public String getMethod()
getP13NSession() Method
public Session getP13NSession()
Get the P13N Session related to this request (can be null).
getParameter(String) Method
public String getParameter(String name)
getParameterMap() Method
public Map getParameterMap()
getParameterNames() Method
public Enumeration getParameterNames()
getParameterValues(String) Method
public String[] getParameterValues(String name)
getPathInfo() Method
public String getPathInfo()
getPathTranslated() Method
public String getPathTranslated()
getProperty(String, String) Method
public Object getProperty(String propertySet,
String propertyName)
Retrieves a property value for the specified property set and name.
The getProperty method will first look in the HTTP request attributes
for the property and if not found, it will look for the property in the
HTTP request parameters. If not found, then it looks in the Http headers.
If not found, then it looks in the request methods (getContentType()).
If not found, then it uses the propertySet parameter to find a
propertySet for a 'REQUEST' type. If found, it uses the
default value in that property set.
-
Overrides
-
HttpConfigurableEntity.getProperty(String, String)
Parameters
-
propertySet
- The name of the property set for which the property is
sought. This only used if no property is found in the request
and we use the scope to look up the default value in the property set for the
request. This parameter can be null.
-
propertyName
- The property name
Returns
- the property value
Related Topics
Request.getPropertyNoDefault(String, String)
getPropertyNoDefault(String, String) Method
public Object getPropertyNoDefault(String propertySet,
String propertyName)
Retrieves a property value for the specified property set and name.
The getProperty method will first look in the HTTP request attributes
for the property and if not found, it will look for the property in the
HTTP request parameters. If not found, then it looks in the Http headers.
If not found, then it looks in the request methods (getContentType()).
-
Overrides
-
HttpConfigurableEntity.getPropertyNoDefault(String, String)
Parameters
-
propertySet
- The name of the property set for which the property is
sought. This only used if no property is found in the request
and we use the scope to look up the default value in the property set for the
request. This parameter can be null.
-
propertyName
- The property name
Returns
- the property value
getProtocol() Method
public String getProtocol()
getQueryString() Method
public String getQueryString()
getReader() Method
public BufferedReader getReader()
getRealPath(String) Method
public String getRealPath(String path)
getRemoteAddr() Method
public String getRemoteAddr()
getRemoteHost() Method
public String getRemoteHost()
getRemoteUser() Method
public String getRemoteUser()
getRequestDispatcher(String) Method
public RequestDispatcher getRequestDispatcher(String uri)
getRequestedSessionId() Method
public String getRequestedSessionId()
getRequestURI() Method
public String getRequestURI()
getRequestURL() Method
public StringBuffer getRequestURL()
getScheme() Method
public String getScheme()
getServerName() Method
public String getServerName()
getServerPort() Method
public int getServerPort()
getServletPath() Method
public String getServletPath()
getSession(boolean) Method
public HttpSession getSession(boolean create)
getSession() Method
public HttpSession getSession()
getUserPrincipal() Method
public Principal getUserPrincipal()
isRequestedSessionIdFromCookie() Method
public boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromUrl() Method
public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromURL() Method
public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdValid() Method
public boolean isRequestedSessionIdValid()
isSecure() Method
public boolean isSecure()
isUserInRole(String) Method
public boolean isUserInRole(String role)
removeAttribute(String) Method
public void removeAttribute(String name)
setAttribute(String, Object) Method
public void setAttribute(String name,
Object o)
setCharacterEncoding(String) Method
public void setCharacterEncoding(String anEncoding)
setP13NSession(Session) Method
public void setP13NSession(Session session)
Set the P13N Session related to this request.