public class VaadinPortletRequest extends javax.portlet.filter.PortletRequestWrapper implements VaadinRequest
PortletRequest and its subclasses.VaadinRequest,
VaadinPortletResponse,
Serialized Form| Constructor and Description |
|---|
VaadinPortletRequest(javax.portlet.PortletRequest request,
VaadinPortletService vaadinService)
Wraps a portlet request and an associated vaadin service.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getCharacterEncoding()
Returns the name of the character encoding used in the body of this
request.
|
int |
getContentLength()
Returns the length of the request content that can be read from the input
stream returned by
VaadinRequest.getInputStream(). |
String |
getContentType()
Returns the MIME type of the body of the request, or null if the type is
not known.
|
static VaadinPortletRequest |
getCurrent()
Gets the currently processed Vaadin portlet request.
|
static javax.portlet.PortletRequest |
getCurrentPortletRequest()
Gets the currently processed portlet request.
|
long |
getDateHeader(String name)
Returns the value of the specified request header as a long value that
represents a Date object.
|
String |
getHeader(String string)
Gets the value of a request header, e.g.
|
Enumeration<String> |
getHeaderNames()
Returns an enumeration of all the header names this request contains.
|
Enumeration<String> |
getHeaders(String name)
Returns all the values of the specified request header as an Enumeration
of String objects.
|
InputStream |
getInputStream()
Returns an input stream from which the request content can be read.
|
String |
getMethod()
Returns the name of the HTTP method with which this request was made, for
example, GET, POST, or PUT.
|
String |
getPathInfo()
Gets the path of the requested resource relative to the application.
|
String |
getPortalProperty(String name)
Reads a portal property from the portal context of the Vaadin request.
|
String |
getPortletPreference(String name)
Reads a portlet preference from the portlet of the request.
|
javax.portlet.PortletRequest |
getPortletRequest()
Gets the original, unwrapped portlet request.
|
BufferedReader |
getReader()
Retrieves the body of the request as character data using a
BufferedReader. |
String |
getRemoteAddr()
Returns the IP address from which the request came.
|
String |
getRemoteHost()
Returns the fully qualified name of the client or the last proxy that
sent the request.
|
int |
getRemotePort()
Returns the Internet Protocol (IP) source port of the client or last
proxy that sent the request.
|
VaadinPortletService |
getService()
Gets the vaadin service for the context of this request.
|
WrappedSession |
getWrappedSession()
Gets the session associated with this request, creating a new if there is
no session.
|
WrappedSession |
getWrappedSession(boolean allowSessionCreation)
Gets the session associated with this request, optionally creating a new
if there is no session.
|
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequest, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute, setRequestclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getRemoteUser, getUserPrincipal, isSecure, isUserInRole, removeAttribute, setAttributepublic VaadinPortletRequest(javax.portlet.PortletRequest request,
VaadinPortletService vaadinService)
request - the portlet request to wrapvaadinService - the associated vaadin servicepublic int getContentLength()
VaadinRequestVaadinRequest.getInputStream().getContentLength in interface VaadinRequestServletRequest.getContentLength(),
ClientDataRequest.getContentLength()public InputStream getInputStream() throws IOException
VaadinRequestVaadinRequest.getContentLength()
without reading the full stream contents.getInputStream in interface VaadinRequestIOException - if the input stream can not be openedServletRequest.getInputStream(),
ClientDataRequest.getPortletInputStream()public BufferedReader getReader() throws IOException
VaadinRequestBufferedReader. The reader translates the character data
according to the character encoding used on the body. Either this method
or VaadinRequest.getInputStream() may be called to read the body, not both.getReader in interface VaadinRequestUnsupportedEncodingException - - if the character set encoding used is not supported and the
text cannot be decodedIOException - if an input or output exception occurredServletRequest.getReader(),
ClientDataRequest.getReader()public String getPathInfo()
VaadinRequestnull if no path information is available. Does
always start with / if the path isn't null.getPathInfo in interface VaadinRequestHttpServletRequest.getPathInfo()public WrappedSession getWrappedSession()
VaadinRequestgetWrappedSession in interface VaadinRequestWrappedSession,
HttpServletRequest.getSession(),
PortletRequest.getPortletSession()public WrappedSession getWrappedSession(boolean allowSessionCreation)
VaadinRequestgetWrappedSession in interface VaadinRequestallowSessionCreation - true to create a new session for this request if
necessary; false to return null if
there's no current sessionWrappedSession,
HttpServletRequest.getSession(boolean),
PortletRequest.getPortletSession(boolean)public javax.portlet.PortletRequest getPortletRequest()
public String getContentType()
VaadinRequestgetContentType in interface VaadinRequestServletRequest.getContentType(),
ClientDataRequest.getContentType()public String getCharacterEncoding()
VaadinRequestnull if the request does not
specify a character encoding.getCharacterEncoding in interface VaadinRequestServletRequest.getCharacterEncoding(),
ClientDataRequest.getCharacterEncoding()public String getMethod()
VaadinRequestgetMethod in interface VaadinRequestHttpServletRequest.getMethod(),
ClientDataRequest.getMethod()public String getRemoteAddr()
VaadinRequestgetRemoteAddr in interface VaadinRequestnull if the
address is not availableServletRequest.getRemoteAddr()public String getRemoteHost()
VaadinRequestgetRemoteHost in interface VaadinRequestnull if the information is not available.ServletRequest.getRemoteHost()public int getRemotePort()
VaadinRequestgetRemotePort in interface VaadinRequestServletRequest.getRemotePort()public String getHeader(String string)
VaadinRequestHttpServletRequest.getHeader in interface VaadinRequeststring - the name of the headernull if the header is not
present in the requestHttpServletRequest.getHeader(String)public String getPortalProperty(String name)
name - a string with the name of the portal property to getnull if
the property is not definedpublic String getPortletPreference(String name)
name - The name of the portlet preference. Cannot be
null.null if the
preference is not defined.public VaadinPortletService getService()
VaadinRequestgetService in interface VaadinRequestVaadinServicepublic long getDateHeader(String name)
VaadinRequestThe date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive.
If the request did not have a header of the specified name, this method returns -1. If the header can't be converted to a date, the method throws an IllegalArgumentException.
getDateHeader in interface VaadinRequestname - a String specifying the name of the headerHttpServletRequest.getDateHeader(String)public Enumeration<String> getHeaderNames()
VaadinRequest
Some implementations do not allow access headers using this method, in
which case this method returns null
getHeaderNames in interface VaadinRequestnullHttpServletRequest.getHeaderNames()public Enumeration<String> getHeaders(String name)
VaadinRequest
Some headers, such as Accept-Language can be sent by clients
as several headers each with a different value rather than sending the
header as a comma separated list.
If the request did not include any headers of the specified name, this
method returns an empty Enumeration. If the request does not support
accessing headers, this method returns null.
The header name is case insensitive. You can use this method with any request header.
getHeaders in interface VaadinRequestname - a String specifying the header namenullHttpServletRequest.getHeaders(String)public static javax.portlet.PortletRequest getCurrentPortletRequest()
nullpublic static VaadinPortletRequest getCurrent()
getCurrent in interface VaadinRequestnullCopyright © 2021 Vaadin Ltd. All rights reserved.