Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.http
Class Request

    java.lang.Object
      com.bea.p13n.http.HttpConfigurableEntity
          com.bea.p13n.http.Request

All Implemented Interfaces
  ConfigurableEntity, Serializable, javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

    public class Request

extends HttpConfigurableEntity
implements Serializable, javax.servlet.http.HttpServletRequest

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 `AttributeLoaders` specified by the AttributeLoaderBean's RequestLoaders attribute.

See Also
  Serialized Form

Nested Class Summary
`static interface` | `Request.AttributeLoader` An object which is capable of loading additional attributes into a Request.

Field Summary
`static boolean` | `ATTRIBUTE_OVERRIDE` Controls whether the `getProperty` and `getPropertyNoDefault` methods check the HttpRequest attributes prior to the HttpRequest parameters.
`static String` | `AUTHORIZATION_SCHEME`
`static String` | `CHAR_ENCODING`
`static String` | `CONTENT_LENGTH`
`static String` | `CONTENT_TYPE`
`static String` | `CONTEXT_PATH`
`static String` | `LOCAL_ADDR`
`static String` | `LOCAL_NAME`
`static String` | `LOCAL_PORT`
`static String` | `LOCALE`
`static String` | `PATH_INFO`
`static String` | `PATH_TRANSLATED`
`static String` | `QUERY_STRING`
`static String` | `REMOTE_ADDRESS`
`static String` | `REMOTE_HOST`
`static String` | `REMOTE_PORT`
`static String` | `REMOTE_USER`
`static String` | `REQUEST_METHOD`
`static String` | `REQUEST_PROPERTY_SET_TYPE` request property set type
`static String` | `REQUEST_PROTOCOL`
`static String` | `REQUEST_URI`
`static String` | `REQUEST_URL`
`static String` | `SCHEME`
`static String` | `SERVER_NAME`
`static String` | `SERVER_PORT`
`static String` | `SERVLET_PATH`
`static String` | `USER_PRINCIPAL`

Fields inherited from interface javax.servlet.http.HttpServletRequest
`BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH`

Fields inherited from interface com.bea.p13n.property.ConfigurableEntity
`RESERVED_PROPERTY_SET`

Constructor Summary
`Request()` Default Constructor
`Request(javax.servlet.http.HttpServletRequest request)` Creates a P13N HTTP Request.
`Request(javax.servlet.http.HttpServletRequest request, boolean createSession)` Creates a P13N HTTP Request and, possibly, Session.

Method Summary
`static Request` | `createP13NRequest(javax.servlet.http.HttpServletRequest request)` Returns a P13N Request that acts as a surrogate for an HTTP request.
`Object` | `getAttribute(String name)`
`Enumeration` | `getAttributeNames()`
`String` | `getAuthType()`
`String` | `getCharacterEncoding()`
`int` | `getContentLength()`
`String` | `getContentType()`
`String` | `getContextPath()`
`javax.servlet.http.Cookie[]` | `getCookies()`
`long` | `getDateHeader(String name)`
`String` | `getHeader(String name)`
`Enumeration` | `getHeaderNames()`
`Enumeration` | `getHeaders(String name)`
`javax.servlet.ServletInputStream` | `getInputStream()`
`int` | `getIntHeader(String name)`
`String` | `getLocalAddr()`
`Locale` | `getLocale()`
`Enumeration` | `getLocales()`
`String` | `getLocalName()`
`int` | `getLocalPort()`
`String` | `getMethod()`
`String` | `getMethod(String name)`
`Session` | `getP13NSession()` Get the P13N Session related to this request (can be null).
`String` | `getParameter(String name)`
`Map` | `getParameterMap()`
`Enumeration` | `getParameterNames()`
`String[]` | `getParameterValues(String name)`
`String` | `getPathInfo()`
`String` | `getPathTranslated()`
`Object` | `getProperty(String propertySet, String propertyName)` Retrieves a property value for the specified property set and name.
`Object` | `getPropertyNoDefault(String propertySet, String propertyName)` Retrieves a property value for the specified property set and name.
`String` | `getProtocol()`
`String` | `getQueryString()`
`BufferedReader` | `getReader()`
`String` | `getRealPath(String path)`
`String` | `getRemoteAddr()`
`String` | `getRemoteHost()`
`int` | `getRemotePort()`
`String` | `getRemoteUser()`
`javax.servlet.RequestDispatcher` | `getRequestDispatcher(String uri)`
`String` | `getRequestedSessionId()`
`String` | `getRequestURI()`
`StringBuffer` | `getRequestURL()`
`String` | `getScheme()`
`String` | `getServerName()`
`int` | `getServerPort()`
`String` | `getServletPath()`
`javax.servlet.http.HttpSession` | `getSession()`
`javax.servlet.http.HttpSession` | `getSession(boolean create)`
`Principal` | `getUserPrincipal()`
`boolean` | `isRequestedSessionIdFromCookie()`
`boolean` | `isRequestedSessionIdFromUrl()`
`boolean` | `isRequestedSessionIdFromURL()`
`boolean` | `isRequestedSessionIdValid()`
`boolean` | `isSecure()`
`boolean` | `isUserInRole(String role)`
`void` | `removeAttribute(String name)`
`void` | `setAttribute(String name, Object o)`
`void` | `setCharacterEncoding(String anEncoding)`
`void` | `setP13NSession(Session session)` Set the P13N Session related to this request.
`void` | `setPrincipal(javax.servlet.http.HttpServletRequest request)`

