Class HttpTunnelingSocketChannelConfig
- java.lang.Object
-
- org.jboss.netty.channel.socket.http.HttpTunnelingSocketChannelConfig
-
- All Implemented Interfaces:
ChannelConfig,SocketChannelConfig
public final class HttpTunnelingSocketChannelConfig extends java.lang.Object implements SocketChannelConfig
TheChannelConfigof a client-side HTTP tunnelingSocketChannel. ASocketChannelcreated byHttpTunnelingClientSocketChannelFactorywill return an instance of this configuration type forSocketChannel.getConfig().Available options
In addition to the options provided bySocketChannelConfig,HttpTunnelingSocketChannelConfigallows 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
Fields Modifier and Type Field Description private HttpTunnelingClientSocketChannelchannelprivate java.lang.String[]enabledSslCipherSuitesprivate java.lang.String[]enabledSslProtocolsprivate booleanenableSslSessionCreationprivate java.lang.StringserverNameprivate java.lang.StringserverPathprivate javax.net.ssl.SSLContextsslContext
-
Constructor Summary
Constructors Constructor Description HttpTunnelingSocketChannelConfig(HttpTunnelingClientSocketChannel channel)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChannelBufferFactorygetBufferFactory()Returns the defaultChannelBufferFactoryused to create a newChannelBuffer.intgetConnectTimeoutMillis()Returns the connect timeout of the channel in milliseconds.java.lang.String[]getEnabledSslCipherSuites()Returns the cipher suites enabled for use on anSSLEngine.java.lang.String[]getEnabledSslProtocols()Returns the protocol versions enabled for use on anSSLEngine.ChannelPipelineFactorygetPipelineFactory()Returns theChannelPipelineFactorywhich will be used when a child channel is created.intgetReceiveBufferSize()Gets theStandardSocketOptions.SO_RCVBUFoption.intgetSendBufferSize()Gets theStandardSocketOptions.SO_SNDBUFoption.java.lang.StringgetServerName()Returns the host name of the HTTP server.java.lang.StringgetServerPath()Returns the path where theHttpTunnelingServletis mapped to.intgetSoLinger()Gets theStandardSocketOptions.SO_LINGERoption.javax.net.ssl.SSLContextgetSslContext()Returns theSSLContextwhich is used to establish an HTTPS connection.intgetTrafficClass()Gets theStandardSocketOptions.IP_TOSoption.booleanisEnableSslSessionCreation()Returnstrueif newSSLSessions may be established by anSSLEngine.booleanisKeepAlive()Gets theStandardSocketOptions.SO_KEEPALIVEoption.booleanisReuseAddress()Gets theStandardSocketOptions.SO_REUSEADDRoption.booleanisTcpNoDelay()Gets theStandardSocketOptions.TCP_NODELAYoption.voidsetBufferFactory(ChannelBufferFactory bufferFactory)Sets the defaultChannelBufferFactoryused to create a newChannelBuffer.voidsetConnectTimeoutMillis(int connectTimeoutMillis)Sets the connect timeout of the channel in milliseconds.voidsetEnabledSslCipherSuites(java.lang.String[] suites)Sets the cipher suites enabled for use on anSSLEngine.voidsetEnabledSslProtocols(java.lang.String[] protocols)Sets the protocol versions enabled for use on anSSLEngine.voidsetEnableSslSessionCreation(boolean flag)Sets whether newSSLSessions may be established by anSSLEngine.voidsetKeepAlive(boolean keepAlive)Sets theStandardSocketOptions.SO_KEEPALIVEoption.booleansetOption(java.lang.String key, java.lang.Object value)Sets a configuration property with the specified name and value.voidsetOptions(java.util.Map<java.lang.String,java.lang.Object> options)Sets the configuration properties from the specifiedMap.voidsetPerformancePreferences(int connectionTime, int latency, int bandwidth)Sets the performance preferences as specified inSocket.setPerformancePreferences(int, int, int).voidsetPipelineFactory(ChannelPipelineFactory pipelineFactory)Sets theChannelPipelineFactorywhich will be used when a child channel is created.voidsetReceiveBufferSize(int receiveBufferSize)Sets theStandardSocketOptions.SO_RCVBUFoption.voidsetReuseAddress(boolean reuseAddress)Sets theStandardSocketOptions.SO_REUSEADDRoption.voidsetSendBufferSize(int sendBufferSize)Sets theStandardSocketOptions.SO_SNDBUFoption.voidsetServerName(java.lang.String serverName)Sets the host name of the HTTP server.voidsetServerPath(java.lang.String serverPath)Sets the path where theHttpTunnelingServletis mapped to.voidsetSoLinger(int soLinger)Sets theStandardSocketOptions.SO_LINGERoption.voidsetSslContext(javax.net.ssl.SSLContext sslContext)Sets theSSLContextwhich is used to establish an HTTPS connection.voidsetTcpNoDelay(boolean tcpNoDelay)Sets theStandardSocketOptions.TCP_NODELAYoption.voidsetTrafficClass(int trafficClass)Sets theStandardSocketOptions.IP_TOSoption.
-
-
-
Field Detail
-
channel
private final HttpTunnelingClientSocketChannel channel
-
serverName
private volatile java.lang.String serverName
-
serverPath
private volatile java.lang.String serverPath
-
sslContext
private volatile javax.net.ssl.SSLContext sslContext
-
enabledSslCipherSuites
private volatile java.lang.String[] enabledSslCipherSuites
-
enabledSslProtocols
private volatile java.lang.String[] enabledSslProtocols
-
enableSslSessionCreation
private volatile boolean enableSslSessionCreation
-
-
Constructor Detail
-
HttpTunnelingSocketChannelConfig
HttpTunnelingSocketChannelConfig(HttpTunnelingClientSocketChannel channel)
Creates a new instance.
-
-
Method Detail
-
getServerName
public java.lang.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(java.lang.String serverName)
Sets the host name of the HTTP server. Ifnull, the"Host"header is not sent by the HTTP tunneling client.
-
getServerPath
public java.lang.String getServerPath()
Returns the path where theHttpTunnelingServletis mapped to. The default value is"/netty-tunnel".
-
setServerPath
public void setServerPath(java.lang.String serverPath)
Sets the path where theHttpTunnelingServletis mapped to. The default value is"/netty-tunnel".
-
getSslContext
public javax.net.ssl.SSLContext getSslContext()
Returns theSSLContextwhich is used to establish an HTTPS connection. Ifnull, a plain-text HTTP connection is established.
-
setSslContext
public void setSslContext(javax.net.ssl.SSLContext sslContext)
Sets theSSLContextwhich is used to establish an HTTPS connection. Ifnull, a plain-text HTTP connection is established.
-
getEnabledSslCipherSuites
public java.lang.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(java.lang.String[] suites)
Sets the cipher suites enabled for use on anSSLEngine. Ifnull, the default value will be used.- See Also:
SSLEngine.setEnabledCipherSuites(String[])
-
getEnabledSslProtocols
public java.lang.String[] getEnabledSslProtocols()
Returns the protocol versions enabled for use on anSSLEngine.- See Also:
SSLEngine.getEnabledProtocols()
-
setEnabledSslProtocols
public void setEnabledSslProtocols(java.lang.String[] protocols)
Sets the protocol versions enabled for use on anSSLEngine.- See Also:
SSLEngine.setEnabledProtocols(String[])
-
isEnableSslSessionCreation
public boolean isEnableSslSessionCreation()
Returnstrueif newSSLSessions may be established by anSSLEngine.- See Also:
SSLEngine.getEnableSessionCreation()
-
setEnableSslSessionCreation
public void setEnableSslSessionCreation(boolean flag)
Sets whether newSSLSessions may be established by anSSLEngine.- See Also:
SSLEngine.setEnableSessionCreation(boolean)
-
setOptions
public void setOptions(java.util.Map<java.lang.String,java.lang.Object> options)
Description copied from interface:ChannelConfigSets the configuration properties from the specifiedMap.- Specified by:
setOptionsin interfaceChannelConfig
-
setOption
public boolean setOption(java.lang.String key, java.lang.Object value)Description copied from interface:ChannelConfigSets 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:
setOptionin interfaceChannelConfig- Returns:
trueif and only if the property has been set
-
getReceiveBufferSize
public int getReceiveBufferSize()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.SO_RCVBUFoption.- Specified by:
getReceiveBufferSizein interfaceSocketChannelConfig
-
getSendBufferSize
public int getSendBufferSize()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.SO_SNDBUFoption.- Specified by:
getSendBufferSizein interfaceSocketChannelConfig
-
getSoLinger
public int getSoLinger()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.SO_LINGERoption.- Specified by:
getSoLingerin interfaceSocketChannelConfig
-
getTrafficClass
public int getTrafficClass()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.IP_TOSoption.- Specified by:
getTrafficClassin interfaceSocketChannelConfig
-
isKeepAlive
public boolean isKeepAlive()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.SO_KEEPALIVEoption.- Specified by:
isKeepAlivein interfaceSocketChannelConfig
-
isReuseAddress
public boolean isReuseAddress()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.SO_REUSEADDRoption.- Specified by:
isReuseAddressin interfaceSocketChannelConfig
-
isTcpNoDelay
public boolean isTcpNoDelay()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.TCP_NODELAYoption.- Specified by:
isTcpNoDelayin interfaceSocketChannelConfig
-
setKeepAlive
public void setKeepAlive(boolean keepAlive)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.SO_KEEPALIVEoption.- Specified by:
setKeepAlivein interfaceSocketChannelConfig
-
setPerformancePreferences
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth)Description copied from interface:SocketChannelConfigSets the performance preferences as specified inSocket.setPerformancePreferences(int, int, int).- Specified by:
setPerformancePreferencesin interfaceSocketChannelConfig
-
setReceiveBufferSize
public void setReceiveBufferSize(int receiveBufferSize)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.SO_RCVBUFoption.- Specified by:
setReceiveBufferSizein interfaceSocketChannelConfig
-
setReuseAddress
public void setReuseAddress(boolean reuseAddress)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.SO_REUSEADDRoption.- Specified by:
setReuseAddressin interfaceSocketChannelConfig
-
setSendBufferSize
public void setSendBufferSize(int sendBufferSize)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.SO_SNDBUFoption.- Specified by:
setSendBufferSizein interfaceSocketChannelConfig
-
setSoLinger
public void setSoLinger(int soLinger)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.SO_LINGERoption.- Specified by:
setSoLingerin interfaceSocketChannelConfig
-
setTcpNoDelay
public void setTcpNoDelay(boolean tcpNoDelay)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.TCP_NODELAYoption.- Specified by:
setTcpNoDelayin interfaceSocketChannelConfig
-
setTrafficClass
public void setTrafficClass(int trafficClass)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.IP_TOSoption.- Specified by:
setTrafficClassin interfaceSocketChannelConfig
-
getBufferFactory
public ChannelBufferFactory getBufferFactory()
Description copied from interface:ChannelConfigReturns the defaultChannelBufferFactoryused to create a newChannelBuffer. The default isHeapChannelBufferFactory. You can specify a different factory to change the defaultByteOrderfor example.- Specified by:
getBufferFactoryin interfaceChannelConfig
-
getConnectTimeoutMillis
public int getConnectTimeoutMillis()
Description copied from interface:ChannelConfigReturns the connect timeout of the channel in milliseconds. If theChanneldoes not support connect operation, this property is not used at all, and therefore will be ignored.- Specified by:
getConnectTimeoutMillisin interfaceChannelConfig- Returns:
- the connect timeout in milliseconds.
0if disabled.
-
getPipelineFactory
public ChannelPipelineFactory getPipelineFactory()
Description copied from interface:ChannelConfigReturns theChannelPipelineFactorywhich will be used when a child channel is created. If theChanneldoes not create a child channel, this property is not used at all, and therefore will be ignored.- Specified by:
getPipelineFactoryin interfaceChannelConfig
-
setBufferFactory
public void setBufferFactory(ChannelBufferFactory bufferFactory)
Description copied from interface:ChannelConfigSets the defaultChannelBufferFactoryused to create a newChannelBuffer. The default isHeapChannelBufferFactory. You can specify a different factory to change the defaultByteOrderfor example.- Specified by:
setBufferFactoryin interfaceChannelConfig
-
setConnectTimeoutMillis
public void setConnectTimeoutMillis(int connectTimeoutMillis)
Description copied from interface:ChannelConfigSets the connect timeout of the channel in milliseconds. If theChanneldoes not support connect operation, this property is not used at all, and therefore will be ignored.- Specified by:
setConnectTimeoutMillisin interfaceChannelConfig- Parameters:
connectTimeoutMillis- the connect timeout in milliseconds.0to disable.
-
setPipelineFactory
public void setPipelineFactory(ChannelPipelineFactory pipelineFactory)
Description copied from interface:ChannelConfigSets theChannelPipelineFactorywhich will be used when a child channel is created. If theChanneldoes not create a child channel, this property is not used at all, and therefore will be ignored.- Specified by:
setPipelineFactoryin interfaceChannelConfig
-
-