Class AbstractRequest
- java.lang.Object
-
- com.aspectran.core.activity.request.AbstractRequest
-
- Direct Known Subclasses:
AbstractRequestAdapter
public abstract class AbstractRequest extends java.lang.Object
The Class AbstractRequest.- Since:
- 2011. 3. 12.
-
-
Constructor Summary
Constructors Constructor Description AbstractRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHeader(java.lang.String name, java.lang.String value)
Add the given single header value to the current list of values for the given header.boolean
containsHeader(java.lang.String name)
Returns a boolean indicating whether the named response header has already been set.void
extractAttributes(java.util.Map<java.lang.String,java.lang.Object> targetMap)
void
extractParameters(java.util.Map<java.lang.String,java.lang.Object> targetMap)
java.util.Map<java.lang.String,java.lang.Object>
getAllParameters()
Returns a map of the request parameters that can be modified.<T> T
getAttribute(java.lang.String name)
java.util.Map<java.lang.String,java.lang.Object>
getAttributeMap()
Returns a map of the request attributes that can be modified.java.util.Collection<java.lang.String>
getAttributeNames()
java.lang.String
getEncoding()
FileParameter
getFileParameter(java.lang.String name)
FileParameterMap
getFileParameterMap()
java.util.Collection<java.lang.String>
getFileParameterNames()
FileParameter[]
getFileParameterValues(java.lang.String name)
java.lang.String
getHeader(java.lang.String name)
Returns the value of the response header with the given name.MultiValueMap<java.lang.String,java.lang.String>
getHeaderMap()
Returns a map of the request headers that can be modified.java.util.Collection<java.lang.String>
getHeaderNames()
Returns the names of the headers of this response.java.util.Collection<java.lang.String>
getHeaders(java.lang.String name)
Returns the values of the response header with the given name.java.util.Locale
getLocale()
java.lang.String
getParameter(java.lang.String name)
ParameterMap
getParameterMap()
Returns a map of the request parameters that can be modified.java.util.Collection<java.lang.String>
getParameterNames()
java.lang.String[]
getParameterValues(java.lang.String name)
MethodType
getRequestMethod()
java.util.TimeZone
getTimeZone()
Gets the time zone.boolean
hasAttributes()
boolean
hasFileParameters()
boolean
hasHeaders()
boolean
hasParameters()
boolean
isMaxLengthExceeded()
Returns whether request header has exceed the maximum length.void
putAllAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
void
putAllParameters(ParameterMap parameterMap)
void
removeAttribute(java.lang.String name)
void
removeFileParameter(java.lang.String name)
void
setAttribute(java.lang.String name, java.lang.Object value)
void
setAttributeMap(java.util.Map<java.lang.String,java.lang.Object> attributeMap)
void
setEncoding(java.lang.String encoding)
void
setFileParameter(java.lang.String name, FileParameter fileParameter)
void
setFileParameter(java.lang.String name, FileParameter[] fileParameters)
void
setHeader(java.lang.String name, java.lang.String value)
Set the given single header value under the given header name.void
setHeaderMap(MultiValueMap<java.lang.String,java.lang.String> headers)
void
setLocale(java.util.Locale locale)
Sets the locale.void
setMaxLengthExceeded(boolean maxLengthExceeded)
Sets whether the request header has exceeded the maximum length.void
setParameter(java.lang.String name, java.lang.String value)
void
setParameter(java.lang.String name, java.lang.String[] values)
void
setParameterMap(ParameterMap parameterMap)
protected void
setRequestMethod(MethodType requestMethod)
void
setTimeZone(java.util.TimeZone timeZone)
Sets the time zone.
-
-
-
Method Detail
-
getRequestMethod
public MethodType getRequestMethod()
-
setRequestMethod
protected void setRequestMethod(MethodType requestMethod)
-
getHeader
public java.lang.String getHeader(java.lang.String name)
Returns the value of the response header with the given name.If a response header with the given name exists and contains multiple values, the value that was added first will be returned.
- Parameters:
name
- the name of the response header whose value to return- Returns:
- the value of the response header with the given name,
or
null
if no header with the given name has been set on this response
-
getHeaders
public java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
Returns the values of the response header with the given name.- Parameters:
name
- the name of the response header whose values to return- Returns:
- a (possibly empty)
Collection
of the values of the response header with the given name
-
getHeaderNames
public java.util.Collection<java.lang.String> getHeaderNames()
Returns the names of the headers of this response.- Returns:
- a (possibly empty)
Collection
of the names of the headers of this response
-
containsHeader
public boolean containsHeader(java.lang.String name)
Returns a boolean indicating whether the named response header has already been set.- Parameters:
name
- the header name- Returns:
true
if the named response header has already been set;false
otherwise
-
setHeader
public void setHeader(java.lang.String name, java.lang.String value)
Set the given single header value under the given header name.- Parameters:
name
- the header namevalue
- the header value to set
-
addHeader
public void addHeader(java.lang.String name, java.lang.String value)
Add the given single header value to the current list of values for the given header.- Parameters:
name
- the header namevalue
- the header value to be added
-
getHeaderMap
public MultiValueMap<java.lang.String,java.lang.String> getHeaderMap()
Returns a map of the request headers that can be modified. If not yet instantiated then create a new one.- Returns:
- an
MultiValueMap
object, may not benull
-
setHeaderMap
public void setHeaderMap(MultiValueMap<java.lang.String,java.lang.String> headers)
-
hasHeaders
public boolean hasHeaders()
-
getParameter
public java.lang.String getParameter(java.lang.String name)
-
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)
-
getParameterNames
public java.util.Collection<java.lang.String> getParameterNames()
-
setParameter
public void setParameter(java.lang.String name, java.lang.String value)
-
setParameter
public void setParameter(java.lang.String name, java.lang.String[] values)
-
getAllParameters
public java.util.Map<java.lang.String,java.lang.Object> getAllParameters()
Returns a map of the request parameters that can be modified.- Returns:
- an
Map<String, Object>
object, must not benull
-
putAllParameters
public void putAllParameters(ParameterMap parameterMap)
-
extractParameters
public void extractParameters(java.util.Map<java.lang.String,java.lang.Object> targetMap)
-
getParameterMap
public ParameterMap getParameterMap()
Returns a map of the request parameters that can be modified. If not yet instantiated then create a new one.- Returns:
- an
ParameterMap
object, may not benull
-
setParameterMap
public void setParameterMap(ParameterMap parameterMap)
-
hasParameters
public boolean hasParameters()
-
getFileParameter
public FileParameter getFileParameter(java.lang.String name)
-
getFileParameterValues
public FileParameter[] getFileParameterValues(java.lang.String name)
-
getFileParameterNames
public java.util.Collection<java.lang.String> getFileParameterNames()
-
setFileParameter
public void setFileParameter(java.lang.String name, FileParameter fileParameter)
-
setFileParameter
public void setFileParameter(java.lang.String name, FileParameter[] fileParameters)
-
removeFileParameter
public void removeFileParameter(java.lang.String name)
-
getFileParameterMap
public FileParameterMap getFileParameterMap()
-
hasFileParameters
public boolean hasFileParameters()
-
getAttribute
public <T> T getAttribute(java.lang.String name)
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)
-
getAttributeNames
public java.util.Collection<java.lang.String> getAttributeNames()
-
removeAttribute
public void removeAttribute(java.lang.String name)
-
putAllAttributes
public void putAllAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
-
extractAttributes
public void extractAttributes(java.util.Map<java.lang.String,java.lang.Object> targetMap)
-
getAttributeMap
public java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()
Returns a map of the request attributes that can be modified. If not yet instantiated then create a new one.- Returns:
- an
Map<String, Object>
object, may not benull
-
setAttributeMap
public void setAttributeMap(java.util.Map<java.lang.String,java.lang.Object> attributeMap)
-
hasAttributes
public boolean hasAttributes()
-
getEncoding
public java.lang.String getEncoding()
-
setEncoding
public void setEncoding(java.lang.String encoding) throws java.io.UnsupportedEncodingException
- Throws:
java.io.UnsupportedEncodingException
-
getLocale
public java.util.Locale getLocale()
-
setLocale
public void setLocale(java.util.Locale locale)
Sets the locale.- Parameters:
locale
- the locale
-
getTimeZone
public java.util.TimeZone getTimeZone()
Gets the time zone.- Returns:
- the time zone
-
setTimeZone
public void setTimeZone(java.util.TimeZone timeZone)
Sets the time zone.- Parameters:
timeZone
- the time zone
-
setMaxLengthExceeded
public void setMaxLengthExceeded(boolean maxLengthExceeded)
Sets whether the request header has exceeded the maximum length.- Parameters:
maxLengthExceeded
- whether the request header has exceeded the maximum length
-
isMaxLengthExceeded
public boolean isMaxLengthExceeded()
Returns whether request header has exceed the maximum length.- Returns:
- true, if is max length exceeded
-
-