Class SavedRequest
- java.lang.Object
-
- org.apache.catalina.authenticator.SavedRequest
-
- All Implemented Interfaces:
java.io.Serializable
public final class SavedRequest extends java.lang.Object implements java.io.SerializableObject that saves the critical information from a request so that form-based authentication can reproduce it once the user has been authenticated.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.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SavedRequest()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCookie(Cookie cookie)Adds a cookie to this saved request.voidaddHeader(java.lang.String name, java.lang.String value)Adds a header value to this saved request.voidaddLocale(java.util.Locale locale)Adds a locale to this saved request.ByteChunkgetBody()Returns the body of the saved request.java.lang.StringgetContentType()Returns the content type of the saved request.java.util.Iterator<Cookie>getCookies()Returns an iterator over the cookies saved for this request.java.lang.StringgetDecodedRequestURI()Returns the decoded request URI of the saved request, with path parameters excluded.java.util.Iterator<java.lang.String>getHeaderNames()Returns an iterator over the names of all headers saved for this request.java.util.Iterator<java.lang.String>getHeaderValues(java.lang.String name)Returns an iterator over the values for the specified header.java.util.Iterator<java.util.Locale>getLocales()Returns an iterator over the locales saved for this request.java.lang.StringgetMethod()Returns the HTTP method of the saved request.intgetOriginalMaxInactiveInterval()Deprecated.This method will be removed in Tomcat 12.0.x onwards.java.lang.IntegergetOriginalMaxInactiveIntervalOptional()Returns the original max inactive interval for the session.java.lang.StringgetQueryString()Returns the query string of the saved request.java.lang.StringgetRequestURI()Returns the request URI of the saved request.voidsetBody(ByteChunk body)Sets the body of the saved request.voidsetContentType(java.lang.String contentType)Sets the content type of the saved request.voidsetDecodedRequestURI(java.lang.String decodedRequestURI)Sets the decoded request URI of the saved request.voidsetMethod(java.lang.String method)Sets the HTTP method of the saved request.voidsetOriginalMaxInactiveInterval(int originalMaxInactiveInterval)Sets the original max inactive interval for the session.voidsetQueryString(java.lang.String queryString)Sets the query string of the saved request.voidsetRequestURI(java.lang.String requestURI)Sets the request URI of the saved request.
-
-
-
Method Detail
-
addCookie
public void addCookie(Cookie cookie)
Adds a cookie to this saved request.- Parameters:
cookie- the cookie to add
-
getCookies
public java.util.Iterator<Cookie> getCookies()
Returns an iterator over the cookies saved for this request.- Returns:
- iterator over the saved cookies
-
addHeader
public void addHeader(java.lang.String name, java.lang.String value)Adds a header value to this saved request.- Parameters:
name- the header namevalue- the header value
-
getHeaderNames
public java.util.Iterator<java.lang.String> getHeaderNames()
Returns an iterator over the names of all headers saved for this request.- Returns:
- iterator over the header names
-
getHeaderValues
public java.util.Iterator<java.lang.String> getHeaderValues(java.lang.String name)
Returns an iterator over the values for the specified header.- Parameters:
name- the header name- Returns:
- iterator over the header values, or an empty iterator if the header is not present
-
addLocale
public void addLocale(java.util.Locale locale)
Adds a locale to this saved request.- Parameters:
locale- the locale to add
-
getLocales
public java.util.Iterator<java.util.Locale> getLocales()
Returns an iterator over the locales saved for this request.- Returns:
- iterator over the saved locales
-
getMethod
public java.lang.String getMethod()
Returns the HTTP method of the saved request.- Returns:
- the request method, or
nullif not set
-
setMethod
public void setMethod(java.lang.String method)
Sets the HTTP method of the saved request.- Parameters:
method- the request method
-
getQueryString
public java.lang.String getQueryString()
Returns the query string of the saved request.- Returns:
- the query string, or
nullif not set
-
setQueryString
public void setQueryString(java.lang.String queryString)
Sets the query string of the saved request.- Parameters:
queryString- the query string
-
getRequestURI
public java.lang.String getRequestURI()
Returns the request URI of the saved request.- Returns:
- the request URI, or
nullif not set
-
setRequestURI
public void setRequestURI(java.lang.String requestURI)
Sets the request URI of the saved request.- Parameters:
requestURI- the request URI
-
getDecodedRequestURI
public java.lang.String getDecodedRequestURI()
Returns the decoded request URI of the saved request, with path parameters excluded.- Returns:
- the decoded request URI, or
nullif not set
-
setDecodedRequestURI
public void setDecodedRequestURI(java.lang.String decodedRequestURI)
Sets the decoded request URI of the saved request.- Parameters:
decodedRequestURI- the decoded request URI
-
getBody
public ByteChunk getBody()
Returns the body of the saved request.- Returns:
- the request body as a
ByteChunk, ornullif not set
-
setBody
public void setBody(ByteChunk body)
Sets the body of the saved request.- Parameters:
body- the request body as aByteChunk
-
getContentType
public java.lang.String getContentType()
Returns the content type of the saved request.- Returns:
- the content type, or
nullif not set
-
setContentType
public void setContentType(java.lang.String contentType)
Sets the content type of the saved request.- Parameters:
contentType- the content type
-
getOriginalMaxInactiveIntervalOptional
public java.lang.Integer getOriginalMaxInactiveIntervalOptional()
Returns the original max inactive interval for the session.- Returns:
- the original max inactive interval, or
nullif not set
-
getOriginalMaxInactiveInterval
@Deprecated public int getOriginalMaxInactiveInterval()
Deprecated.This method will be removed in Tomcat 12.0.x onwards. UsegetOriginalMaxInactiveIntervalOptional()Obtain the original session maxInactiveInterval.- Returns:
- the original session maxInactiveInterval
-
setOriginalMaxInactiveInterval
public void setOriginalMaxInactiveInterval(int originalMaxInactiveInterval)
Sets the original max inactive interval for the session.- Parameters:
originalMaxInactiveInterval- the max inactive interval in seconds
-
-