public abstract class Http11AbstractProcessor extends Object implements ActionHook
Http11AbstractProcessor
Created on Dec 19, 2011 at 2:35:14 PMModifier and Type | Field and Description |
---|---|
protected Adapter |
adapter
Associated adapter.
|
protected static boolean |
CHUNK_ON_CLOSE |
protected String[] |
compressableMimeTypes
List of MIMES which could be gzipped
|
protected int |
compressionLevel
Allowed compression level.
|
protected int |
compressionMinSize
Minimum contentsize to make compression.
|
static ThreadLocal<Boolean> |
containerThread
Thread local marker.
|
protected boolean |
contentDelimitation
Content delimitator for the request (if false, the connection will be
closed at the end of the request).
|
protected boolean |
disableUploadTimeout
Flag to disable setting a different time-out on uploads.
|
protected boolean |
error
Error flag.
|
protected boolean |
event
Event used.
|
protected boolean |
expectation
Is there an expectation ?
|
protected char[] |
hostNameC
Host name (used to avoid useless B2C conversion on the host name).
|
protected boolean |
http09
HTTP/0.9 flag.
|
protected boolean |
http11
HTTP/1.1 flag.
|
protected boolean |
keepAlive
Keep-alive.
|
protected int |
keepAliveTimeout
The number of seconds Tomcat will wait for a subsequent request before
closing the connection.
|
protected String |
localAddr
The local Host address.
|
protected String |
localName
Local Host associated with the current connection.
|
protected int |
localPort
Local port to which the socket is connected
|
protected int |
maxKeepAliveRequests
Maximum number of Keep-Alive requests to honor.
|
protected int |
maxSavePostSize
Max saved post size.
|
protected Pattern[] |
noCompressionUserAgents
List of user agents to not use gzip with
|
protected boolean |
processing
Processing.
|
protected boolean |
readNotifications
True if a read has been requested.
|
protected String |
remoteAddr
Remote Address associated with the current connection.
|
protected String |
remoteHost
Remote Host associated with the current connection.
|
protected int |
remotePort
Remote port to which the socket is connected
|
protected Request |
request
Request object.
|
protected Response |
response
Response object.
|
protected Pattern[] |
restrictedUserAgents
List of restricted user agents.
|
protected boolean |
resumeNotification
True if a resume has been requested.
|
protected String |
server
Allow a customized the server header for the tin-foil hat folks.
|
protected boolean |
sslEnabled |
protected SSLSupport |
sslSupport
SSL information.
|
protected int |
timeout
Timeout.
|
protected boolean |
writeNotification
True if a write has been requested.
|
Constructor and Description |
---|
Http11AbstractProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
addCompressableMimeType(String mimeType)
Add a mime-type which will be compressable The mime-type String will be
exactly matched in the response mime-type header .
|
protected abstract void |
addFilter(String className)
Add input or output filter.
|
void |
addNoCompressionUserAgent(String userAgent)
Add user-agent for which gzip compression didn't works The user agent
String given will be exactly matched to the user-agent header submitted
by the client.
|
protected Pattern[] |
addREArray(Pattern[] rArray,
Pattern value)
General use method
|
void |
addRestrictedUserAgent(String userAgent)
Add restricted user-agent (which will downgrade the connector to HTTP/1.0
mode).
|
protected String[] |
addStringArray(String[] sArray,
String value)
General use method
|
abstract void |
endRequest() |
abstract NioEndpoint.Handler.SocketState |
event(SocketStatus status)
Process pipelined HTTP requests using the specified input and output
streams.
|
protected int |
findBytes(ByteChunk bc,
byte[] b)
Specialized utility method: find a sequence of lower case bytes inside a
ByteChunk.
|
String[] |
findCompressableMimeTypes() |
String[] |
findRestrictedUserAgents() |
Adapter |
getAdapter()
Getter for adapter
|
String[] |
getCompressableMimeTypes()
Getter for compressableMimeTypes
|
String |
getCompression() |
int |
getCompressionLevel()
Getter for compressionLevel
|
int |
getCompressionMinSize()
Getter for compressionMinSize
|
boolean |
getDisableUploadTimeout()
Getter for disableUploadTimeout
|
char[] |
getHostNameC()
Getter for hostNameC
|
int |
getKeepAliveTimeout()
Getter for keepAliveTimeout
|
String |
getLocalAddr()
Getter for localAddr
|
String |
getLocalName()
Getter for localName
|
int |
getLocalPort()
Getter for localPort
|
int |
getMaxKeepAliveRequests()
Getter for maxKeepAliveRequests
|
int |
getMaxSavePostSize()
Getter for maxSavePostSize
|
Pattern[] |
getNoCompressionUserAgents()
Getter for noCompressionUserAgents
|
boolean |
getReadNotifications()
Getter for readNotifications
|
String |
getRemoteAddr()
Getter for remoteAddr
|
String |
getRemoteHost()
Getter for remoteHost
|
int |
getRemotePort()
Getter for remotePort
|
Request |
getRequest()
Getter for request
|
Response |
getResponse()
Getter for response
|
Pattern[] |
getRestrictedUserAgents()
Getter for restrictedUserAgents
|
boolean |
getResumeNotification()
Getter for resumeNotification
|
String |
getServer()
Getter for server
|
boolean |
getSSLEnabled()
Getter for sslEnabled
|
SSLSupport |
getSSLSupport()
Getter for sslSupport
|
int |
getTimeout()
Getter for timeout
|
boolean |
getWriteNotification()
Getter for writeNotification
|
protected abstract void |
initializeFilters() |
protected boolean |
isCompressable()
Check for compression
|
boolean |
isContentDelimitation()
Getter for contentDelimitation
|
boolean |
isError()
Getter for error
|
boolean |
isEvent()
Getter for event
|
boolean |
isExpectation()
Getter for expectation
|
boolean |
isHttp09()
Getter for http09
|
boolean |
isHttp11()
Getter for http11
|
boolean |
isKeepAlive()
Getter for keepAlive
|
protected abstract void |
prepareRequest()
After reading the request headers, we have to setup the request filters.
|
protected abstract void |
prepareResponse()
When committing the response, we have to validate the set of headers, as
well as setup the response filters.
|
void |
recycle() |
protected void |
reset()
Reset flags of the Processor
|
void |
setAdapter(Adapter adapter)
Setter for the adapter
|
void |
setCompressableMimeTypes(String compressableMimeTypes)
Set compressable mime-type list List contains users agents separated by
',' :
ie: "text/html,text/xml,text/plain"
|
void |
setCompressableMimeTypes(String[] compressableMimeTypes)
Set compressable mime-type list (this method is best when used with a
large number of connectors, where it would be better to have all of them
referenced a single array).
|
void |
setCompression(String compression)
Set compression level.
|
void |
setCompressionLevel(int compressionLevel)
Setter for the compressionLevel
|
void |
setCompressionMinSize(int compressionMinSize)
Setter for the compressionMinSize
|
void |
setContentDelimitation(boolean contentDelimitation)
Setter for the contentDelimitation
|
void |
setDisableUploadTimeout(boolean disableUploadTimeout)
Setter for the disableUploadTimeout
|
void |
setError(boolean error)
Setter for the error
|
void |
setEvent(boolean event)
Setter for the event
|
void |
setExpectation(boolean expectation)
Setter for the expectation
|
void |
setHostNameC(char[] hostNameC)
Setter for the hostNameC
|
void |
setHttp09(boolean http09)
Setter for the http09
|
void |
setHttp11(boolean http11)
Setter for the http11
|
void |
setKeepAlive(boolean keepAlive)
Setter for the keepAlive
|
void |
setKeepAliveTimeout(int keepAliveTimeout)
Setter for the keepAliveTimeout
|
void |
setLocalAddr(String localAddr)
Setter for the localAddr
|
void |
setLocalName(String localName)
Setter for the localName
|
void |
setLocalPort(int localPort)
Setter for the localPort
|
void |
setMaxKeepAliveRequests(int maxKeepAliveRequests)
Setter for the maxKeepAliveRequests
|
void |
setMaxSavePostSize(int maxSavePostSize)
Setter for the maxSavePostSize
|
void |
setNoCompressionUserAgents(Pattern[] noCompressionUserAgents)
Setter for the noCompressionUserAgents
|
void |
setNoCompressionUserAgents(String noCompressionUserAgents)
Set no compression user agent list.
|
void |
setReadNotifications(boolean readNotifications)
Setter for the readNotifications
|
void |
setRemoteAddr(String remoteAddr)
Setter for the remoteAddr
|
void |
setRemoteHost(String remoteHost)
Setter for the remoteHost
|
void |
setRemotePort(int remotePort)
Setter for the remotePort
|
void |
setRequest(Request request)
Setter for the request
|
void |
setResponse(Response response)
Setter for the response
|
void |
setRestrictedUserAgents(Pattern[] restrictedUserAgents)
Setter for the restrictedUserAgents
|
void |
setRestrictedUserAgents(String restrictedUserAgents)
Set restricted user agent list (which will downgrade the connector to
HTTP/1.0 mode).
|
void |
setResumeNotification(boolean resumeNotification)
Setter for the resumeNotification
|
void |
setServer(String server)
Set the server header name.
|
void |
setSSLEnabled(boolean sslEnabled)
Setter for the sslEnabled
|
void |
setSSLSupport(SSLSupport sslSupport)
Setter for the sslSupport
|
void |
setTimeout(int timeout)
Setter for the timeout
|
void |
setWriteNotification(boolean writeNotification)
Setter for the writeNotification
|
protected boolean |
startsWithStringArray(String[] sArray,
String value)
Checks if any entry in the string array starts with the specified value
|
protected boolean |
statusDropsConnection(int status)
Determine if we must drop the connection because of the HTTP status code.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
action
protected static final boolean CHUNK_ON_CLOSE
public static ThreadLocal<Boolean> containerThread
protected Adapter adapter
protected Request request
protected Response response
protected boolean error
protected boolean keepAlive
protected boolean http11
protected boolean http09
protected boolean contentDelimitation
protected boolean expectation
protected Pattern[] restrictedUserAgents
protected int maxKeepAliveRequests
protected int keepAliveTimeout
protected SSLSupport sslSupport
protected String remoteAddr
protected String remoteHost
protected String localName
protected int localPort
protected int remotePort
protected String localAddr
protected boolean disableUploadTimeout
protected int compressionLevel
protected int compressionMinSize
protected int maxSavePostSize
protected Pattern[] noCompressionUserAgents
protected String[] compressableMimeTypes
protected char[] hostNameC
protected String server
protected boolean sslEnabled
protected boolean event
protected boolean resumeNotification
protected boolean readNotifications
protected boolean writeNotification
protected boolean processing
protected int timeout
public String getCompression()
public void setCompression(String compression)
compression
- public void addNoCompressionUserAgent(String userAgent)
userAgent
- user-agent stringpublic void setNoCompressionUserAgents(String noCompressionUserAgents)
noCompressionUserAgents
- public void addCompressableMimeType(String mimeType)
mimeType
- mime-type stringpublic void setCompressableMimeTypes(String[] compressableMimeTypes)
compressableMimeTypes
- public void setCompressableMimeTypes(String compressableMimeTypes)
compressableMimeTypes
- public String[] findCompressableMimeTypes()
protected abstract void addFilter(String className)
className
- class name of the filterprotected String[] addStringArray(String[] sArray, String value)
sArray
- the StringArrayvalue
- stringprotected Pattern[] addREArray(Pattern[] rArray, Pattern value)
rArray
- the REArrayvalue
- Objprotected boolean startsWithStringArray(String[] sArray, String value)
sArray
- the StringArrayvalue
- stringpublic void addRestrictedUserAgent(String userAgent)
userAgent
- user-agent stringpublic void setRestrictedUserAgents(String restrictedUserAgents)
restrictedUserAgents
- public String[] findRestrictedUserAgents()
public void setServer(String server)
server
- public abstract void endRequest()
public void recycle()
protected boolean isCompressable()
protected abstract void prepareRequest()
protected abstract void prepareResponse()
protected abstract void initializeFilters()
public abstract NioEndpoint.Handler.SocketState event(SocketStatus status) throws IOException
status
- IOException
- error during an I/O operationprotected void reset()
protected boolean statusDropsConnection(int status)
protected int findBytes(ByteChunk bc, byte[] b)
public Adapter getAdapter()
public void setAdapter(Adapter adapter)
adapter
- the adapter to setpublic Request getRequest()
public void setRequest(Request request)
request
- the request to setpublic Response getResponse()
public void setResponse(Response response)
response
- the response to setpublic boolean isError()
public void setError(boolean error)
error
- the error to setpublic boolean isKeepAlive()
public void setKeepAlive(boolean keepAlive)
keepAlive
- the keepAlive to setpublic boolean isHttp11()
public void setHttp11(boolean http11)
http11
- the http11 to setpublic boolean isHttp09()
public void setHttp09(boolean http09)
http09
- the http09 to setpublic boolean isContentDelimitation()
public void setContentDelimitation(boolean contentDelimitation)
contentDelimitation
- the contentDelimitation to setpublic boolean isExpectation()
public void setExpectation(boolean expectation)
expectation
- the expectation to setpublic Pattern[] getRestrictedUserAgents()
public void setRestrictedUserAgents(Pattern[] restrictedUserAgents)
restrictedUserAgents
- the restrictedUserAgents to setpublic int getMaxKeepAliveRequests()
public void setMaxKeepAliveRequests(int maxKeepAliveRequests)
maxKeepAliveRequests
- the maxKeepAliveRequests to setpublic int getKeepAliveTimeout()
public void setKeepAliveTimeout(int keepAliveTimeout)
keepAliveTimeout
- the keepAliveTimeout to setpublic SSLSupport getSSLSupport()
public void setSSLSupport(SSLSupport sslSupport)
sslSupport
- the sslSupport to setpublic String getRemoteAddr()
public void setRemoteAddr(String remoteAddr)
remoteAddr
- the remoteAddr to setpublic String getRemoteHost()
public void setRemoteHost(String remoteHost)
remoteHost
- the remoteHost to setpublic String getLocalName()
public void setLocalName(String localName)
localName
- the localName to setpublic int getLocalPort()
public void setLocalPort(int localPort)
localPort
- the localPort to setpublic int getRemotePort()
public void setRemotePort(int remotePort)
remotePort
- the remotePort to setpublic String getLocalAddr()
public void setLocalAddr(String localAddr)
localAddr
- the localAddr to setpublic boolean getDisableUploadTimeout()
public void setDisableUploadTimeout(boolean disableUploadTimeout)
disableUploadTimeout
- the disableUploadTimeout to setpublic int getCompressionLevel()
public void setCompressionLevel(int compressionLevel)
compressionLevel
- the compressionLevel to setpublic int getCompressionMinSize()
public void setCompressionMinSize(int compressionMinSize)
compressionMinSize
- the compressionMinSize to setpublic int getMaxSavePostSize()
public void setMaxSavePostSize(int maxSavePostSize)
maxSavePostSize
- the maxSavePostSize to setpublic Pattern[] getNoCompressionUserAgents()
public void setNoCompressionUserAgents(Pattern[] noCompressionUserAgents)
noCompressionUserAgents
- the noCompressionUserAgents to setpublic char[] getHostNameC()
public void setHostNameC(char[] hostNameC)
hostNameC
- the hostNameC to setpublic boolean isEvent()
public void setEvent(boolean event)
event
- the event to setpublic boolean getResumeNotification()
public void setResumeNotification(boolean resumeNotification)
resumeNotification
- the resumeNotification to setpublic int getTimeout()
public void setTimeout(int timeout)
timeout
- the timeout to setpublic String[] getCompressableMimeTypes()
public String getServer()
public boolean getReadNotifications()
public void setReadNotifications(boolean readNotifications)
readNotifications
- the readNotifications to setpublic boolean getWriteNotification()
public void setWriteNotification(boolean writeNotification)
writeNotification
- the writeNotification to setpublic boolean getSSLEnabled()
public void setSSLEnabled(boolean sslEnabled)
sslEnabled
- the sslEnabled to setCopyright © 2014 JBoss by Red Hat. All Rights Reserved.