public final class HttpTunnelingSocketChannelConfig extends java.lang.Object implements SocketChannelConfig
ChannelConfig
of a client-side HTTP tunneling
SocketChannel
. A SocketChannel
created by
HttpTunnelingClientSocketChannelFactory
will return an instance of
this configuration type for SocketChannel.getConfig()
.
SocketChannelConfig
,
HttpTunnelingSocketChannelConfig
allows the following options in
the option map:
Name | Associated setter method |
---|---|
"sslContext" | setSslContext(SSLContext) |
"enabledSslCiperSuites" | setEnabledSslCipherSuites(String[]) |
"enabledSslProtocols" | setEnabledSslProtocols(String[]) |
"enableSslSessionCreation" | setEnableSslSessionCreation(boolean) |
限定符和类型 | 方法和说明 |
---|---|
ChannelBufferFactory |
getBufferFactory()
Returns the default
ChannelBufferFactory used to create a new
ChannelBuffer . |
int |
getConnectTimeoutMillis()
Returns the connect timeout of the channel in milliseconds.
|
java.lang.String[] |
getEnabledSslCipherSuites()
Returns the cipher suites enabled for use on an
SSLEngine . |
java.lang.String[] |
getEnabledSslProtocols()
Returns the protocol versions enabled for use on an
SSLEngine . |
ChannelPipelineFactory |
getPipelineFactory()
Returns the
ChannelPipelineFactory which will be used when
a child channel is created. |
int |
getReceiveBufferSize()
Gets the
StandardSocketOptions.SO_RCVBUF option. |
int |
getSendBufferSize()
Gets the
StandardSocketOptions.SO_SNDBUF option. |
java.lang.String |
getServerName()
Returns the host name of the HTTP server.
|
java.lang.String |
getServerPath()
Returns the path where the
HttpTunnelingServlet is mapped to. |
int |
getSoLinger()
Gets the
StandardSocketOptions.SO_LINGER option. |
javax.net.ssl.SSLContext |
getSslContext()
Returns the
SSLContext which is used to establish an HTTPS
connection. |
int |
getTrafficClass()
Gets the
StandardSocketOptions.IP_TOS option. |
boolean |
isEnableSslSessionCreation()
Returns
true if new SSLSession s may be established by
an SSLEngine . |
boolean |
isKeepAlive()
Gets the
StandardSocketOptions.SO_KEEPALIVE option. |
boolean |
isReuseAddress()
Gets the
StandardSocketOptions.SO_REUSEADDR option. |
boolean |
isTcpNoDelay()
Gets the
StandardSocketOptions.TCP_NODELAY option. |
void |
setBufferFactory(ChannelBufferFactory bufferFactory)
Sets the default
ChannelBufferFactory used to create a new
ChannelBuffer . |
void |
setConnectTimeoutMillis(int connectTimeoutMillis)
Sets the connect timeout of the channel in milliseconds.
|
void |
setEnabledSslCipherSuites(java.lang.String[] suites)
Sets the cipher suites enabled for use on an
SSLEngine . |
void |
setEnabledSslProtocols(java.lang.String[] protocols)
Sets the protocol versions enabled for use on an
SSLEngine . |
void |
setEnableSslSessionCreation(boolean flag)
Sets whether new
SSLSession s may be established by an
SSLEngine . |
void |
setKeepAlive(boolean keepAlive)
Sets the
StandardSocketOptions.SO_KEEPALIVE option. |
boolean |
setOption(java.lang.String key,
java.lang.Object value)
Sets a configuration property with the specified name and value.
|
void |
setOptions(java.util.Map<java.lang.String,java.lang.Object> options)
Sets the configuration properties from the specified
Map . |
void |
setPerformancePreferences(int connectionTime,
int latency,
int bandwidth)
Sets the performance preferences as specified in
Socket.setPerformancePreferences(int, int, int) . |
void |
setPipelineFactory(ChannelPipelineFactory pipelineFactory)
Sets the
ChannelPipelineFactory which will be used when
a child channel is created. |
void |
setReceiveBufferSize(int receiveBufferSize)
Sets the
StandardSocketOptions.SO_RCVBUF option. |
void |
setReuseAddress(boolean reuseAddress)
Sets the
StandardSocketOptions.SO_REUSEADDR option. |
void |
setSendBufferSize(int sendBufferSize)
Sets the
StandardSocketOptions.SO_SNDBUF option. |
void |
setServerName(java.lang.String serverName)
Sets the host name of the HTTP server.
|
void |
setServerPath(java.lang.String serverPath)
Sets the path where the
HttpTunnelingServlet is mapped to. |
void |
setSoLinger(int soLinger)
Sets the
StandardSocketOptions.SO_LINGER option. |
void |
setSslContext(javax.net.ssl.SSLContext sslContext)
Sets the
SSLContext which is used to establish an HTTPS connection. |
void |
setTcpNoDelay(boolean tcpNoDelay)
Sets the
StandardSocketOptions.TCP_NODELAY option. |
void |
setTrafficClass(int trafficClass)
Sets the
StandardSocketOptions.IP_TOS option. |
public java.lang.String getServerName()
null
, the
"Host"
header is not sent by the HTTP tunneling client.public void setServerName(java.lang.String serverName)
null
, the
"Host"
header is not sent by the HTTP tunneling client.public java.lang.String getServerPath()
HttpTunnelingServlet
is mapped to.
The default value is "/netty-tunnel"
.public void setServerPath(java.lang.String serverPath)
HttpTunnelingServlet
is mapped to.
The default value is "/netty-tunnel"
.public javax.net.ssl.SSLContext getSslContext()
SSLContext
which is used to establish an HTTPS
connection. If null
, a plain-text HTTP connection is established.public void setSslContext(javax.net.ssl.SSLContext sslContext)
SSLContext
which is used to establish an HTTPS connection.
If null
, a plain-text HTTP connection is established.public java.lang.String[] getEnabledSslCipherSuites()
SSLEngine
.
If null
, the default value will be used.SSLEngine.getEnabledCipherSuites()
public void setEnabledSslCipherSuites(java.lang.String[] suites)
SSLEngine
.
If null
, the default value will be used.SSLEngine.setEnabledCipherSuites(String[])
public java.lang.String[] getEnabledSslProtocols()
SSLEngine
.SSLEngine.getEnabledProtocols()
public void setEnabledSslProtocols(java.lang.String[] protocols)
SSLEngine
.SSLEngine.setEnabledProtocols(String[])
public boolean isEnableSslSessionCreation()
true
if new SSLSession
s may be established by
an SSLEngine
.SSLEngine.getEnableSessionCreation()
public void setEnableSslSessionCreation(boolean flag)
SSLSession
s may be established by an
SSLEngine
.SSLEngine.setEnableSessionCreation(boolean)
public void setOptions(java.util.Map<java.lang.String,java.lang.Object> options)
ChannelConfig
Map
.setOptions
在接口中 ChannelConfig
public boolean setOption(java.lang.String key, java.lang.Object value)
ChannelConfig
public boolean setOption(String name, Object value) { if (super.setOption(name, value)) { return true; } if (name.equals("additionalOption")) { .... return true; } return false; }
setOption
在接口中 ChannelConfig
true
if and only if the property has been setpublic int getReceiveBufferSize()
SocketChannelConfig
StandardSocketOptions.SO_RCVBUF
option.getReceiveBufferSize
在接口中 SocketChannelConfig
public int getSendBufferSize()
SocketChannelConfig
StandardSocketOptions.SO_SNDBUF
option.getSendBufferSize
在接口中 SocketChannelConfig
public int getSoLinger()
SocketChannelConfig
StandardSocketOptions.SO_LINGER
option.getSoLinger
在接口中 SocketChannelConfig
public int getTrafficClass()
SocketChannelConfig
StandardSocketOptions.IP_TOS
option.getTrafficClass
在接口中 SocketChannelConfig
public boolean isKeepAlive()
SocketChannelConfig
StandardSocketOptions.SO_KEEPALIVE
option.isKeepAlive
在接口中 SocketChannelConfig
public boolean isReuseAddress()
SocketChannelConfig
StandardSocketOptions.SO_REUSEADDR
option.isReuseAddress
在接口中 SocketChannelConfig
public boolean isTcpNoDelay()
SocketChannelConfig
StandardSocketOptions.TCP_NODELAY
option.isTcpNoDelay
在接口中 SocketChannelConfig
public void setKeepAlive(boolean keepAlive)
SocketChannelConfig
StandardSocketOptions.SO_KEEPALIVE
option.setKeepAlive
在接口中 SocketChannelConfig
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth)
SocketChannelConfig
Socket.setPerformancePreferences(int, int, int)
.setPerformancePreferences
在接口中 SocketChannelConfig
public void setReceiveBufferSize(int receiveBufferSize)
SocketChannelConfig
StandardSocketOptions.SO_RCVBUF
option.setReceiveBufferSize
在接口中 SocketChannelConfig
public void setReuseAddress(boolean reuseAddress)
SocketChannelConfig
StandardSocketOptions.SO_REUSEADDR
option.setReuseAddress
在接口中 SocketChannelConfig
public void setSendBufferSize(int sendBufferSize)
SocketChannelConfig
StandardSocketOptions.SO_SNDBUF
option.setSendBufferSize
在接口中 SocketChannelConfig
public void setSoLinger(int soLinger)
SocketChannelConfig
StandardSocketOptions.SO_LINGER
option.setSoLinger
在接口中 SocketChannelConfig
public void setTcpNoDelay(boolean tcpNoDelay)
SocketChannelConfig
StandardSocketOptions.TCP_NODELAY
option.setTcpNoDelay
在接口中 SocketChannelConfig
public void setTrafficClass(int trafficClass)
SocketChannelConfig
StandardSocketOptions.IP_TOS
option.setTrafficClass
在接口中 SocketChannelConfig
public ChannelBufferFactory getBufferFactory()
ChannelConfig
ChannelBufferFactory
used to create a new
ChannelBuffer
. The default is HeapChannelBufferFactory
.
You can specify a different factory to change the default
ByteOrder
for example.getBufferFactory
在接口中 ChannelConfig
public int getConnectTimeoutMillis()
ChannelConfig
Channel
does not support connect operation, this property is not
used at all, and therefore will be ignored.getConnectTimeoutMillis
在接口中 ChannelConfig
0
if disabled.public ChannelPipelineFactory getPipelineFactory()
ChannelConfig
ChannelPipelineFactory
which will be used when
a child channel is created. If the Channel
does not create
a child channel, this property is not used at all, and therefore will
be ignored.getPipelineFactory
在接口中 ChannelConfig
public void setBufferFactory(ChannelBufferFactory bufferFactory)
ChannelConfig
ChannelBufferFactory
used to create a new
ChannelBuffer
. The default is HeapChannelBufferFactory
.
You can specify a different factory to change the default
ByteOrder
for example.setBufferFactory
在接口中 ChannelConfig
public void setConnectTimeoutMillis(int connectTimeoutMillis)
ChannelConfig
Channel
does not support connect operation, this property is not
used at all, and therefore will be ignored.setConnectTimeoutMillis
在接口中 ChannelConfig
connectTimeoutMillis
- the connect timeout in milliseconds.
0
to disable.public void setPipelineFactory(ChannelPipelineFactory pipelineFactory)
ChannelConfig
ChannelPipelineFactory
which will be used when
a child channel is created. If the Channel
does not create
a child channel, this property is not used at all, and therefore will
be ignored.setPipelineFactory
在接口中 ChannelConfig