public class VaadinPortletRequest extends PortletRequestWrapper implements VaadinRequest
PortletRequest
and its subclasses.VaadinRequest
,
VaadinPortletResponse
,
Serialized FormConstructor and Description |
---|
VaadinPortletRequest(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 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.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getRemoteUser, getUserPrincipal, isSecure, isUserInRole, removeAttribute, setAttribute
public VaadinPortletRequest(PortletRequest request, VaadinPortletService vaadinService)
request
- the portlet request to wrapvaadinService
- the associated vaadin servicepublic int getContentLength()
VaadinRequest
VaadinRequest.getInputStream()
.getContentLength
in interface VaadinRequest
ServletRequest.getContentLength()
,
javax.portlet.ClientDataRequest#getContentLength()
public InputStream getInputStream() throws IOException
VaadinRequest
VaadinRequest.getContentLength()
without reading the full stream contents.getInputStream
in interface VaadinRequest
IOException
- if the input stream can not be openedServletRequest.getInputStream()
,
javax.portlet.ClientDataRequest#getPortletInputStream()
public BufferedReader getReader() throws IOException
VaadinRequest
BufferedReader
. 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 VaadinRequest
UnsupportedEncodingException
- - 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()
VaadinRequest
null
if no path information is available. Does
always start with / if the path isn't null
.getPathInfo
in interface VaadinRequest
HttpServletRequest.getPathInfo()
public WrappedSession getWrappedSession()
VaadinRequest
getWrappedSession
in interface VaadinRequest
WrappedSession
,
HttpServletRequest.getSession()
,
PortletRequest#getPortletSession()
public WrappedSession getWrappedSession(boolean allowSessionCreation)
VaadinRequest
getWrappedSession
in interface VaadinRequest
allowSessionCreation
- 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 PortletRequest getPortletRequest()
public String getContentType()
VaadinRequest
getContentType
in interface VaadinRequest
ServletRequest.getContentType()
,
javax.portlet.ResourceRequest#getContentType()
public String getCharacterEncoding()
VaadinRequest
null
if the request does not
specify a character encoding.getCharacterEncoding
in interface VaadinRequest
ServletRequest.getCharacterEncoding()
,
ClientDataRequest#getCharacterEncoding()
public String getMethod()
VaadinRequest
getMethod
in interface VaadinRequest
HttpServletRequest.getMethod()
,
ClientDataRequest#getMethod()
public String getRemoteAddr()
VaadinRequest
getRemoteAddr
in interface VaadinRequest
null
if the
address is not availableServletRequest.getRemoteAddr()
public String getRemoteHost()
VaadinRequest
getRemoteHost
in interface VaadinRequest
null
if the information is not available.ServletRequest.getRemoteHost()
public int getRemotePort()
VaadinRequest
getRemotePort
in interface VaadinRequest
ServletRequest.getRemotePort()
public String getHeader(String string)
VaadinRequest
HttpServletRequest
.getHeader
in interface VaadinRequest
string
- 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()
VaadinRequest
getService
in interface VaadinRequest
VaadinService
public long getDateHeader(String name)
VaadinRequest
The 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 VaadinRequest
name
- 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 VaadinRequest
null
HttpServletRequest.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 VaadinRequest
name
- a String specifying the header namenull
HttpServletRequest.getHeaders(String)
public static PortletRequest getCurrentPortletRequest()
null
public static VaadinPortletRequest getCurrent()
null
Copyright © 2019 Vaadin Ltd. All rights reserved.