FileDocCategorySizeDatePackage
RequestFacade.javaAPI DocGlassfish v2 API13038Fri May 04 22:31:54 BST 2007org.apache.catalina.connector

RequestFacade

public class RequestFacade extends Object implements ServletRequest
Facade class that wraps a Catalina-internal Request object. All methods are delegated to the wrapped request.
author
Craig R. McClanahan
author
Remy Maucherat
author
Jean-Francois Arcand
version
$Revision: 1.4 $ $Date: 2007/05/05 05:31:53 $

Fields Summary
private static final org.apache.catalina.util.StringManager
sm
The string manager for this package.
protected ServletRequest
request
The wrapped request.
Constructors Summary
public RequestFacade(org.apache.catalina.Request request)
Construct a wrapper for the specified request.

param
request The request to be wrapped



    // ----------------------------------------------------------- Constructors


                       
       

        super();
        this.request = (ServletRequest) request;

    
Methods Summary
public voidclear()
Clear facade.

    

    // --------------------------------------------------------- Public Methods


           
       
        request = null;
    
public java.lang.ObjectgetAttribute(java.lang.String name)

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getAttribute(name);
    
public java.util.EnumerationgetAttributeNames()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getAttributeNames();
    
public java.lang.StringgetCharacterEncoding()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getCharacterEncoding();
    
public intgetContentLength()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getContentLength();
    
public java.lang.StringgetContentType()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getContentType();
    
public javax.servlet.ServletInputStreamgetInputStream()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getInputStream();
    
public java.lang.StringgetLocalAddr()
Returns the Internet Protocol (IP) address of the interface on which the request was received.

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getLocalAddr();
    
public java.lang.StringgetLocalName()
Returns the host name of the Internet Protocol (IP) interface on which the request was received.

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getLocalName();
    
public intgetLocalPort()
Returns the Internet Protocol (IP) port number of the interface on which the request was received.

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getLocalPort();
    
public java.util.LocalegetLocale()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getLocale();
    
public java.util.EnumerationgetLocales()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getLocales();
    
public java.lang.StringgetParameter(java.lang.String name)

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getParameter(name);
    
public java.util.MapgetParameterMap()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getParameterMap();
    
public java.util.EnumerationgetParameterNames()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getParameterNames();
    
public java.lang.String[]getParameterValues(java.lang.String name)

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getParameterValues(name);
    
public java.lang.StringgetProtocol()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getProtocol();
    
public java.io.BufferedReadergetReader()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getReader();
    
public java.lang.StringgetRealPath(java.lang.String path)

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getRealPath(path);
    
public java.lang.StringgetRemoteAddr()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getRemoteAddr();
    
public java.lang.StringgetRemoteHost()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getRemoteHost();
    
public intgetRemotePort()
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getRemotePort();
    
public javax.servlet.RequestDispatchergetRequestDispatcher(java.lang.String path)

        // TODO : Facade !!
        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getRequestDispatcher(path);
    
public java.lang.StringgetScheme()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getScheme();
    
public java.lang.StringgetServerName()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getServerName();
    
public intgetServerPort()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.getServerPort();
    
public booleanisSecure()

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return request.isSecure();
    
public voidremoveAttribute(java.lang.String name)

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        request.removeAttribute(name);
    
public voidsetAttribute(java.lang.String name, java.lang.Object o)

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        request.setAttribute(name, o);
    
public voidsetCharacterEncoding(java.lang.String env)

        // Disallow operation if the object has gone out of scope
        if (request == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        request.setCharacterEncoding(env);