org.springframework.security.web.savedrequest
Class DefaultSavedRequest

java.lang.Object
  extended by org.springframework.security.web.savedrequest.DefaultSavedRequest
All Implemented Interfaces:
Serializable, SavedRequest

public class DefaultSavedRequest
extends Object
implements SavedRequest

Represents central information from a HttpServletRequest.

This class is used by AbstractAuthenticationProcessingFilter and SavedRequestAwareWrapper to reproduce the request after successful authentication. An instance of this class is stored at the time of an authentication exception by ExceptionTranslationFilter.

IMPLEMENTATION NOTE: It is assumed that this object is accessed only from the context of a single thread, so no synchronization around internal collection classes is performed.

This class is based on code in Apache Tomcat.

Version:
$Id: DefaultSavedRequest.java 3917 2009-10-02 17:29:43Z ltaylor $
Author:
Craig McClanahan, Andrey Grebnev, Ben Alex
See Also:
Serialized Form

Field Summary
protected static org.apache.commons.logging.Log logger
           
static String SPRING_SECURITY_SAVED_REQUEST_KEY
           
 
Constructor Summary
DefaultSavedRequest(HttpServletRequest request, PortResolver portResolver)
           
 
Method Summary
 boolean doesRequestMatch(HttpServletRequest request, PortResolver portResolver)
          Determines if the current request matches the DefaultSavedRequest.
 String getContextPath()
           
 List<Cookie> getCookies()
           
 Collection<String> getHeaderNames()
           
 List<String> getHeaderValues(String name)
           
 List<Locale> getLocales()
           
 String getMethod()
           
 Map<String,String[]> getParameterMap()
           
 Collection<String> getParameterNames()
           
 String[] getParameterValues(String name)
           
 String getPathInfo()
           
 String getQueryString()
           
 String getRedirectUrl()
          Indicates the URL that the user agent used for this request.
 String getRequestURI()
           
 String getRequestURL()
           
 String getScheme()
           
 String getServerName()
           
 int getServerPort()
           
 String getServletPath()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.commons.logging.Log logger

SPRING_SECURITY_SAVED_REQUEST_KEY

public static final String SPRING_SECURITY_SAVED_REQUEST_KEY
See Also:
Constant Field Values
Constructor Detail

DefaultSavedRequest

public DefaultSavedRequest(HttpServletRequest request,
                           PortResolver portResolver)
Method Detail

doesRequestMatch

public boolean doesRequestMatch(HttpServletRequest request,
                                PortResolver portResolver)
Determines if the current request matches the DefaultSavedRequest.

All URL arguments are considered but not cookies, locales, headers or parameters.


getContextPath

public String getContextPath()

getCookies

public List<Cookie> getCookies()
Specified by:
getCookies in interface SavedRequest

getRedirectUrl

public String getRedirectUrl()
Indicates the URL that the user agent used for this request.

Specified by:
getRedirectUrl in interface SavedRequest
Returns:
the full URL of this request

getHeaderNames

public Collection<String> getHeaderNames()
Specified by:
getHeaderNames in interface SavedRequest

getHeaderValues

public List<String> getHeaderValues(String name)
Specified by:
getHeaderValues in interface SavedRequest

getLocales

public List<Locale> getLocales()
Specified by:
getLocales in interface SavedRequest

getMethod

public String getMethod()
Specified by:
getMethod in interface SavedRequest

getParameterMap

public Map<String,String[]> getParameterMap()
Specified by:
getParameterMap in interface SavedRequest

getParameterNames

public Collection<String> getParameterNames()

getParameterValues

public String[] getParameterValues(String name)
Specified by:
getParameterValues in interface SavedRequest

getPathInfo

public String getPathInfo()

getQueryString

public String getQueryString()

getRequestURI

public String getRequestURI()

getRequestURL

public String getRequestURL()

getScheme

public String getScheme()

getServerName

public String getServerName()

getServerPort

public int getServerPort()

getServletPath

public String getServletPath()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2009 SpringSource, Inc. All Rights Reserved.