public final class HttpTunnelingSocketChannelConfig extends 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) |
Modifier and Type | Method and Description |
---|---|
ChannelBufferFactory |
getBufferFactory()
Returns the default
ChannelBufferFactory used to create a new
ChannelBuffer . |
int |
getConnectTimeoutMillis()
Returns the connect timeout of the channel in milliseconds.
|
String[] |
getEnabledSslCipherSuites()
Returns the cipher suites enabled for use on an
SSLEngine . |
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. |
String |
getServerName()
Returns the host name of the HTTP server.
|
String |
getServerPath()
Returns the path where the
HttpTunnelingServlet is mapped to. |
int |
getSoLinger()
Gets the
StandardSocketOptions.SO_LINGER option. |
SSLContext |
getSslContext()
Returns the
SSLContext which is used to establish an HTTPS
connection. |
int |
getTrafficClass()
Gets the
StandardSocketOptions.IP_TOS option. |
boolean |
isEnableSslSessionCreation()
|
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(String[] suites)
Sets the cipher suites enabled for use on an
SSLEngine . |
void |
setEnabledSslProtocols(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(String key,
Object value)
Sets a configuration property with the specified name and value.
|
void |
setOptions(Map<String,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(String serverName)
Sets the host name of the HTTP server.
|
void |
setServerPath(String serverPath)
Sets the path where the
HttpTunnelingServlet is mapped to. |
void |
setSoLinger(int soLinger)
Sets the
StandardSocketOptions.SO_LINGER option. |
void |
setSslContext(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 String getServerName()
null
, the
"Host"
header is not sent by the HTTP tunneling client.public void setServerName(String serverName)
null
, the
"Host"
header is not sent by the HTTP tunneling client.public String getServerPath()
HttpTunnelingServlet
is mapped to.
The default value is "/netty-tunnel"
.public void setServerPath(String serverPath)
HttpTunnelingServlet
is mapped to.
The default value is "/netty-tunnel"
.public SSLContext getSslContext()
SSLContext
which is used to establish an HTTPS
connection. If null
, a plain-text HTTP connection is established.public void setSslContext(SSLContext sslContext)
SSLContext
which is used to establish an HTTPS connection.
If null
, a plain-text HTTP connection is established.public String[] getEnabledSslCipherSuites()
SSLEngine
.
If null
, the default value will be used.SSLEngine.getEnabledCipherSuites()
public void setEnabledSslCipherSuites(String[] suites)
SSLEngine
.
If null
, the default value will be used.public String[] getEnabledSslProtocols()
SSLEngine
.SSLEngine.getEnabledProtocols()
public void setEnabledSslProtocols(String[] protocols)
SSLEngine
.public boolean isEnableSslSessionCreation()
SSLEngine.getEnableSessionCreation()
public void setEnableSslSessionCreation(boolean flag)
SSLSession
s may be established by an
SSLEngine
.public void setOptions(Map<String,Object> options)
ChannelConfig
Map
.setOptions
in interface ChannelConfig
public boolean setOption(String key, 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
in interface ChannelConfig
true
if and only if the property has been setpublic int getReceiveBufferSize()
SocketChannelConfig
StandardSocketOptions.SO_RCVBUF
option.getReceiveBufferSize
in interface SocketChannelConfig
public int getSendBufferSize()
SocketChannelConfig
StandardSocketOptions.SO_SNDBUF
option.getSendBufferSize
in interface SocketChannelConfig
public int getSoLinger()
SocketChannelConfig
StandardSocketOptions.SO_LINGER
option.getSoLinger
in interface SocketChannelConfig
public int getTrafficClass()
SocketChannelConfig
StandardSocketOptions.IP_TOS
option.getTrafficClass
in interface SocketChannelConfig
public boolean isKeepAlive()
SocketChannelConfig
StandardSocketOptions.SO_KEEPALIVE
option.isKeepAlive
in interface SocketChannelConfig
public boolean isReuseAddress()
SocketChannelConfig
StandardSocketOptions.SO_REUSEADDR
option.isReuseAddress
in interface SocketChannelConfig
public boolean isTcpNoDelay()
SocketChannelConfig
StandardSocketOptions.TCP_NODELAY
option.isTcpNoDelay
in interface SocketChannelConfig
public void setKeepAlive(boolean keepAlive)
SocketChannelConfig
StandardSocketOptions.SO_KEEPALIVE
option.setKeepAlive
in interface SocketChannelConfig
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth)
SocketChannelConfig
Socket.setPerformancePreferences(int, int, int)
.setPerformancePreferences
in interface SocketChannelConfig
public void setReceiveBufferSize(int receiveBufferSize)
SocketChannelConfig
StandardSocketOptions.SO_RCVBUF
option.setReceiveBufferSize
in interface SocketChannelConfig
public void setReuseAddress(boolean reuseAddress)
SocketChannelConfig
StandardSocketOptions.SO_REUSEADDR
option.setReuseAddress
in interface SocketChannelConfig
public void setSendBufferSize(int sendBufferSize)
SocketChannelConfig
StandardSocketOptions.SO_SNDBUF
option.setSendBufferSize
in interface SocketChannelConfig
public void setSoLinger(int soLinger)
SocketChannelConfig
StandardSocketOptions.SO_LINGER
option.setSoLinger
in interface SocketChannelConfig
public void setTcpNoDelay(boolean tcpNoDelay)
SocketChannelConfig
StandardSocketOptions.TCP_NODELAY
option.setTcpNoDelay
in interface SocketChannelConfig
public void setTrafficClass(int trafficClass)
SocketChannelConfig
StandardSocketOptions.IP_TOS
option.setTrafficClass
in interface 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
in interface ChannelConfig
public int getConnectTimeoutMillis()
ChannelConfig
Channel
does not support connect operation, this property is not
used at all, and therefore will be ignored.getConnectTimeoutMillis
in interface 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
in interface 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
in interface 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
in interface 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
in interface ChannelConfig
Copyright © 2008-2016 The Netty Project. All Rights Reserved.