该类是AbstractProtocol泛型抽象类的Http子抽象类
该类主要定义了一些参数并提供了其set/get方法
/**
* The string manager for this package.
*/
protected static final StringManager sm = StringManager.getManager(Constants.Package);
/**
* 设置协议名称
*/
@Override
protected String getProtocolName() {
return "Http";
}
// ------------------------------------------------ HTTP specific properties
// ------------------------------------------ managed in the ProtocolHandler
private int socketBuffer = 9000;
public int getSocketBuffer() {
return socketBuffer;
}
public void setSocketBuffer(int socketBuffer) {
this.socketBuffer = socketBuffer;
}
/**
* Maximum size of the post which will be saved when processing certain
* requests, such as a POST.
*/
private int maxSavePostSize = 4 * 1024;
public int getMaxSavePostSize() {
return maxSavePostSize;
}
public void setMaxSavePostSize(int valueI) {
maxSavePostSize = valueI;
}
/**
* Http header信息的最大长度
* Maximum size of the HTTP message header.
*/
private int maxHttpHeaderSize = 8 * 1024;
public int getMaxHttpHeaderSize() {
return maxHttpHeaderSize;
}
public void setMaxHttpHeaderSize(int valueI) {
maxHttpHeaderSize = valueI;
}
/**
* Specifies a different (usually longer) connection timeout during data
* upload.
*/
private int connectionUploadTimeout = 300000;
public int getConnectionUploadTimeout() {
return connectionUploadTimeout;
}
public void setConnectionUploadTimeout(int i) {
connectionUploadTimeout = i;
}
/**
* If true, the connectionUploadTimeout will be ignored and the regular
* socket timeout will be used for the full duration of the connection.
*/
private boolean disableUploadTimeout = true;
public boolean getDisableUploadTimeout() {
return disableUploadTimeout;
}
public void setDisableUploadTimeout(boolean isDisabled) {
disableUploadTimeout = isDisabled;
}
/**
* Integrated compression support.
*/
private String compression = "off";
public String getCompression() {
return compression;
}
public void setCompression(String valueS) {
compression = valueS;
}
private String noCompressionUserAgents = null;
public String getNoCompressionUserAgents() {
return noCompressionUserAgents;
}
public void setNoCompressionUserAgents(String valueS) {
noCompressionUserAgents = valueS;
}
private String compressableMimeTypes = "text/html,text/xml,text/plain";
public String getCompressableMimeType() {
return compressableMimeTypes;
}
public void setCompressableMimeType(String valueS) {
compressableMimeTypes = valueS;
}
public String getCompressableMimeTypes() {
return getCompressableMimeType();
}
public void setCompressableMimeTypes(String valueS) {
setCompressableMimeType(valueS);
}
private int compressionMinSize = 2048;
public int getCompressionMinSize() {
return compressionMinSize;
}
public void setCompressionMinSize(int valueI) {
compressionMinSize = valueI;
}
/**
* Regular expression that defines the User agents which should be
* restricted to HTTP/1.0 support.
*/
private String restrictedUserAgents = null;
public String getRestrictedUserAgents() {
return restrictedUserAgents;
}
public void setRestrictedUserAgents(String valueS) {
restrictedUserAgents = valueS;
}
/**
* Server header.
*/
private String server;
public String getServer() {
return server;
}
public void setServer(String server) {
this.server = server;
}
/**
* Maximum size of trailing headers in bytes
*/
private int maxTrailerSize = 8192;
public int getMaxTrailerSize() {
return maxTrailerSize;
}
public void setMaxTrailerSize(int maxTrailerSize) {
this.maxTrailerSize = maxTrailerSize;
}
/**
* Maximum size of extension information in chunked encoding
*/
private int maxExtensionSize = 8192;
public int getMaxExtensionSize() {
return maxExtensionSize;
}
public void setMaxExtensionSize(int maxExtensionSize) {
this.maxExtensionSize = maxExtensionSize;
}
/**
* Maximum amount of request body to swallow.
*/
private int maxSwallowSize = 2 * 1024 * 1024;
public int getMaxSwallowSize() {
return maxSwallowSize;
}
public void setMaxSwallowSize(int maxSwallowSize) {
this.maxSwallowSize = maxSwallowSize;
}
/**
* This field indicates if the protocol is treated as if it is secure. This
* normally means https is being used but can be used to fake https e.g
* behind a reverse proxy.
*/
private boolean secure;
public boolean getSecure() {
return secure;
}
public void setSecure(boolean b) {
secure = b;
}
/**
* The size of the buffer used by the ServletOutputStream when performing
* delayed asynchronous writes using HTTP upgraded connections.
*/
private int upgradeAsyncWriteBufferSize = 8192;
public int getUpgradeAsyncWriteBufferSize() {
return upgradeAsyncWriteBufferSize;
}
public void setUpgradeAsyncWriteBufferSize(int upgradeAsyncWriteBufferSize) {
this.upgradeAsyncWriteBufferSize = upgradeAsyncWriteBufferSize;
}
// ------------------------------------------------ HTTP specific properties
// ------------------------------------------ passed through to the EndPoint
public boolean isSSLEnabled() {
return endpoint.isSSLEnabled();
}
public void setSSLEnabled(boolean SSLEnabled) {
endpoint.setSSLEnabled(SSLEnabled);
}
/**
* Maximum number of requests which can be performed over a keepalive
* connection. The default is the same as for Apache HTTP Server.
*/
public int getMaxKeepAliveRequests() {
return endpoint.getMaxKeepAliveRequests();
}
public void setMaxKeepAliveRequests(int mkar) {
endpoint.setMaxKeepAliveRequests(mkar);
}