Class AbstractRequest

java.lang.Object
com.aspectran.core.activity.request.AbstractRequest
Direct Known Subclasses:
AbstractRequestAdapter

public abstract class AbstractRequest extends Object
The Class AbstractRequest.
Since:
2011. 3. 12.
  • Constructor Details

    • AbstractRequest

      public AbstractRequest(MethodType requestMethod)
  • Method Details

    • getRequestMethod

      public MethodType getRequestMethod()
    • getHeader

      public String getHeader(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
    • getHeaderValues

      public List<String> getHeaderValues(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 Set<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(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(String name, String value)
      Set the given single header value under the given header name.
      Parameters:
      name - the header name
      value - the header value to set
    • addHeader

      public void addHeader(String name, String value)
      Add the given single header value to the current list of values for the given header.
      Parameters:
      name - the header name
      value - the header value to be added
    • getHeaderMap

      public MultiValueMap<String,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 be null
    • setHeaderMap

      public void setHeaderMap(MultiValueMap<String,String> headers)
    • hasHeaders

      public boolean hasHeaders()
    • getAttribute

      public <T> T getAttribute(String name)
    • setAttribute

      public void setAttribute(String name, Object value)
    • getAttributeNames

      public Set<String> getAttributeNames()
    • removeAttribute

      public void removeAttribute(String name)
    • putAllAttributes

      public void putAllAttributes(Map<String,Object> attributes)
    • extractAttributes

      public void extractAttributes(Map<String,Object> targetMap)
    • getAttributeMap

      public Map<String,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 be null
    • setAttributeMap

      public void setAttributeMap(Map<String,Object> attributeMap)
    • hasAttributes

      public boolean hasAttributes()
    • getParameter

      public String getParameter(String name)
    • getParameterValues

      public String[] getParameterValues(String name)
    • getParameterNames

      public Set<String> getParameterNames()
    • setParameter

      public void setParameter(String name, String value)
    • setParameter

      public void setParameter(String name, String[] values)
    • getAllParameters

      public Map<String,Object> getAllParameters()
      Returns all parameters as a mutable Map<String, Object>.
      Returns:
      an Map<String, Object> object, must not be null
    • putAllParameters

      public void putAllParameters(ParameterMap parameterMap)
    • putAllParameters

      public void putAllParameters(MultiValueMap<String,String> multiValueMap)
    • extractParameters

      public void extractParameters(Map<String,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:
      a ParameterMap object, may not be null
    • setParameterMap

      public void setParameterMap(ParameterMap parameterMap)
    • hasParameters

      public boolean hasParameters()
    • getFileParameter

      public FileParameter getFileParameter(String name)
    • getFileParameterValues

      public FileParameter[] getFileParameterValues(String name)
    • getFileParameterNames

      public Set<String> getFileParameterNames()
    • setFileParameter

      public void setFileParameter(String name, FileParameter fileParameter)
    • setFileParameter

      public void setFileParameter(String name, FileParameter[] fileParameters)
    • removeFileParameter

      public void removeFileParameter(String name)
    • getFileParameterMap

      public FileParameterMap getFileParameterMap()
    • putAllFileParameters

      public void putAllFileParameters(MultiValueMap<String,FileParameter> fileParameterMap)
    • hasFileParameters

      public boolean hasFileParameters()
    • getEncoding

      public String getEncoding()
    • setEncoding

      public void setEncoding(String encoding) throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • getLocale

      public Locale getLocale()
    • setLocale

      public void setLocale(Locale locale)
      Sets the locale.
      Parameters:
      locale - the locale
    • getTimeZone

      public TimeZone getTimeZone()
      Gets the time zone.
      Returns:
      the time zone
    • setTimeZone

      public void setTimeZone(TimeZone timeZone)
      Sets the time zone.
      Parameters:
      timeZone - the time zone
    • getMaxRequestSize

      public long getMaxRequestSize()
    • setMaxRequestSize

      public void setMaxRequestSize(long maxRequestSize)
    • getInputStream

      public InputStream getInputStream() throws IOException
      Throws:
      IOException
    • getBody

      public String getBody()
    • setBody

      public void setBody(String body)
    • getBodyAsParameters

      public Parameters getBodyAsParameters() throws RequestParseException
      Throws:
      RequestParseException
    • getBodyAsParameters

      public <T extends Parameters> T getBodyAsParameters(Class<T> requiredType) throws RequestParseException
      Throws:
      RequestParseException
    • getParameters

      public Parameters getParameters()
    • getParameters

      public <T extends Parameters> T getParameters(Class<T> requiredType)