Home » apache-tomcat-6.0.26-src » org.apache » coyote » [javadoc | source]
public final class: Request [javadoc | source]
This is a low-level, efficient representation of a server request. Most fields are GC-free, expensive operations are delayed until the user code needs the information. Processing is delegated to modules, using a hook mechanism. This class is not intended for user code - it is used internally by tomcat for processing the request in the most efficient way. Users ( servlets ) can access the information using a facade, which provides the high-level view of the request. For lazy evaluation, the request uses the getInfo() hook. The following ids are defined: Tomcat defines a number of attributes:
 public Request() 
Method from org.apache.coyote.Request Summary:
action,   contentType,   decodedURI,   doRead,   getAttribute,   getAttributes,   getAuthType,   getAvailable,   getBytesRead,   getCharacterEncoding,   getContentLength,   getContentLengthLong,   getContentType,   getCookies,   getHeader,   getInputBuffer,   getLocalPort,   getMimeHeaders,   getNote,   getParameters,   getRemotePort,   getRemoteUser,   getRequestProcessor,   getResponse,   getServerPort,   getStartTime,   getURLDecoder,   instanceId,   localAddr,   localName,   method,   protocol,   query,   queryString,   recycle,   remoteAddr,   remoteHost,   requestURI,   scheme,   serverName,   setAttribute,   setAvailable,   setBytesRead,   setCharacterEncoding,   setContentLength,   setContentType,   setContentType,   setInputBuffer,   setLocalPort,   setNote,   setRemotePort,   setResponse,   setServerPort,   setStartTime,   toString,   unparsedURI,   updateCounters
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.coyote.Request Detail:
 public  void action(ActionCode actionCode,
    Object param) 
 public MessageBytes contentType() 
 public MessageBytes decodedURI() 
 public int doRead(ByteChunk chunk) throws IOException 
    Read data from the input buffer and put it into a byte chunk. The buffer is owned by the protocol implementation - it will be reused on the next read. The Adapter must either process the data in place or copy it to a separate buffer if it needs to hold it. In most cases this is done during byte->char conversions or via InputStream. Unlike InputStream, this interface allows the app to process data in place, without copy.
 public Object getAttribute(String name) 
 public HashMap getAttributes() 
 public MessageBytes getAuthType() 
 public int getAvailable() 
 public int getBytesRead() 
 public String getCharacterEncoding() 
    Get the character encoding used for this request.
 public int getContentLength() 
 public long getContentLengthLong() 
 public String getContentType() 
 public Cookies getCookies() 
 public String getHeader(String name) 
 public InputBuffer getInputBuffer() 
 public int getLocalPort() 
 public MimeHeaders getMimeHeaders() 
 public final Object getNote(int pos) 
 public Parameters getParameters() 
 public int getRemotePort() 
 public MessageBytes getRemoteUser() 
 public RequestInfo getRequestProcessor() 
 public Response getResponse() 
 public int getServerPort() 
 public long getStartTime() 
 public UDecoder getURLDecoder() 
 public MessageBytes instanceId() 
    Get the instance id (or JVM route). Curently Ajp is sending it with each request. In future this should be fixed, and sent only once ( or 'negociated' at config time so both tomcat and apache share the same name.
 public MessageBytes localAddr() 
 public MessageBytes localName() 
 public MessageBytes method() 
 public MessageBytes protocol() 
 public MessageBytes query() 
 public MessageBytes queryString() 
 public  void recycle() 
 public MessageBytes remoteAddr() 
 public MessageBytes remoteHost() 
 public MessageBytes requestURI() 
 public MessageBytes scheme() 
 public MessageBytes serverName() 
    Return the buffer holding the server name, if any. Use isNull() to check if there is no value set. This is the "virtual host", derived from the Host: header.
 public  void setAttribute(String name,
    Object o) 
 public  void setAvailable(int available) 
 public  void setBytesRead(int bytesRead) 
 public  void setCharacterEncoding(String enc) 
 public  void setContentLength(int len) 
 public  void setContentType(String type) 
 public  void setContentType(MessageBytes mb) 
 public  void setInputBuffer(InputBuffer inputBuffer) 
 public  void setLocalPort(int port) 
 public final  void setNote(int pos,
    Object value) 
    Used to store private data. Thread data could be used instead - but if you have the req, getting/setting a note is just a array access, may be faster than ThreadLocal for very frequent operations. Example use: Jk: HandlerRequest.HOSTBUFFER = 10 CharChunk, buffer for Host decoding WorkerEnv: SSL_CERT_NOTE=16 - MessageBytes containing the cert Catalina CoyoteAdapter: ADAPTER_NOTES = 1 - stores the HttpServletRequest object ( req/res) To avoid conflicts, note in the range 0 - 8 are reserved for the servlet container ( catalina connector, etc ), and values in 9 - 16 for connector use. 17-31 range is not allocated or used.
 public  void setRemotePort(int port) 
 public  void setResponse(Response response) 
 public  void setServerPort(int serverPort) 
 public  void setStartTime(long startTime) 
 public String toString() 
 public MessageBytes unparsedURI() 
 public  void updateCounters()