OpenAPI 1.0

com.aquafold.openapi
Interface AQRequest


public interface AQRequest

This interface provides basic information about an http request.

An instance of this interface is available to the script via aqua.request alias.


Method Summary
 Cookie[] getCookies()
          Returns an array containing all of the Cookie objects the client sent with this request.
 String getHeader(String name)
          Returns the value of the specified request header as a String.
 String[] getHeaderNames()
          Returns string array of all the header names this request contains.
 String[] getHeaders(String name)
          Returns all the values of the specified request header as a String array.
 Locale[] getLocales()
          Returns an array 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.
 String getMethod()
          Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
 String getParameter(String name)
          Returns value of the given request parameter, or null if the parameter is not found.
 String getParameter(String name, String defaultValue)
          Returns value of the given request parameter, or the defaultValue specified if parameter is not found.
 Enumeration getParameterNames()
          Returns an Enumeration of String objects containing the names of the parameters contained in this request.
 String[] getParameterValues(String name)
          Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
 String getRemoteAddr()
          Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
 String getRemoteHost()
          Returns the fully qualified name of the client or the last proxy that sent the request.
 String getRequestURI()
          Returns the part of this request's URL excluding protocol, host name and the part of the query string after '?' character, for the purpose of constructing relative links.
 AQSession getSession()
          Returns the current session associated with this request, or if the request does not have a session, creates one.
 

Method Detail

getMethod

String getMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.


getRequestURI

String getRequestURI()
Returns the part of this request's URL excluding protocol, host name and the part of the query string after '?' character, for the purpose of constructing relative links.


getParameter

String getParameter(String name)
Returns value of the given request parameter, or null if the parameter is not found.

Parameters:
name - Parameter name.

getParameter

String getParameter(String name,
                    String defaultValue)
Returns value of the given request parameter, or the defaultValue specified if parameter is not found.

Parameters:
name - Parameter name.
defaultValue - Default value.

getParameterNames

Enumeration getParameterNames()
Returns an Enumeration of String objects containing the names of the parameters contained in this request.

Returns:
an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters

getParameterValues

String[] getParameterValues(String name)
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist. If the parameter has a single value, the array has a length of 1.

Parameters:
name - Parameter name.

getLocales

Locale[] getLocales()
Returns an array 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. If the client request doesn't provide an Accept-Language header, this method returns an array containing one Locale, the default locale for the server.


getSession

AQSession getSession()
Returns the current session associated with this request, or if the request does not have a session, creates one.


getRemoteAddr

String getRemoteAddr()
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.

Returns:
A String containing the IP address of the client that sent the request, or null if the address cannot be determined.

getRemoteHost

String getRemoteHost()
Returns the fully qualified name of the client or the last proxy that sent the request. If the engine cannot or chooses not to resolve the hostname (to improve performance), this method returns the dotted-string form of the IP address.

Returns:
A String containing the fully qualified name of the client, or null if the name cannot be determined.

getHeader

String getHeader(String name)
Returns the value of the specified request header as a String. If the request did not include a header of the specified name, this method returns null. If there are multiple headers with the same name, this method returns the first head in the request. The header name is case insensitive. You can use this method with any request header.

Parameters:
name - a String specifying the header name
Returns:
a String containing the value of the requested header, or null if the request does not have a header of that name

getHeaders

String[] getHeaders(String name)
Returns all the values of the specified request header as a String array.

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 null. The header name is case insensitive. You can use this method with any request header.

Parameters:
name - a String specifying the header name
Returns:
a String array containing the values of the requested header. If the request does not have any headers of that name return null. If the container does not allow access to header information, return null

getHeaderNames

String[] getHeaderNames()
Returns string array of all the header names this request contains. If the request has no headers, this method returns null.

Some servlet containers do not allow servlets to access headers using this method, in which case this method returns null

Returns:
a string array of all the header names sent with this request; if the request has no headers, null; if the servlet container does not allow servlets to use this method, null

getCookies

Cookie[] getCookies()
Returns an array containing all of the Cookie objects the client sent with this request. This method returns null if no cookies were sent.

Returns:
An array of all the Cookies included with this request, or null if the request has no cookies

OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.