|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.websphere.personalization.context.PersonalizationContext
public class PersonalizationContext
This class provides several static methods that are useful in creating a RequestContext. It is also an implementor of RequestContext.
RequestContext
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
CONTEXT_KEY
|
static java.lang.String |
COPYRIGHT
|
protected static boolean |
isPreviewServer
|
protected PznPortletRequestObjectInterface |
portletRequestObject
|
protected java.util.Date |
requestDate
|
protected PznRequestObjectInterface |
requestObject
|
protected java.lang.String |
requestUserName
|
protected java.lang.Object |
triggerBean
|
Constructor Summary | |
---|---|
protected |
PersonalizationContext()
|
protected |
PersonalizationContext(PznPortletRequestObjectInterface proi,
java.lang.Object trigger)
|
protected |
PersonalizationContext(PznRequestObjectInterface roi,
java.lang.Object trigger)
|
Method Summary | |
---|---|
boolean |
addCookie(javax.servlet.http.Cookie cookie)
Sets a cookie. |
java.lang.Object |
clone()
|
java.lang.Object |
get(java.lang.String key)
Get a value from the context. |
java.lang.Object |
getApplicationObject(java.lang.String key,
java.lang.String applicationObjectClass)
Retrieves an application object from the context. |
java.lang.Object |
getApplicationObjectByPath(java.lang.String path)
|
java.lang.String |
getAuthenticatedUsername()
Returns the username of the Authenticated User. |
java.lang.String |
getContextPath()
Used to get contextPath name from the HttpContext or surrogate. |
javax.servlet.http.Cookie |
getCookie(java.lang.String cookieName)
Returns the value of a particular cookie, or null if none exist. |
javax.servlet.http.Cookie[] |
getCookies()
Returns the array of cookies known to the request, or null if none exist. |
static RequestContext |
getCurrentContext()
|
java.util.Locale |
getLocale()
Used to get locale from the HttpContext or surrogate. |
java.lang.Object |
getPortletAttribute(java.lang.String itemName)
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists |
java.lang.Object |
getPortletSetting(java.lang.String itemName)
Returns the value of the named setting as an Object, or null if no attribute of the given name exists. |
com.ibm.websphere.personalization.preview.IPreviewState |
getPreviewState()
|
Resource |
getPreviewUserResource(java.lang.String resourceCollectionName)
Returns the user Resource instance when in preview mode |
PznRequestObjectInterface |
getPznRequestObjectInterface()
Returns the PznRequestObjectInterface |
java.lang.String |
getRemoteHost()
Returns the hostName (IP address if hostName cannot be determined) of the server requesting the jsp or servlet containing the rule request |
java.lang.String |
getRemoteUser()
Used to get remoteUser name from the HttpContext or surrogate. |
java.lang.Object |
getRequestAttribute(java.lang.String itemName)
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists |
static RequestContext |
getRequestContext()
Get an instance of a default RequestContext |
static RequestContext |
getRequestContext(javax.servlet.http.HttpServletRequest sr)
Get an instance of RequestContext based on an HttpServletRequest |
static RequestContext |
getRequestContext(javax.servlet.http.HttpServletRequest sr,
java.lang.Object trigger)
Get an instance of RequestContext based on an HttpServletRequest |
static RequestContext |
getRequestContext(java.lang.Object request,
java.lang.Object trigger)
Get an instance of RequestContext based on an HttpServletRequest |
static RequestContext |
getRequestContext(PznPortletRequestObjectInterface proi)
Get an instance of RequestContext based on a PznPortletRequestObjectInterface |
static RequestContext |
getRequestContext(PznPortletRequestObjectInterface proi,
java.lang.Object trigger)
Get an instance of RequestContext. |
static RequestContext |
getRequestContext(PznRequestObjectInterface roi)
Get an instance of RequestContext based on a PznRequestObjectInterface |
static RequestContext |
getRequestContext(PznRequestObjectInterface roi,
java.lang.Object trigger)
Get an instance of RequestContext. |
java.util.Date |
getRequestDate()
Returns the date of the request. |
java.lang.String |
getRequestInfo()
|
PznRequestObjectInterface |
getRequestObject()
|
java.lang.String |
getRequestParameter(java.lang.String itemName)
Returns the value of a request parameter as a String, or null if the parameter does not exist. |
java.lang.String[] |
getRequestParameterValues(java.lang.String itemName)
Returns the value of a request parameter as a String, or null if the parameter does not exist. |
java.lang.String |
getRequestUsername()
Returns the username that personalization will use. |
com.ibm.websphere.personalization.resources.ResourceContext |
getResourceContext()
Deprecated. |
java.lang.String |
getServerName()
Returns the hostName (IP address if hostName cannot be determined) of the server processing the rule request |
java.lang.Object |
getSessionAttribute(java.lang.String itemName)
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists |
java.lang.String |
getSessionInfo()
|
java.lang.String |
getTranslatedUsername(java.lang.String collectionName)
Returns the username that personalization will use for the specified collection. |
protected Resource |
getUserResource(java.lang.String collName)
|
protected void |
initialize(PznRequestObjectInterface roi,
java.lang.Object trigger)
|
protected void |
initializePreview()
|
boolean |
isPreviewMode()
Returns true if this is a preview execution context |
protected void |
mergePreviewRequest(PznPortletRequestObjectInterface previewRequest)
|
void |
removePortletAttribute(java.lang.String itemName)
Remove the value of the named attribute as an Object |
void |
removeRequestAttribute(java.lang.String itemName)
Remove the value of the named attribute as an Object |
void |
removeSessionAttribute(java.lang.String itemName)
Remove the value of the named attribute |
boolean |
setContextPath(java.lang.String contextPath)
Used to set the application contextPath in the HttpContext surrogate. |
boolean |
setLocale(java.util.Locale locale)
Used to set locale in the HttpContext surrogate. |
boolean |
setPortletAttribute(java.lang.String itemName,
java.lang.Object itemValue)
Set the value of the named attribute as an Object |
void |
setPreviewMode(boolean previewMode)
|
boolean |
setRemoteUser(java.lang.String userName)
Used to set remoteUser name in the HttpContext surrogate. |
void |
setRequestAttribute(java.lang.String itemName,
java.lang.Object itemValue)
Set the value of the named attribute as an Object |
boolean |
setRequestParameter(java.lang.String itemName,
java.lang.String itemValue)
Sets the value of a request parameter. |
boolean |
setRequestParameterValues(java.lang.String itemName,
java.lang.String[] itemValues)
Sets the value of a request parameter. |
void |
setRequestUsername(java.lang.String aName)
Set the username that personalization will use for the duration of this request. |
void |
setResourceContext(com.ibm.websphere.personalization.resources.ResourceContext resContext)
Deprecated. |
boolean |
setSessionAttribute(java.lang.String itemName,
java.lang.Object itemValue)
Set the value of the named attribute. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
public static final java.lang.String CONTEXT_KEY
protected static boolean isPreviewServer
protected java.lang.String requestUserName
protected PznRequestObjectInterface requestObject
protected PznPortletRequestObjectInterface portletRequestObject
protected java.lang.Object triggerBean
protected java.util.Date requestDate
Constructor Detail |
---|
protected PersonalizationContext()
protected PersonalizationContext(PznRequestObjectInterface roi, java.lang.Object trigger)
protected PersonalizationContext(PznPortletRequestObjectInterface proi, java.lang.Object trigger)
Method Detail |
---|
protected void initialize(PznRequestObjectInterface roi, java.lang.Object trigger)
public java.lang.String getRequestInfo()
getRequestInfo
in interface RequestContext
public java.lang.String getSessionInfo()
getSessionInfo
in interface RequestContext
public boolean isPreviewMode()
RequestContext
isPreviewMode
in interface RequestContext
public static RequestContext getCurrentContext()
public void setPreviewMode(boolean previewMode)
public Resource getPreviewUserResource(java.lang.String resourceCollectionName)
RequestContext
getPreviewUserResource
in interface RequestContext
public java.lang.Object get(java.lang.String key)
RequestContext
get
in interface RequestContext
key
- java.lang.String
public java.lang.Object getApplicationObjectByPath(java.lang.String path)
public java.lang.Object getApplicationObject(java.lang.String key, java.lang.String applicationObjectClass)
getApplicationObject
in interface RequestContext
key
- applicationObjectClass
-
public PznRequestObjectInterface getRequestObject()
public static RequestContext getRequestContext()
public static RequestContext getRequestContext(java.lang.Object request, java.lang.Object trigger)
request
- An implementation of either javax.servlet.http.HttpServletRequest, javax.portlet.PortletRequest, org.apache.jetspeed.portlet.PortletRequest, javax.servlet.http.HttpServletRequest, or com.ibm.websphere.personalization.PznRequestObjectInterface.trigger
- an object to use for dynamic classloading
public static RequestContext getRequestContext(javax.servlet.http.HttpServletRequest sr, java.lang.Object trigger)
sr
- javax.servlet.http.HttpServletRequesttrigger
- An object which may be used for dynamic classloading
public static RequestContext getRequestContext(javax.servlet.http.HttpServletRequest sr)
sr
- javax.servlet.http.HttpServletRequest
public static RequestContext getRequestContext(PznRequestObjectInterface roi)
roi
- PznRequestObjectInterface
public static RequestContext getRequestContext(PznRequestObjectInterface roi, java.lang.Object trigger)
roi
- The PznRequestObjectInterface which should back the returned RequestContexttrigger
- An object which may be used for dynamic classloading
public static RequestContext getRequestContext(PznPortletRequestObjectInterface proi)
proi
- The PznPortletRequestObjectInterface which should back the returned RequestContext
public static RequestContext getRequestContext(PznPortletRequestObjectInterface proi, java.lang.Object trigger)
proi
- The PznPortletRequestObjectInterface which should back the returned RequestContexttrigger
- An object which may be used for dynamic classloading
public com.ibm.websphere.personalization.preview.IPreviewState getPreviewState()
protected void initializePreview()
protected void mergePreviewRequest(PznPortletRequestObjectInterface previewRequest)
public java.lang.String getAuthenticatedUsername()
RequestContext
getAuthenticatedUsername
in interface RequestContext
public java.lang.String getRequestUsername()
RequestContext
getRequestUsername
in interface RequestContext
protected Resource getUserResource(java.lang.String collName)
public java.lang.Object getRequestAttribute(java.lang.String itemName)
RequestContext
getRequestAttribute
in interface RequestContext
public void setRequestAttribute(java.lang.String itemName, java.lang.Object itemValue)
RequestContext
setRequestAttribute
in interface RequestContext
public void removeRequestAttribute(java.lang.String itemName)
RequestContext
removeRequestAttribute
in interface RequestContext
public java.lang.Object getPortletAttribute(java.lang.String itemName)
RequestContext
getPortletAttribute
in interface RequestContext
public boolean setPortletAttribute(java.lang.String itemName, java.lang.Object itemValue)
RequestContext
setPortletAttribute
in interface RequestContext
public void removePortletAttribute(java.lang.String itemName)
RequestContext
removePortletAttribute
in interface RequestContext
public java.lang.Object getPortletSetting(java.lang.String itemName)
RequestContext
getPortletSetting
in interface RequestContext
public java.lang.String getRequestParameter(java.lang.String itemName)
RequestContext
getRequestParameter
in interface RequestContext
public java.lang.String getRemoteHost()
RequestContext
getRemoteHost
in interface RequestContext
public java.lang.String getServerName()
RequestContext
getServerName
in interface RequestContext
public boolean setRequestParameter(java.lang.String itemName, java.lang.String itemValue)
RequestContext
setRequestParameter
in interface RequestContext
public java.lang.String[] getRequestParameterValues(java.lang.String itemName)
RequestContext
getRequestParameterValues
in interface RequestContext
public boolean setRequestParameterValues(java.lang.String itemName, java.lang.String[] itemValues)
RequestContext
setRequestParameterValues
in interface RequestContext
public java.lang.Object getSessionAttribute(java.lang.String itemName)
RequestContext
getSessionAttribute
in interface RequestContext
public boolean setSessionAttribute(java.lang.String itemName, java.lang.Object itemValue)
RequestContext
setSessionAttribute
in interface RequestContext
public void removeSessionAttribute(java.lang.String itemName)
RequestContext
removeSessionAttribute
in interface RequestContext
public java.lang.String getRemoteUser()
RequestContext
getRemoteUser
in interface RequestContext
public boolean setRemoteUser(java.lang.String userName)
RequestContext
setRemoteUser
in interface RequestContext
public java.util.Locale getLocale()
RequestContext
getLocale
in interface RequestContext
public boolean setLocale(java.util.Locale locale)
RequestContext
setLocale
in interface RequestContext
public java.lang.String getContextPath()
RequestContext
getContextPath
in interface RequestContext
public boolean setContextPath(java.lang.String contextPath)
RequestContext
setContextPath
in interface RequestContext
public javax.servlet.http.Cookie[] getCookies()
RequestContext
getCookies
in interface RequestContext
public javax.servlet.http.Cookie getCookie(java.lang.String cookieName)
RequestContext
getCookie
in interface RequestContext
public boolean addCookie(javax.servlet.http.Cookie cookie)
RequestContext
addCookie
in interface RequestContext
public java.util.Date getRequestDate()
RequestContext
getRequestDate
in interface RequestContext
public com.ibm.websphere.personalization.resources.ResourceContext getResourceContext()
RequestContext
getResourceContext
in interface RequestContext
public void setResourceContext(com.ibm.websphere.personalization.resources.ResourceContext resContext)
RequestContext
setResourceContext
in interface RequestContext
public void setRequestUsername(java.lang.String aName)
RequestContext
setRequestUsername
in interface RequestContext
public java.lang.String getTranslatedUsername(java.lang.String collectionName)
RequestContext
getTranslatedUsername
in interface RequestContext
public PznRequestObjectInterface getPznRequestObjectInterface()
RequestContext
getPznRequestObjectInterface
in interface RequestContext
public java.lang.Object clone()
clone
in interface RequestContext
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |