org.jasig.portal.channels.jsp
Class HttpRequestFacade

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by javax.servlet.http.HttpServletRequestWrapper
          extended by org.jasig.portal.channels.jsp.HttpRequestFacade
All Implemented Interfaces:
HttpServletRequest, ServletRequest

Deprecated. All IChannel implementations should be migrated to portlets

@Deprecated
public class HttpRequestFacade
extends HttpServletRequestWrapper

An HttpServletRequestWrapper that prevents changes to the underlying request but provides access to most of its objects. Adding an attribute to this wrapper will make that attribute available to all users of this wrapper but will not make it available to any users of the underlying request. If an attribute is placed on this wrapper having the same key as an attribute in the underlying request the underlying request's attribute will not be accessible. Cookies are available from this object but are clones of those in the wrapped object so that the wrapped ones are preserved untouched. Access to the reader or input stream of the underlying object is denied to prevent corruption of the wrapped request.

Since:
2.6
Author:
Mark Boyd

Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
HttpRequestFacade(HttpServletRequest request)
          Deprecated. Instantiate an HttpRequestFacade wrapped around the underlying request to provide access to request information but allow separation of channel specific aspects from other channels like request attributes.
 
Method Summary
 Object getAttribute(String key)
          Deprecated. Returns the value of the specified key.
 Enumeration getAttributeNames()
          Deprecated. Returns an Enumeration of attribute names on this object and those of the wrapped request object.
 String getCharacterEncoding()
          Deprecated. Return the encoding specified in the wrapped request object.
 Cookie[] getCookies()
          Deprecated. Return a modifiable array of cookies whose changes will be discarded and not pushed into the cookies of the wrapped request.
 ServletInputStream getInputStream()
          Deprecated. Throws an UnsupportedOperationException since this method won't be called for our usage of requests in the JSP channel type and exposing the input stream of the underlying request essentially corrupts that request object.
 BufferedReader getReader()
          Deprecated. Throws an UnsupportedOperationException since this method won't be called for our usage of requests in the JSP channel type and exposing the reader of the underlying request essentially corrupts that request object.
 void removeAttribute(String arg0)
          Deprecated. Remove an item from the private attribute set for this wrapper.
 void setAttribute(String arg0, Object arg1)
          Deprecated. Overridden to store attributes into the private attribute set of this object and not into the underlying request object.
 void setCharacterEncoding(String arg0)
          Deprecated. Throws an UnsupportedOperationException since this method won't be called for our usage of requests in the JSP channel type.
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getAuthType, getContextPath, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getContentLength, getContentType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, setRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.ServletRequest
getContentLength, getContentType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure
 

Constructor Detail

HttpRequestFacade

public HttpRequestFacade(HttpServletRequest request)
Deprecated. 
Instantiate an HttpRequestFacade wrapped around the underlying request to provide access to request information but allow separation of channel specific aspects from other channels like request attributes.

Parameters:
request -
Method Detail

getAttribute

public Object getAttribute(String key)
Deprecated. 
Returns the value of the specified key. If the same key has been used on this object and on the wrapped request the local value for that key hides the value in the wrapped object making it inaccessible.

Specified by:
getAttribute in interface ServletRequest
Overrides:
getAttribute in class ServletRequestWrapper

getAttributeNames

public Enumeration getAttributeNames()
Deprecated. 
Returns an Enumeration of attribute names on this object and those of the wrapped request object. If both this object and the wrapped request have the same key only one instance is returned enforing Set semantices.

Specified by:
getAttributeNames in interface ServletRequest
Overrides:
getAttributeNames in class ServletRequestWrapper

removeAttribute

public void removeAttribute(String arg0)
Deprecated. 
Remove an item from the private attribute set for this wrapper. Does not remove attributes from the underlying request.

Specified by:
removeAttribute in interface ServletRequest
Overrides:
removeAttribute in class ServletRequestWrapper
See Also:
ServletRequest.removeAttribute(java.lang.String)

setAttribute

public void setAttribute(String arg0,
                         Object arg1)
Deprecated. 
Overridden to store attributes into the private attribute set of this object and not into the underlying request object.

Specified by:
setAttribute in interface ServletRequest
Overrides:
setAttribute in class ServletRequestWrapper

getCookies

public Cookie[] getCookies()
Deprecated. 
Return a modifiable array of cookies whose changes will be discarded and not pushed into the cookies of the wrapped request.

Specified by:
getCookies in interface HttpServletRequest
Overrides:
getCookies in class HttpServletRequestWrapper
See Also:
HttpServletRequest.getCookies()

getInputStream

public ServletInputStream getInputStream()
                                  throws IOException
Deprecated. 
Throws an UnsupportedOperationException since this method won't be called for our usage of requests in the JSP channel type and exposing the input stream of the underlying request essentially corrupts that request object.

Specified by:
getInputStream in interface ServletRequest
Overrides:
getInputStream in class ServletRequestWrapper
Throws:
IOException

getReader

public BufferedReader getReader()
                         throws IOException
Deprecated. 
Throws an UnsupportedOperationException since this method won't be called for our usage of requests in the JSP channel type and exposing the reader of the underlying request essentially corrupts that request object.

Specified by:
getReader in interface ServletRequest
Overrides:
getReader in class ServletRequestWrapper
Throws:
IOException

setCharacterEncoding

public void setCharacterEncoding(String arg0)
                          throws UnsupportedEncodingException
Deprecated. 
Throws an UnsupportedOperationException since this method won't be called for our usage of requests in the JSP channel type.

Specified by:
setCharacterEncoding in interface ServletRequest
Overrides:
setCharacterEncoding in class ServletRequestWrapper
Throws:
UnsupportedEncodingException

getCharacterEncoding

public String getCharacterEncoding()
Deprecated. 
Return the encoding specified in the wrapped request object.

Specified by:
getCharacterEncoding in interface ServletRequest
Overrides:
getCharacterEncoding in class ServletRequestWrapper


Copyright © 2010 Jasig. All Rights Reserved.