Class HttpTunnelingSocketChannelConfig
- java.lang.Object
-
- org.jboss.netty.channel.socket.http.HttpTunnelingSocketChannelConfig
-
- All Implemented Interfaces:
ChannelConfig
,SocketChannelConfig
public final class HttpTunnelingSocketChannelConfig extends Object implements SocketChannelConfig
TheChannelConfig
of a client-side HTTP tunnelingSocketChannel
. ASocketChannel
created byHttpTunnelingClientSocketChannelFactory
will return an instance of this configuration type forSocketChannel.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)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChannelBufferFactory
getBufferFactory()
Returns the defaultChannelBufferFactory
used to create a newChannelBuffer
.int
getConnectTimeoutMillis()
Returns the connect timeout of the channel in milliseconds.String[]
getEnabledSslCipherSuites()
Returns the cipher suites enabled for use on anSSLEngine
.String[]
getEnabledSslProtocols()
Returns the protocol versions enabled for use on anSSLEngine
.ChannelPipelineFactory
getPipelineFactory()
Returns theChannelPipelineFactory
which will be used when a child channel is created.int
getReceiveBufferSize()
Gets theStandardSocketOptions.SO_RCVBUF
option.int
getSendBufferSize()
Gets theStandardSocketOptions.SO_SNDBUF
option.String
getServerName()
Returns the host name of the HTTP server.String
getServerPath()
Returns the path where theHttpTunnelingServlet
is mapped to.int
getSoLinger()
Gets theStandardSocketOptions.SO_LINGER
option.SSLContext
getSslContext()
Returns theSSLContext
which is used to establish an HTTPS connection.int
getTrafficClass()
Gets theStandardSocketOptions.IP_TOS
option.boolean
isEnableSslSessionCreation()
boolean
isKeepAlive()
Gets theStandardSocketOptions.SO_KEEPALIVE
option.boolean
isReuseAddress()
Gets theStandardSocketOptions.SO_REUSEADDR
option.boolean
isTcpNoDelay()
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
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 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.
-
-
-
Method Detail
-
getServerName
public String getServerName()
Returns the host name of the HTTP server. Ifnull
, the"Host"
header is not sent by the HTTP tunneling client.
-
setServerName
public void setServerName(String serverName)
Sets the host name of the HTTP server. Ifnull
, the"Host"
header is not sent by the HTTP tunneling client.
-
getServerPath
public String getServerPath()
Returns the path where theHttpTunnelingServlet
is mapped to. The default value is"/netty-tunnel"
.
-
setServerPath
public void setServerPath(String serverPath)
Sets the path where theHttpTunnelingServlet
is mapped to. The default value is"/netty-tunnel"
.
-
getSslContext
public SSLContext getSslContext()
Returns theSSLContext
which is used to establish an HTTPS connection. Ifnull
, a plain-text HTTP connection is established.
-
setSslContext
public void setSslContext(SSLContext sslContext)
Sets theSSLContext
which is used to establish an HTTPS connection. Ifnull
, a plain-text HTTP connection is established.
-
getEnabledSslCipherSuites
public String[] getEnabledSslCipherSuites()
Returns the cipher suites enabled for use on anSSLEngine
. Ifnull
, the default value will be used.- See Also:
SSLEngine.getEnabledCipherSuites()
-
setEnabledSslCipherSuites
public void setEnabledSslCipherSuites(String[] suites)
Sets the cipher suites enabled for use on anSSLEngine
. Ifnull
, the default value will be used.
-
getEnabledSslProtocols
public String[] getEnabledSslProtocols()
Returns the protocol versions enabled for use on anSSLEngine
.- See Also:
SSLEngine.getEnabledProtocols()
-
setEnabledSslProtocols
public void setEnabledSslProtocols(String[] protocols)
Sets the protocol versions enabled for use on anSSLEngine
.- See Also:
SSLEngine.setEnabledProtocols(String[])
-
isEnableSslSessionCreation
public boolean isEnableSslSessionCreation()
- See Also:
SSLEngine.getEnableSessionCreation()
-
setEnableSslSessionCreation
public void setEnableSslSessionCreation(boolean flag)
Sets whether newSSLSession
s may be established by anSSLEngine
.
-
setOptions
public void setOptions(Map<String,Object> options)
Description copied from interface:ChannelConfig
Sets the configuration properties from the specifiedMap
.- Specified by:
setOptions
in interfaceChannelConfig
-
setOption
public boolean setOption(String key, Object value)
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
public ChannelBufferFactory 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
public ChannelPipelineFactory 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
public void setBufferFactory(ChannelBufferFactory bufferFactory)
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
public void setPipelineFactory(ChannelPipelineFactory pipelineFactory)
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
-
-