m.c.m.proxyma.resource
Interface ProxymaRequest

All Known Implementing Classes:
ProxymaServletRequest

public interface ProxymaRequest

This the "Adapter" interface that will be used by Proxyma to manage client requests. Any concrete class that implements this interface can be used as Client request by Proxyma. Through this interface Proxyma can transparently handle "Servlet" or "Portlet" requests in the same way.

NOTE: this software is released under GPL License. See the LICENSE of this distribution for more informations.

Version:
$Id: ProxymaRequest.java 176 2010-07-03 09:02:14Z marcolinuz $
Author:
Marco Casavecchia Morganti (marcolinuz) [marcolinuz-at-gmail.com]

Method Summary
 java.lang.String getCharacterEncoding()
          Returns the name of the character encoding style used in this request.
 java.lang.String getContentType()
          Returns the MIME type of the content of the request, or null if the type is not known.
 java.lang.String getContextURLPath()
          Returns the base path of proxyma from the request (without host, port, protocol and query string)
 javax.servlet.http.Cookie[] getCookies()
          Returns an array containing all of the Cookie objects the browser sent with this request.
 java.lang.String getHeader(java.lang.String headerName)
          Returns the value of the specified request header as a String.
 java.util.Enumeration<java.lang.String> getHeaderNames()
          Returns an enumeration of all the header names this request contains.
 java.util.Enumeration getHeaders(java.lang.String headerName)
          Returns all the values of the specified request header as an Enumeration of String objects.
 java.io.InputStream getInputStream()
          Returns the input stream for read the request's data sent by the client
 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 parameterName)
          Returns the value of the asked parameter
 java.util.Enumeration getParameterNames()
          Returns the names of the parameters into the request
 java.lang.String getProtocol()
          Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.
 java.lang.String getQueryString()
          Returns the query string that is contained in the request URL after the path.
 java.lang.String getRemoteAddress()
          Returns the Internet Protocol (IP) address of the client that sent the request.
 java.lang.String getRemoteHost()
          Returns the fully qualified name of the client that sent the request.
 java.lang.String getRemoteUser()
          Returns the name of the user making this request, if the user has logged in using HTTP authentication.
 java.lang.String getRequestURI()
          Get the absoute requested path (without protocol, host, port and query string)
 java.lang.String getScheme()
          Returns the sheme used by the client to send the 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.lang.String getSubPath()
          Returns the path of the request (without protocol, host, port, proxyma context and query string)
 

Method Detail

getHeaderNames

java.util.Enumeration<java.lang.String> getHeaderNames()
Returns an enumeration of all the header names this request contains. If the request has no headers, this method returns an empty enumeration.

Returns:
a collection of header names.

getHeader

java.lang.String getHeader(java.lang.String headerName)
Returns the value of the specified request header as a String. If the named header wasn't sent with the request, this method returns null. The header name is case insensitive. You can use this method with any request header.

Returns:
the header value

getHeaders

java.util.Enumeration getHeaders(java.lang.String headerName)
Returns all the values of the specified request header as an Enumeration of String objects. 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. The header name is case insensitive. You can use this method with any request header.

Returns:
an Enumeration containing the values of the requested header. If the request does not have any headers of that name return an empty enumeration.

getContextURLPath

java.lang.String getContextURLPath()
Returns the base path of proxyma from the request (without host, port, protocol and query string)

Returns:
the absolute URI path that implements the current context.

getSubPath

java.lang.String getSubPath()
Returns the path of the request (without protocol, host, port, proxyma context and query string)

Returns:
the relative path from the proxyma base uri.

getRequestURI

java.lang.String getRequestURI()
Get the absoute requested path (without protocol, host, port and query string)

Returns:
the absolute path of the requested URI.

getQueryString

java.lang.String getQueryString()
Returns the query string that is contained in the request URL after the path. This method returns null if the URL does not have a query string.

Returns:
the query string

getMethod

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

Returns:
GET, POST, PUT...

getParameter

java.lang.String getParameter(java.lang.String parameterName)
Returns the value of the asked parameter

Parameters:
parameterName - The namwe of the reqested paramenter
Returns:
its value or null if it doesn't exists.

getParameterNames

java.util.Enumeration getParameterNames()
Returns the names of the parameters into the request

Returns:
the parameter names.

getProtocol

java.lang.String getProtocol()
Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.

Returns:
the protocol

getContentType

java.lang.String getContentType()
Returns the MIME type of the content of the request, or null if the type is not known.

Returns:
the value of the content-type header.

getCharacterEncoding

java.lang.String getCharacterEncoding()
Returns the name of the character encoding style used in this request. This method returns null if the request does not use character encoding.

Returns:
the utf-8, iso-8859-1...

getCookies

javax.servlet.http.Cookie[] getCookies()
Returns an array containing all of the Cookie objects the browser sent with this request. This method returns null if the browser did not send any cookies.

Returns:
an array of cookies

getInputStream

java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns the input stream for read the request's data sent by the client

Returns:
the request InputStream.
Throws:
java.io.IOException

getScheme

java.lang.String getScheme()
Returns the sheme used by the client to send the request.

Returns:
http, http or ftp

getServerName

java.lang.String getServerName()
Returns the host name of the server that received the request.

Returns:
the server host name.

getServerPort

int getServerPort()
Returns the port number on which this request was received.

Returns:
the server port

getRemoteHost

java.lang.String getRemoteHost()
Returns the fully qualified name of the client that sent the request.

Returns:
the client host name

getRemoteAddress

java.lang.String getRemoteAddress()
Returns the Internet Protocol (IP) address of the client that sent the request.

Returns:
the ip of the client

getRemoteUser

java.lang.String getRemoteUser()
Returns the name of the user making this request, if the user has logged in using HTTP authentication. This method returns null if the user login is not authenticated. Whether the user name is sent with each subsequent request depends on the browser.

Returns:
the name of the authenticated user


Copyright © 2010. All Rights Reserved.