|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.portal.portlet.impl.PortletRequestImpl
PortletRequest implemention. The parameter implementation is left to subclasses that can implement it differently.
| Field Summary | |
protected PortletContainer |
component
|
protected ContentTypes |
contentTypes
|
protected ComponentRequest |
creq
|
protected ComponentResponse |
cresp
|
protected javax.servlet.http.HttpServletRequest |
dreq
|
protected InstanceContext |
instanceContext
|
protected ComponentInvocation |
invocation
|
protected static org.apache.log4j.Logger |
log
|
protected PortalContext |
portalContext
|
protected PortletPreferences |
preferences
|
protected PortletSessionImpl |
psession
|
protected RequestContext |
requestContext
|
protected SecurityContext |
securityContext
|
protected SessionContext |
sessionProvider
|
protected int |
sessionStatus
|
protected UserContext |
userContext
|
protected java.util.Map |
userInfo
|
| Fields inherited from interface javax.portlet.PortletRequest |
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH, USER_INFO |
| Constructor Summary | |
PortletRequestImpl(ComponentInvocation invocation)
|
|
| Method Summary | |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the value of the named attribute as an Object,
or null if no attribute of the given name exists. |
java.util.Enumeration |
getAttributeNames()
Returns an Enumeration containing the
names of the attributes available to this request. |
java.lang.String |
getAuthType()
Returns the name of the authentication scheme used for the connection between client and portal, for example, BASIC_AUTH, CLIENT_CERT_AUTH,
a custom one or null if there was no authentication. |
java.lang.String |
getContextPath()
Returns the context path which is the path prefix associated with the deployed portlet application. |
java.util.Locale |
getLocale()
Returns the preferred Locale in which the portal will accept content. |
java.util.Enumeration |
getLocales()
Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale in which the portal will accept content for this request. |
PortalContext |
getPortalContext()
Returns the context of the calling portal. |
PortletSession |
getPortletSession()
Returns the current portlet session or, if there is no current session, creates one and returns the new session. |
PortletSession |
getPortletSession(boolean create)
Returns the current portlet session or, if there is no current session and the given flag is true, creates one and returns
the new session. |
PortletPreferences |
getPreferences()
Returns the preferences object associated with the portlet. |
java.util.Enumeration |
getProperties(java.lang.String name)
Returns all the values of the specified request property as a Enumeration of String objects. |
java.lang.String |
getProperty(java.lang.String name)
Returns the value of the specified request property as a String. |
java.util.Enumeration |
getPropertyNames()
Returns a Enumeration of all the property names
this request contains. |
java.lang.String |
getRemoteUser()
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. |
java.lang.String |
getRequestedSessionId()
Returns the session ID indicated in the client request. |
java.lang.String |
getResponseContentType()
Returns the portal preferred content type for the response. |
java.util.Enumeration |
getResponseContentTypes()
Gets a list of content types which the portal accepts for the response. |
java.lang.String |
getScheme()
Returns the name of the scheme used to make this request. |
java.lang.String |
getServerName()
Returns the host name of the server that received the request. |
int |
getServerPort()
Returns the port number on which this request was received. |
java.security.Principal |
getUserPrincipal()
Returns a java.security.Principal object containing the name of the current authenticated user. |
boolean |
isPortletModeAllowed(PortletMode portletMode)
Returns true, if the given portlet mode is a valid one to set for this portlet in the context of the current request. |
boolean |
isRequestedSessionIdValid()
Checks whether the requested session ID is still valid. |
boolean |
isSecure()
Returns a boolean indicating whether this request was made using a secure channel between client and the portal, such as HTTPS. |
boolean |
isUserInRole(java.lang.String roleName)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role". |
boolean |
isWindowStateAllowed(WindowState windowState)
Returns true, if the given window state is valid to be set for this portlet in the context of the current request. |
void |
removeAttribute(java.lang.String name)
Removes an attribute from this request. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Stores an attribute in this request. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.portlet.PortletRequest |
getParameter, getParameterMap, getParameterNames, getParameterValues, getPortletMode, getWindowState |
| Field Detail |
protected static final org.apache.log4j.Logger log
protected ComponentInvocation invocation
protected UserContext userContext
protected SecurityContext securityContext
protected RequestContext requestContext
protected InstanceContext instanceContext
protected PortletPreferences preferences
protected ComponentRequest creq
protected ComponentResponse cresp
protected SessionContext sessionProvider
protected PortletContainer component
protected ContentTypes contentTypes
protected java.util.Map userInfo
protected javax.servlet.http.HttpServletRequest dreq
protected PortalContext portalContext
protected PortletSessionImpl psession
protected int sessionStatus
| Constructor Detail |
public PortletRequestImpl(ComponentInvocation invocation)
| Method Detail |
public java.lang.Object getAttribute(java.lang.String name)
PortletRequestObject,
or null if no attribute of the given name exists.
Attribute names should follow the same conventions as package
names. This specification reserves names matching java.*,
and javax.*.
In a distributed portlet web application the Object
needs to be serializable.
getAttribute in interface PortletRequestname - a String specifying the name of
the attribute
Object containing the value
of the attribute, or null if
the attribute does not exist.public java.util.Enumeration getAttributeNames()
PortletRequestEnumeration containing the
names of the attributes available to this request.
This method returns an empty Enumeration
if the request has no attributes available to it.
getAttributeNames in interface PortletRequestEnumeration of strings
containing the names
of the request attributes, or an empty
Enumeration if the request
has no attributes available to it.
public void setAttribute(java.lang.String name,
java.lang.Object value)
PortletRequestAttribute names should follow the same conventions as
package names. Names beginning with java.*,
javax.*, and com.sun.* are
reserved for use by Sun Microsystems.
If the value passed into this method is null,
the effect is the same as calling PortletRequest.removeAttribute(java.lang.String).
setAttribute in interface PortletRequestname - a String specifying
the name of the attributevalue - the Object to be storedpublic void removeAttribute(java.lang.String name)
PortletRequestAttribute names should follow the same conventions as
package names. Names beginning with java.*,
javax.*, and com.sun.* are
reserved for use by Sun Microsystems.
removeAttribute in interface PortletRequestname - a String specifying
the name of the attribute to be removedpublic java.lang.String getProperty(java.lang.String name)
PortletRequestString. If the request did not include a property
of the specified name, this method returns null.
A portlet can access portal/portlet-container specific properties through this method and, if available, the headers of the HTTP client request.
This method should only be used if the
property has only one value. If the property might have
more than one value, use PortletRequest.getProperties(java.lang.String).
If this method is used with a multivalued
parameter, the value returned is equal to the first value
in the Enumeration returned by getProperties.
getProperty in interface PortletRequestname - a String specifying the
property name
String containing the
value of the requested
property, or null
if the request does not
have a property of that name.public java.util.Enumeration getProperties(java.lang.String name)
PortletRequestEnumeration of String objects.
If the request did not include any propertys
of the specified name, this method returns an empty
Enumeration.
The property name is case insensitive. You can use
this method with any request property.
getProperties in interface PortletRequestname - a String specifying the
property name
Enumeration containing
the values of the requested property. If
the request does not have any properties of
that name return an empty Enumeration.public java.util.Enumeration getPropertyNames()
PortletRequestEnumeration of all the property names
this request contains. If the request has no
properties, this method returns an empty Enumeration.
getPropertyNames in interface PortletRequestEnumeration of all the
property names sent with this
request; if the request has
no properties, an empty Enumeration.public java.lang.String getContextPath()
PortletRequest
To encode a URL the PortletResponse.encodeURL(java.lang.String) method must be used.
getContextPath in interface PortletRequestString specifying the
portion of the request URL that indicates the context
of the requestPortletResponse.encodeURL(java.lang.String)public java.lang.String getAuthType()
PortletRequestBASIC_AUTH, CLIENT_CERT_AUTH,
a custom one or null if there was no authentication.
getAuthType in interface PortletRequestBASIC_AUTH,
FORM_AUTH, CLIENT_CERT_AUTH,
DIGEST_AUTH (suitable for == comparison)
indicating the authentication scheme,
a custom one, or
null if the request was
not authenticated.public java.lang.String getRemoteUser()
PortletRequest
getRemoteUser in interface PortletRequestString specifying the login
of the user making this request, or null
if the user login is not known.public java.security.Principal getUserPrincipal()
PortletRequest
getUserPrincipal in interface PortletRequestjava.security.Principal containing
the name of the user making this request, or
null if the user has not been
authenticated.public boolean isUserInRole(java.lang.String roleName)
PortletRequestfalse.
isUserInRole in interface PortletRequestroleName - a String specifying the name
of the role
boolean indicating whether
the user making this request belongs to a given role;
false if the user has not been
authenticated.public boolean isSecure()
PortletRequest
isSecure in interface PortletRequestpublic java.lang.String getResponseContentType()
PortletRequestThe content type only includes the MIME type, not the character set.
Only content types that the portlet has defined in its
deployment descriptor are valid return values for
this method call. If the portlet has defined
'*' or '* / *' as supported content
types, these may also be valid return values.
getResponseContentType in interface PortletRequestpublic java.util.Enumeration getResponseContentTypes()
PortletRequestThe content type only includes the MIME type, not the character set.
Only content types that the portlet has defined in its
deployment descriptor are valid return values for
this method call. If the portlet has defined
'*' or '* / *' as supported content
types, these may also be valid return values.
getResponseContentTypes in interface PortletRequestpublic java.util.Locale getLocale()
PortletRequest
getLocale in interface PortletRequestpublic boolean isPortletModeAllowed(PortletMode portletMode)
PortletRequest
isPortletModeAllowed in interface PortletRequestportletMode - portlet mode to check
public boolean isWindowStateAllowed(WindowState windowState)
PortletRequest
isWindowStateAllowed in interface PortletRequestwindowState - window state to checked
public PortletSession getPortletSession()
PortletRequest
Creating a new portlet session will result in creating
a new HttpSession on which the portlet session is based on.
getPortletSession in interface PortletRequestpublic PortletSession getPortletSession(boolean create)
PortletRequesttrue, creates one and returns
the new session.
If the given flag is false and there is no current
portlet session, this method returns null.
Creating a new portlet session will result in creating
a new HttpSession on which the portlet session is based on.
getPortletSession in interface PortletRequestcreate - true to create a new session, false to return null if there
is no current session
public PortalContext getPortalContext()
PortletRequest
getPortalContext in interface PortletRequestpublic java.lang.String getRequestedSessionId()
PortletRequestnull.
getRequestedSessionId in interface PortletRequestString specifying the session
ID, or null if the request did
not specify a session IDPortletRequest.isRequestedSessionIdValid()public boolean isRequestedSessionIdValid()
PortletRequest
isRequestedSessionIdValid in interface PortletRequesttrue if this
request has an id for a valid session
in the current session context;
false otherwisePortletRequest.getRequestedSessionId(),
PortletRequest.getPortletSession()public java.util.Enumeration getLocales()
PortletRequest
getLocales in interface PortletRequestpublic java.lang.String getScheme()
PortletRequesthttp, https, or ftp.
Different schemes have different rules for constructing URLs,
as noted in RFC 1738.
getScheme in interface PortletRequestString containing the name
of the scheme used to make this requestpublic java.lang.String getServerName()
PortletRequest
getServerName in interface PortletRequestString containing the name
of the server to which the request was sentpublic int getServerPort()
PortletRequest
getServerPort in interface PortletRequestpublic PortletPreferences getPreferences()
PortletRequest
getPreferences in interface PortletRequest
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||