Methods inherited from class com.bea.p13n.http.HttpConfigurableEntity
`getJndiName, getPkString, getProperty, getPropertyAsString, getPropertyDefault, getPropertySetManager, getUniqueId, removeProperty, setProperty`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### REQUEST_PROPERTY_SET_TYPE

    public static final String REQUEST_PROPERTY_SET_TYPE

  request property set type

  See Also
    Constants Summary

### REQUEST_METHOD

    public static final String REQUEST_METHOD

See Also
  Constants Summary

### REQUEST_URI

    public static final String REQUEST_URI

See Also
  Constants Summary

### REQUEST_URL

    public static final String REQUEST_URL

See Also
  Constants Summary

### REQUEST_PROTOCOL

    public static final String REQUEST_PROTOCOL

See Also
  Constants Summary

### SERVLET_PATH

    public static final String SERVLET_PATH

See Also
  Constants Summary

### PATH_INFO

    public static final String PATH_INFO

See Also
  Constants Summary

### PATH_TRANSLATED

    public static final String PATH_TRANSLATED

See Also
  Constants Summary

### CONTEXT_PATH

    public static final String CONTEXT_PATH

See Also
  Constants Summary

### QUERY_STRING

    public static final String QUERY_STRING

See Also
  Constants Summary

### CONTENT_LENGTH

    public static final String CONTENT_LENGTH

See Also
  Constants Summary

### CONTENT_TYPE

    public static final String CONTENT_TYPE

See Also
  Constants Summary

### SERVER_NAME

    public static final String SERVER_NAME

See Also
  Constants Summary

### SERVER_PORT

    public static final String SERVER_PORT

See Also
  Constants Summary

### REMOTE_USER

    public static final String REMOTE_USER

See Also
  Constants Summary

### REMOTE_ADDRESS

    public static final String REMOTE_ADDRESS

See Also
  Constants Summary

### REMOTE_HOST

    public static final String REMOTE_HOST

See Also
  Constants Summary

### REMOTE_PORT

    public static final String REMOTE_PORT

See Also
  Constants Summary

### LOCAL_NAME

    public static final String LOCAL_NAME

See Also
  Constants Summary

### LOCAL_ADDR

    public static final String LOCAL_ADDR

See Also
  Constants Summary

### LOCAL_PORT

    public static final String LOCAL_PORT

See Also
  Constants Summary

### SCHEME

    public static final String SCHEME

See Also
  Constants Summary

### AUTHORIZATION_SCHEME

    public static final String AUTHORIZATION_SCHEME

See Also
  Constants Summary

### LOCALE

    public static final String LOCALE

See Also
  Constants Summary

### CHAR_ENCODING

    public static final String CHAR_ENCODING

See Also
  Constants Summary

### USER_PRINCIPAL

    public static final String USER_PRINCIPAL

See Also
  Constants Summary

### ATTRIBUTE_OVERRIDE

    public static final boolean ATTRIBUTE_OVERRIDE

  Controls whether the `getProperty` and `getPropertyNoDefault` methods check the HttpRequest attributes prior to the HttpRequest parameters. By default, the parameters are checked first. To override the default set the system property com.bea.p13n.http.Request.AttributeOverride=Yes

Constructor Detail

### Request

    public Request()

  Default Constructor

### Request

    public Request(javax.servlet.http.HttpServletRequest request)

  Creates a P13N HTTP Request. This object copies values from the supplied HttpServletRequest. This does not automatically create the Session.

  Parameters
    `request` - the `HttpServletRequest` used to set and retrieve properties.

### Request

    public Request(javax.servlet.http.HttpServletRequest request,
                   boolean createSession)

  Creates a P13N HTTP Request and, possibly, Session. This object copies values from the supplied HttpServletRequest.

  Parameters
    `request` - the `HttpServletRequest` used to set and retrieve properties.
    `createSession` - true to also create a `Session` from the request's session and set it on this.
  See Also
    `setP13NSession(com.bea.p13n.http.Session)`, `Session`

Method Detail

### createP13NRequest

    public static Request createP13NRequest(javax.servlet.http.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`
  Throws
    `IllegalArgumentException` - If the paramater is null.

### setP13NSession

    public void setP13NSession(Session session)

  Set the P13N Session related to this request.

### getP13NSession

    public Session getP13NSession()

  Get the P13N Session related to this request (can be null).

### setPrincipal

    public void setPrincipal(javax.servlet.http.HttpServletRequest request)

### getPropertyNoDefault

    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()).

  Specified by:
    `getPropertyNoDefault` in interface `ConfigurableEntity`
  Specified by:
    `getPropertyNoDefault` in class `HttpConfigurableEntity`
  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

### getProperty

    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.

  Specified by:
    `getProperty` in interface `ConfigurableEntity`
  Specified by:
    `getProperty` in class `HttpConfigurableEntity`
  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
  See Also
    `getPropertyNoDefault(java.lang.String, java.lang.String)`

### getMethod

    public String getMethod(String name)

### getAttribute

    public Object getAttribute(String name)

  Specified by:
    `getAttribute` in interface `javax.servlet.ServletRequest`

### getAttributeNames

    public Enumeration getAttributeNames()

  Specified by:
    `getAttributeNames` in interface `javax.servlet.ServletRequest`

### getCharacterEncoding

    public String getCharacterEncoding()

  Specified by:
    `getCharacterEncoding` in interface `javax.servlet.ServletRequest`

### getContentLength

    public int getContentLength()

  Specified by:
    `getContentLength` in interface `javax.servlet.ServletRequest`

### getContentType

    public String getContentType()

  Specified by:
    `getContentType` in interface `javax.servlet.ServletRequest`

### getInputStream

    public javax.servlet.ServletInputStream getInputStream()

  Specified by:
    `getInputStream` in interface `javax.servlet.ServletRequest`

### getParameter

    public String getParameter(String name)

  Specified by:
    `getParameter` in interface `javax.servlet.ServletRequest`

### getParameterNames

    public Enumeration getParameterNames()

  Specified by:
    `getParameterNames` in interface `javax.servlet.ServletRequest`

### getParameterValues

    public String[] getParameterValues(String name)

  Specified by:
    `getParameterValues` in interface `javax.servlet.ServletRequest`

### getProtocol

    public String getProtocol()

  Specified by:
    `getProtocol` in interface `javax.servlet.ServletRequest`

### getScheme

    public String getScheme()

  Specified by:
    `getScheme` in interface `javax.servlet.ServletRequest`

### getServerName

    public String getServerName()

  Specified by:
    `getServerName` in interface `javax.servlet.ServletRequest`

### getServerPort

    public int getServerPort()

  Specified by:
    `getServerPort` in interface `javax.servlet.ServletRequest`

### getReader

    public BufferedReader getReader()

  Specified by:
    `getReader` in interface `javax.servlet.ServletRequest`

### getRemoteAddr

    public String getRemoteAddr()

  Specified by:
    `getRemoteAddr` in interface `javax.servlet.ServletRequest`

### getRemoteHost

    public String getRemoteHost()

  Specified by:
    `getRemoteHost` in interface `javax.servlet.ServletRequest`

### getRemotePort

    public int getRemotePort()

  Specified by:
    `getRemotePort` in interface `javax.servlet.ServletRequest`

### getLocalName

    public String getLocalName()

  Specified by:
    `getLocalName` in interface `javax.servlet.ServletRequest`

### getLocalAddr

    public String getLocalAddr()

  Specified by:
    `getLocalAddr` in interface `javax.servlet.ServletRequest`

### getLocalPort

    public int getLocalPort()

  Specified by:
    `getLocalPort` in interface `javax.servlet.ServletRequest`

### setAttribute

    public void setAttribute(String name,
                             Object o)

  Specified by:
    `setAttribute` in interface `javax.servlet.ServletRequest`

### removeAttribute

    public void removeAttribute(String name)

  Specified by:
    `removeAttribute` in interface `javax.servlet.ServletRequest`

### getLocale

    public Locale getLocale()

  Specified by:
    `getLocale` in interface `javax.servlet.ServletRequest`

### getLocales

    public Enumeration getLocales()

  Specified by:
    `getLocales` in interface `javax.servlet.ServletRequest`

### isSecure

    public boolean isSecure()

  Specified by:
    `isSecure` in interface `javax.servlet.ServletRequest`

### getRequestDispatcher

    public javax.servlet.RequestDispatcher getRequestDispatcher(String uri)

  Specified by:
    `getRequestDispatcher` in interface `javax.servlet.ServletRequest`

### getRealPath

    public String getRealPath(String path)

  Specified by:
    `getRealPath` in interface `javax.servlet.ServletRequest`

### getAuthType

    public String getAuthType()

  Specified by:
    `getAuthType` in interface `javax.servlet.http.HttpServletRequest`

### getCookies

    public javax.servlet.http.Cookie[] getCookies()

  Specified by:
    `getCookies` in interface `javax.servlet.http.HttpServletRequest`

### getDateHeader

    public long getDateHeader(String name)

  Specified by:
    `getDateHeader` in interface `javax.servlet.http.HttpServletRequest`

### getHeader

    public String getHeader(String name)

  Specified by:
    `getHeader` in interface `javax.servlet.http.HttpServletRequest`

### getHeaders

    public Enumeration getHeaders(String name)

  Specified by:
    `getHeaders` in interface `javax.servlet.http.HttpServletRequest`

### getHeaderNames

    public Enumeration getHeaderNames()

  Specified by:
    `getHeaderNames` in interface `javax.servlet.http.HttpServletRequest`

### getIntHeader

    public int getIntHeader(String name)

  Specified by:
    `getIntHeader` in interface `javax.servlet.http.HttpServletRequest`

### getMethod

    public String getMethod()

  Specified by:
    `getMethod` in interface `javax.servlet.http.HttpServletRequest`

### getPathInfo

    public String getPathInfo()

  Specified by:
    `getPathInfo` in interface `javax.servlet.http.HttpServletRequest`

### getPathTranslated

    public String getPathTranslated()

  Specified by:
    `getPathTranslated` in interface `javax.servlet.http.HttpServletRequest`

### getContextPath

    public String getContextPath()

  Specified by:
    `getContextPath` in interface `javax.servlet.http.HttpServletRequest`

### getQueryString

    public String getQueryString()

  Specified by:
    `getQueryString` in interface `javax.servlet.http.HttpServletRequest`

### getRemoteUser

    public String getRemoteUser()

  Specified by:
    `getRemoteUser` in interface `javax.servlet.http.HttpServletRequest`

### isUserInRole

    public boolean isUserInRole(String role)

  Specified by:
    `isUserInRole` in interface `javax.servlet.http.HttpServletRequest`

### getUserPrincipal

    public Principal getUserPrincipal()

  Specified by:
    `getUserPrincipal` in interface `javax.servlet.http.HttpServletRequest`

### getRequestedSessionId

    public String getRequestedSessionId()

  Specified by:
    `getRequestedSessionId` in interface `javax.servlet.http.HttpServletRequest`

### getRequestURI

    public String getRequestURI()

  Specified by:
    `getRequestURI` in interface `javax.servlet.http.HttpServletRequest`

### getServletPath

    public String getServletPath()

  Specified by:
    `getServletPath` in interface `javax.servlet.http.HttpServletRequest`

### getSession

    public javax.servlet.http.HttpSession getSession(boolean create)

  Specified by:
    `getSession` in interface `javax.servlet.http.HttpServletRequest`

### getSession

    public javax.servlet.http.HttpSession getSession()

  Specified by:
    `getSession` in interface `javax.servlet.http.HttpServletRequest`

### isRequestedSessionIdValid

    public boolean isRequestedSessionIdValid()

  Specified by:
    `isRequestedSessionIdValid` in interface `javax.servlet.http.HttpServletRequest`

### isRequestedSessionIdFromCookie

    public boolean isRequestedSessionIdFromCookie()

  Specified by:
    `isRequestedSessionIdFromCookie` in interface `javax.servlet.http.HttpServletRequest`

### isRequestedSessionIdFromURL

    public boolean isRequestedSessionIdFromURL()

  Specified by:
    `isRequestedSessionIdFromURL` in interface `javax.servlet.http.HttpServletRequest`

### isRequestedSessionIdFromUrl

    public boolean isRequestedSessionIdFromUrl()

  Specified by:
    `isRequestedSessionIdFromUrl` in interface `javax.servlet.http.HttpServletRequest`

### getParameterMap

    public Map getParameterMap()

  Specified by:
    `getParameterMap` in interface `javax.servlet.ServletRequest`

### setCharacterEncoding

    public void setCharacterEncoding(String anEncoding)

  Specified by:
    `setCharacterEncoding` in interface `javax.servlet.ServletRequest`

### getRequestURL

    public StringBuffer getRequestURL()

  Specified by:
    `getRequestURL` in interface `javax.servlet.http.HttpServletRequest`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.