Class HttpTunnelingSocketChannelConfig
java.lang.Object
org.jboss.netty.channel.socket.http.HttpTunnelingSocketChannelConfig
- All Implemented Interfaces:
ChannelConfig
,SocketChannelConfig
The
ChannelConfig
of a client-side HTTP tunneling
SocketChannel
. A SocketChannel
created by
HttpTunnelingClientSocketChannelFactory
will return an instance of
this configuration type for SocketChannel.getConfig()
.
Available options
In addition to the options provided bySocketChannelConfig
,
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) |
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HttpTunnelingClientSocketChannel
private String[]
private String[]
private boolean
private String
private String
private SSLContext
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the defaultChannelBufferFactory
used to create a newChannelBuffer
.int
Returns the connect timeout of the channel in milliseconds.String[]
Returns the cipher suites enabled for use on anSSLEngine
.String[]
Returns the protocol versions enabled for use on anSSLEngine
.Returns theChannelPipelineFactory
which will be used when a child channel is created.int
Gets theStandardSocketOptions.SO_RCVBUF
option.int
Gets theStandardSocketOptions.SO_SNDBUF
option.Returns the host name of the HTTP server.Returns the path where theHttpTunnelingServlet
is mapped to.int
Gets theStandardSocketOptions.SO_LINGER
option.Returns theSSLContext
which is used to establish an HTTPS connection.int
Gets theStandardSocketOptions.IP_TOS
option.boolean
boolean
Gets theStandardSocketOptions.SO_KEEPALIVE
option.boolean
Gets theStandardSocketOptions.SO_REUSEADDR
option.boolean
Gets theStandardSocketOptions.TCP_NODELAY
option.void
setBufferFactory
(ChannelBufferFactory bufferFactory) Sets the defaultChannelBufferFactory
used to create a newChannelBuffer
.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 anSSLEngine
.void
setEnabledSslProtocols
(String[] protocols) Sets the protocol versions enabled for use on anSSLEngine
.void
setEnableSslSessionCreation
(boolean flag) Sets whether newSSLSession
s may be established by anSSLEngine
.void
setKeepAlive
(boolean keepAlive) Sets theStandardSocketOptions.SO_KEEPALIVE
option.boolean
Sets a configuration property with the specified name and value.void
setOptions
(Map<String, Object> options) Sets the configuration properties from the specifiedMap
.void
setPerformancePreferences
(int connectionTime, int latency, int bandwidth) Sets the performance preferences as specified inSocket.setPerformancePreferences(int, int, int)
.void
setPipelineFactory
(ChannelPipelineFactory pipelineFactory) Sets theChannelPipelineFactory
which will be used when a child channel is created.void
setReceiveBufferSize
(int receiveBufferSize) Sets theStandardSocketOptions.SO_RCVBUF
option.void
setReuseAddress
(boolean reuseAddress) Sets theStandardSocketOptions.SO_REUSEADDR
option.void
setSendBufferSize
(int sendBufferSize) Sets theStandardSocketOptions.SO_SNDBUF
option.void
setServerName
(String serverName) Sets the host name of the HTTP server.void
setServerPath
(String serverPath) Sets the path where theHttpTunnelingServlet
is mapped to.void
setSoLinger
(int soLinger) Sets theStandardSocketOptions.SO_LINGER
option.void
setSslContext
(SSLContext sslContext) Sets theSSLContext
which is used to establish an HTTPS connection.void
setTcpNoDelay
(boolean tcpNoDelay) Sets theStandardSocketOptions.TCP_NODELAY
option.void
setTrafficClass
(int trafficClass) Sets theStandardSocketOptions.IP_TOS
option.
-
Field Details
-
channel
-
serverName
-
serverPath
-
sslContext
-
enabledSslCipherSuites
-
enabledSslProtocols
-
enableSslSessionCreation
private volatile boolean enableSslSessionCreation
-
-
Constructor Details
-
HttpTunnelingSocketChannelConfig
HttpTunnelingSocketChannelConfig(HttpTunnelingClientSocketChannel channel) Creates a new instance.
-
-
Method Details
-
getServerName
Returns the host name of the HTTP server. Ifnull
, the"Host"
header is not sent by the HTTP tunneling client. -
setServerName
Sets the host name of the HTTP server. Ifnull
, the"Host"
header is not sent by the HTTP tunneling client. -
getServerPath
Returns the path where theHttpTunnelingServlet
is mapped to. The default value is"/netty-tunnel"
. -
setServerPath
Sets the path where theHttpTunnelingServlet
is mapped to. The default value is"/netty-tunnel"
. -
getSslContext
Returns theSSLContext
which is used to establish an HTTPS connection. Ifnull
, a plain-text HTTP connection is established. -
setSslContext
Sets theSSLContext
which is used to establish an HTTPS connection. Ifnull
, a plain-text HTTP connection is established. -
getEnabledSslCipherSuites
Returns the cipher suites enabled for use on anSSLEngine
. Ifnull
, the default value will be used.- See Also:
-
setEnabledSslCipherSuites
Sets the cipher suites enabled for use on anSSLEngine
. Ifnull
, the default value will be used.- See Also:
-
getEnabledSslProtocols
Returns the protocol versions enabled for use on anSSLEngine
.- See Also:
-
setEnabledSslProtocols
Sets the protocol versions enabled for use on anSSLEngine
.- See Also:
-
isEnableSslSessionCreation
public boolean isEnableSslSessionCreation()- See Also:
-
setEnableSslSessionCreation
public void setEnableSslSessionCreation(boolean flag) Sets whether newSSLSession
s may be established by anSSLEngine
.- See Also:
-
setOptions
Description copied from interface:ChannelConfig
Sets the configuration properties from the specifiedMap
.- Specified by:
setOptions
in interfaceChannelConfig
-
setOption
Description copied from interface:ChannelConfig
Sets a configuration property with the specified name and value. To override this method properly, you must call the super class:public boolean setOption(String name, Object value) { if (super.setOption(name, value)) { return true; } if (name.equals("additionalOption")) { .... return true; } return false; }
- Specified by:
setOption
in interfaceChannelConfig
- Returns:
true
if and only if the property has been set
-
getReceiveBufferSize
public int getReceiveBufferSize()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.SO_RCVBUF
option.- Specified by:
getReceiveBufferSize
in interfaceSocketChannelConfig
-
getSendBufferSize
public int getSendBufferSize()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.SO_SNDBUF
option.- Specified by:
getSendBufferSize
in interfaceSocketChannelConfig
-
getSoLinger
public int getSoLinger()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.SO_LINGER
option.- Specified by:
getSoLinger
in interfaceSocketChannelConfig
-
getTrafficClass
public int getTrafficClass()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.IP_TOS
option.- Specified by:
getTrafficClass
in interfaceSocketChannelConfig
-
isKeepAlive
public boolean isKeepAlive()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.SO_KEEPALIVE
option.- Specified by:
isKeepAlive
in interfaceSocketChannelConfig
-
isReuseAddress
public boolean isReuseAddress()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.SO_REUSEADDR
option.- Specified by:
isReuseAddress
in interfaceSocketChannelConfig
-
isTcpNoDelay
public boolean isTcpNoDelay()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.TCP_NODELAY
option.- Specified by:
isTcpNoDelay
in interfaceSocketChannelConfig
-
setKeepAlive
public void setKeepAlive(boolean keepAlive) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.SO_KEEPALIVE
option.- Specified by:
setKeepAlive
in interfaceSocketChannelConfig
-
setPerformancePreferences
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) Description copied from interface:SocketChannelConfig
Sets the performance preferences as specified inSocket.setPerformancePreferences(int, int, int)
.- Specified by:
setPerformancePreferences
in interfaceSocketChannelConfig
-
setReceiveBufferSize
public void setReceiveBufferSize(int receiveBufferSize) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.SO_RCVBUF
option.- Specified by:
setReceiveBufferSize
in interfaceSocketChannelConfig
-
setReuseAddress
public void setReuseAddress(boolean reuseAddress) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.SO_REUSEADDR
option.- Specified by:
setReuseAddress
in interfaceSocketChannelConfig
-
setSendBufferSize
public void setSendBufferSize(int sendBufferSize) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.SO_SNDBUF
option.- Specified by:
setSendBufferSize
in interfaceSocketChannelConfig
-
setSoLinger
public void setSoLinger(int soLinger) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.SO_LINGER
option.- Specified by:
setSoLinger
in interfaceSocketChannelConfig
-
setTcpNoDelay
public void setTcpNoDelay(boolean tcpNoDelay) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.TCP_NODELAY
option.- Specified by:
setTcpNoDelay
in interfaceSocketChannelConfig
-
setTrafficClass
public void setTrafficClass(int trafficClass) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.IP_TOS
option.- Specified by:
setTrafficClass
in interfaceSocketChannelConfig
-
getBufferFactory
Description copied from interface:ChannelConfig
Returns the defaultChannelBufferFactory
used to create a newChannelBuffer
. The default isHeapChannelBufferFactory
. You can specify a different factory to change the defaultByteOrder
for example.- Specified by:
getBufferFactory
in interfaceChannelConfig
-
getConnectTimeoutMillis
public int getConnectTimeoutMillis()Description copied from interface:ChannelConfig
Returns the connect timeout of the channel in milliseconds. If theChannel
does not support connect operation, this property is not used at all, and therefore will be ignored.- Specified by:
getConnectTimeoutMillis
in interfaceChannelConfig
- Returns:
- the connect timeout in milliseconds.
0
if disabled.
-
getPipelineFactory
Description copied from interface:ChannelConfig
Returns theChannelPipelineFactory
which will be used when a child channel is created. If theChannel
does not create a child channel, this property is not used at all, and therefore will be ignored.- Specified by:
getPipelineFactory
in interfaceChannelConfig
-
setBufferFactory
Description copied from interface:ChannelConfig
Sets the defaultChannelBufferFactory
used to create a newChannelBuffer
. The default isHeapChannelBufferFactory
. You can specify a different factory to change the defaultByteOrder
for example.- Specified by:
setBufferFactory
in interfaceChannelConfig
-
setConnectTimeoutMillis
public void setConnectTimeoutMillis(int connectTimeoutMillis) Description copied from interface:ChannelConfig
Sets the connect timeout of the channel in milliseconds. If theChannel
does not support connect operation, this property is not used at all, and therefore will be ignored.- Specified by:
setConnectTimeoutMillis
in interfaceChannelConfig
- Parameters:
connectTimeoutMillis
- the connect timeout in milliseconds.0
to disable.
-
setPipelineFactory
Description copied from interface:ChannelConfig
Sets theChannelPipelineFactory
which will be used when a child channel is created. If theChannel
does not create a child channel, this property is not used at all, and therefore will be ignored.- Specified by:
setPipelineFactory
in interfaceChannelConfig
-