|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface VaadinRequest
A generic request to the server, wrapping a more specific request type, e.g. HttpServletReqest or PortletRequest.
| Method Summary | |
|---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Gets a request attribute. |
java.util.Enumeration<java.lang.String> |
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 server, for example, BASIC_AUTH,
CLIENT_CERT_AUTH, a custom one or null if there
was no authentication. |
java.lang.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 getInputStream(). |
java.lang.String |
getContentType()
Returns the MIME type of the body of the request, or null if the type is not known. |
java.lang.String |
getContextPath()
Returns the portion of the request URI that indicates the context of the request. |
javax.servlet.http.Cookie[] |
getCookies()
Returns an array containing all of the Cookie objects the
client sent with this request. |
long |
getDateHeader(java.lang.String name)
Returns the value of the specified request header as a long value that represents a Date object. |
java.lang.String |
getHeader(java.lang.String headerName)
Gets the value of a request header, e.g. |
java.util.Enumeration<java.lang.String> |
getHeaderNames()
Returns an enumeration of all the header names this request contains. |
java.util.Enumeration<java.lang.String> |
getHeaders(java.lang.String name)
Returns all the values of the specified request header as an Enumeration of String objects. |
java.io.InputStream |
getInputStream()
Returns an input stream from which the request content can be read. |
java.util.Locale |
getLocale()
Gets locale information from the query, e.g. |
java.util.Enumeration<java.util.Locale> |
getLocales()
Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header. |
java.lang.String |
getMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. |
java.lang.String |
getParameter(java.lang.String parameter)
Gets the named request parameter This is typically a HTTP GET or POST parameter, though other request types might have other ways of representing parameters. |
java.util.Map<java.lang.String,java.lang.String[]> |
getParameterMap()
Gets all the parameters of the request. |
java.lang.String |
getPathInfo()
Gets the path of the requested resource relative to the application. |
java.io.BufferedReader |
getReader()
Retrieves the body of the request as character data using a BufferedReader. |
java.lang.String |
getRemoteAddr()
Returns the IP address from which the request came. |
java.lang.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. |
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. |
VaadinService |
getService()
Gets the vaadin service for the context of this request. |
java.security.Principal |
getUserPrincipal()
Returns a java.security.Principal object containing the name
of the current authenticated user. |
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. |
boolean |
isSecure()
Checks whether the request was made using a secure channel, e.g. |
boolean |
isUserInRole(java.lang.String role)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role". |
void |
removeAttribute(java.lang.String name)
Removes an attribute from this request. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Defines a request attribute. |
| Method Detail |
|---|
java.lang.String getParameter(java.lang.String parameter)
parameter - the name of the parameter
null if no parameter with the
given name is presentServletRequest.getParameter(String),
PortletRequest.getParameter(String)java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
getParameter(String),
ServletRequest.getParameterMap(),
PortletRequest.getParameter(String)int getContentLength()
getInputStream().
ServletRequest.getContentLength(),
ClientDataRequest.getContentLength()
java.io.InputStream getInputStream()
throws java.io.IOException
getContentLength()
without reading the full stream contents.
java.io.IOException - if the input stream can not be openedServletRequest.getInputStream(),
ClientDataRequest.getPortletInputStream()java.lang.Object getAttribute(java.lang.String name)
name - the name of the attribute
null if there is no
attribute with the given nameServletRequest.getAttribute(String),
PortletRequest.getAttribute(String)
void setAttribute(java.lang.String name,
java.lang.Object value)
name - the name of the attributevalue - the attribute valueServletRequest.setAttribute(String, Object),
PortletRequest.setAttribute(String, Object)java.lang.String getPathInfo()
null if no path information is available. Does
always start with / if the path isn't null.
HttpServletRequest.getPathInfo()java.lang.String getContextPath()
HttpServletRequest.getContextPath(),
PortletRequest.getContextPath()WrappedSession getWrappedSession()
WrappedSession,
HttpServletRequest.getSession(),
PortletRequest.getPortletSession()WrappedSession getWrappedSession(boolean allowSessionCreation)
allowSessionCreation - true to create a new session for this request if
necessary; false to return null if
there's no current session
WrappedSession,
HttpServletRequest.getSession(boolean),
PortletRequest.getPortletSession(boolean)java.lang.String getContentType()
ServletRequest.getContentType(),
ClientDataRequest.getContentType()java.util.Locale getLocale()
ServletRequest.getLocale(),
PortletRequest.getLocale()java.lang.String getRemoteAddr()
null if the
address is not availableServletRequest.getRemoteAddr()boolean isSecure()
ServletRequest.isSecure(),
PortletRequest.isSecure()java.lang.String getHeader(java.lang.String headerName)
HttpServletRequest.
headerName - the name of the header
null if the header is not
present in the requestHttpServletRequest.getHeader(String)VaadinService getService()
VaadinServicejavax.servlet.http.Cookie[] getCookies()
Cookie objects the
client sent with this request. This method returns null if
no cookies were sent.
Cookies included with this
request, or null if the request has no cookiesHttpServletRequest.getCookies(),
PortletRequest.getCookies()java.lang.String getAuthType()
BASIC_AUTH,
CLIENT_CERT_AUTH, a custom one or null if there
was no authentication.
null if the request was not authenticated.HttpServletRequest.getAuthType(),
PortletRequest.getAuthType()java.lang.String getRemoteUser()
null if the user login is not known.HttpServletRequest.getRemoteUser(),
PortletRequest.getRemoteUser()java.security.Principal getUserPrincipal()
java.security.Principal object containing the name
of the current authenticated user. If the user has not been
authenticated, the method returns null.
java.security.Principal containing the name of the
user making this request; null if the user has not
been authenticatedHttpServletRequest.getUserPrincipal(),
PortletRequest.getUserPrincipal()boolean isUserInRole(java.lang.String role)
false.
role - a String specifying the name of the role
false if the user has not been
authenticatedHttpServletRequest.isUserInRole(String),
PortletRequest.isUserInRole(String)void removeAttribute(java.lang.String name)
name - a String specifying the name of the attribute to removeServletRequest.removeAttribute(String),
PortletRequest.removeAttribute(String)java.util.Enumeration<java.lang.String> getAttributeNames()
ServletRequest.getAttributeNames(),
PortletRequest.getAttributeNames()java.util.Enumeration<java.util.Locale> getLocales()
ServletRequest.getLocales(),
PortletRequest.getLocales()java.lang.String getRemoteHost()
null if the information is not available.ServletRequest.getRemoteHost()int getRemotePort()
ServletRequest.getRemotePort()java.lang.String getCharacterEncoding()
null if the request does not
specify a character encoding.
ServletRequest.getCharacterEncoding(),
ClientDataRequest.getCharacterEncoding()
java.io.BufferedReader getReader()
throws java.io.IOException
BufferedReader. The reader translates the character data
according to the character encoding used on the body. Either this method
or getInputStream() may be called to read the body, not both.
java.io.UnsupportedEncodingException - - if the character set encoding used is not supported and the
text cannot be decoded
java.lang.IllegalStateException - - if getInputStream() method has been called on this
request
java.io.IOException - if an input or output exception occurredServletRequest.getReader(),
ClientDataRequest.getReader()java.lang.String getMethod()
HttpServletRequest.getMethod(),
ClientDataRequest.getMethod()long getDateHeader(java.lang.String name)
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.
name - a String specifying the name of the header
java.lang.IllegalArgumentException - If the header value can't be converted to a dateHttpServletRequest.getDateHeader(String)java.util.Enumeration<java.lang.String> getHeaderNames()
Some implementations do not allow access headers using this method, in
which case this method returns null
nullHttpServletRequest.getHeaderNames()java.util.Enumeration<java.lang.String> getHeaders(java.lang.String name)
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.
name - a String specifying the header name
nullHttpServletRequest.getHeaders(String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||