Fields Summary |
---|
private int | serverPort |
private org.apache.tomcat.util.buf.MessageBytes | serverNameMB |
private int | remotePort |
private int | localPort |
private org.apache.tomcat.util.buf.MessageBytes | schemeMB |
private org.apache.tomcat.util.buf.MessageBytes | methodMB |
private org.apache.tomcat.util.buf.MessageBytes | unparsedURIMB |
private org.apache.tomcat.util.buf.MessageBytes | uriMB |
private org.apache.tomcat.util.buf.MessageBytes | decodedUriMB |
private org.apache.tomcat.util.buf.MessageBytes | queryMB |
private org.apache.tomcat.util.buf.MessageBytes | protoMB |
private org.apache.tomcat.util.buf.MessageBytes | remoteAddrMB |
private org.apache.tomcat.util.buf.MessageBytes | localNameMB |
private org.apache.tomcat.util.buf.MessageBytes | remoteHostMB |
private org.apache.tomcat.util.buf.MessageBytes | localAddrMB |
private org.apache.tomcat.util.http.MimeHeaders | headers |
private org.apache.tomcat.util.buf.MessageBytes | instanceId |
private Object[] | notesNotes. |
private InputBuffer | inputBufferAssociated input buffer. |
private org.apache.tomcat.util.buf.UDecoder | urlDecoderURL decoder. |
private long | contentLengthHTTP specific fields. (remove them ?) |
private org.apache.tomcat.util.buf.MessageBytes | contentTypeMB |
private String | charEncoding |
private org.apache.tomcat.util.http.Cookies | cookies |
private org.apache.tomcat.util.http.Parameters | parameters |
private org.apache.tomcat.util.buf.MessageBytes | remoteUser |
private org.apache.tomcat.util.buf.MessageBytes | authType |
private HashMap | attributes |
private Response | response |
private ActionHook | hook |
private int | bytesRead |
private long | startTime |
private int | available |
private RequestInfo | reqProcessorMX |
Methods Summary |
---|
public void | action(ActionCode actionCode, java.lang.Object param)
if( hook==null && response!=null )
hook=response.getHook();
if (hook != null) {
if( param==null )
hook.action(actionCode, this);
else
hook.action(actionCode, param);
}
|
public org.apache.tomcat.util.buf.MessageBytes | contentType()
if (contentTypeMB == null)
contentTypeMB = headers.getValue("content-type");
return contentTypeMB;
|
public org.apache.tomcat.util.buf.MessageBytes | decodedURI()
return decodedUriMB;
|
public int | doRead(org.apache.tomcat.util.buf.ByteChunk chunk)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.
int n = inputBuffer.doRead(chunk, this);
if (n > 0) {
bytesRead+=n;
}
return n;
|
public java.lang.Object | getAttribute(java.lang.String name)
return attributes.get(name);
|
public java.util.HashMap | getAttributes()
return attributes;
|
public org.apache.tomcat.util.buf.MessageBytes | getAuthType()
return authType;
|
public int | getAvailable()
return available;
|
public int | getBytesRead()
return bytesRead;
|
public java.lang.String | getCharacterEncoding()Get the character encoding used for this request.
if (charEncoding != null)
return charEncoding;
charEncoding = ContentType.getCharsetFromContentType(getContentType());
return charEncoding;
|
public int | getContentLength()
long length = getContentLengthLong();
if (length < Integer.MAX_VALUE) {
return (int) length;
}
return -1;
|
public long | getContentLengthLong()
if( contentLength > -1 ) return contentLength;
MessageBytes clB = headers.getUniqueValue("content-length");
contentLength = (clB == null || clB.isNull()) ? -1 : clB.getLong();
return contentLength;
|
public java.lang.String | getContentType()
contentType();
if ((contentTypeMB == null) || contentTypeMB.isNull())
return null;
return contentTypeMB.toString();
|
public org.apache.tomcat.util.http.Cookies | getCookies()
return cookies;
|
public java.lang.String | getHeader(java.lang.String name)
return headers.getHeader(name);
|
public InputBuffer | getInputBuffer()
return inputBuffer;
|
public int | getLocalPort()
return localPort;
|
public org.apache.tomcat.util.http.MimeHeaders | getMimeHeaders()
return headers;
|
public final java.lang.Object | getNote(int pos)
return notes[pos];
|
public org.apache.tomcat.util.http.Parameters | getParameters()
return parameters;
|
public int | getRemotePort()
return remotePort;
|
public org.apache.tomcat.util.buf.MessageBytes | getRemoteUser()
return remoteUser;
|
public RequestInfo | getRequestProcessor()
return reqProcessorMX;
|
public Response | getResponse()
return response;
|
public int | getServerPort()
return serverPort;
|
public long | getStartTime()
return startTime;
|
public org.apache.tomcat.util.buf.UDecoder | getURLDecoder()
return urlDecoder;
|
public org.apache.tomcat.util.buf.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.
// ------------------------------------------------------------- Properties
return instanceId;
|
public org.apache.tomcat.util.buf.MessageBytes | localAddr()
return localAddrMB;
|
public org.apache.tomcat.util.buf.MessageBytes | localName()
return localNameMB;
|
public org.apache.tomcat.util.buf.MessageBytes | method()
return methodMB;
|
public org.apache.tomcat.util.buf.MessageBytes | protocol()
return protoMB;
|
public org.apache.tomcat.util.buf.MessageBytes | query()
return queryMB;
|
public org.apache.tomcat.util.buf.MessageBytes | queryString()
return queryMB;
|
public void | recycle()
bytesRead=0;
contentLength = -1;
contentTypeMB = null;
charEncoding = null;
headers.recycle();
serverNameMB.recycle();
serverPort=-1;
localPort = -1;
remotePort = -1;
available = 0;
cookies.recycle();
parameters.recycle();
unparsedURIMB.recycle();
uriMB.recycle();
decodedUriMB.recycle();
queryMB.recycle();
methodMB.recycle();
protoMB.recycle();
schemeMB.recycle();
instanceId.recycle();
remoteUser.recycle();
authType.recycle();
attributes.clear();
|
public org.apache.tomcat.util.buf.MessageBytes | remoteAddr()
return remoteAddrMB;
|
public org.apache.tomcat.util.buf.MessageBytes | remoteHost()
return remoteHostMB;
|
public org.apache.tomcat.util.buf.MessageBytes | requestURI()
return uriMB;
|
public org.apache.tomcat.util.buf.MessageBytes | scheme()
return schemeMB;
|
public org.apache.tomcat.util.buf.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.
return serverNameMB;
|
public void | setAttribute(java.lang.String name, java.lang.Object o)
attributes.put( name, o );
|
public void | setAvailable(int available)
this.available = available;
|
public void | setBytesRead(int bytesRead)
this.bytesRead = bytesRead;
|
public void | setCharacterEncoding(java.lang.String enc)
this.charEncoding = enc;
|
public void | setContentLength(int len)
this.contentLength = len;
|
public void | setContentType(java.lang.String type)
contentTypeMB.setString(type);
|
public void | setContentType(org.apache.tomcat.util.buf.MessageBytes mb)
contentTypeMB=mb;
|
public void | setInputBuffer(InputBuffer inputBuffer)
this.inputBuffer = inputBuffer;
|
public void | setLocalPort(int port)
this.localPort = port;
|
public final void | setNote(int pos, java.lang.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.
notes[pos] = value;
|
public void | setRemotePort(int port)
this.remotePort = port;
|
public void | setResponse(Response response)
this.response=response;
response.setRequest( this );
|
public void | setServerPort(int serverPort)
this.serverPort=serverPort;
|
public void | setStartTime(long startTime)
this.startTime = startTime;
|
public java.lang.String | toString()
return "R( " + requestURI().toString() + ")";
|
public org.apache.tomcat.util.buf.MessageBytes | unparsedURI()
return unparsedURIMB;
|
public void | updateCounters()
reqProcessorMX.updateCounters();
|