org.jboss.netty.channel.socket.http

## 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

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 by `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)`

### Method Summary

Methods
`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()` 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(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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getServerName

    public String getServerName()

Returns the host name of the HTTP server. If `null`, 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. If `null`, the `"Host"` header is not sent by the HTTP tunneling client.

#### getServerPath

    public String getServerPath()

Returns the path where the `HttpTunnelingServlet` is mapped to. The default value is `"/netty-tunnel"`.

#### setServerPath

    public void setServerPath(String serverPath)

Sets the path where the `HttpTunnelingServlet` is mapped to. The default value is `"/netty-tunnel"`.

#### getSslContext

    public SSLContext getSslContext()

Returns the `SSLContext` which is used to establish an HTTPS connection. If `null`, a plain-text HTTP connection is established.

#### setSslContext

    public void setSslContext(SSLContext sslContext)

Sets the `SSLContext` which is used to establish an HTTPS connection. If `null`, a plain-text HTTP connection is established.

#### getEnabledSslCipherSuites

    public String[] getEnabledSslCipherSuites()

Returns the cipher suites enabled for use on an `SSLEngine`. If `null`, the default value will be used.

See Also:
  `SSLEngine.getEnabledCipherSuites()`

#### setEnabledSslCipherSuites

    public void setEnabledSslCipherSuites(String[] suites)

Sets the cipher suites enabled for use on an `SSLEngine`. If `null`, the default value will be used.

See Also:
  `SSLEngine.setEnabledCipherSuites(String[])`

#### getEnabledSslProtocols

    public String[] getEnabledSslProtocols()

Returns the protocol versions enabled for use on an `SSLEngine`.

See Also:
  `SSLEngine.getEnabledProtocols()`

#### setEnabledSslProtocols

    public void setEnabledSslProtocols(String[] protocols)

Sets the protocol versions enabled for use on an `SSLEngine`.

See Also:
  `SSLEngine.setEnabledProtocols(String[])`

#### isEnableSslSessionCreation

    public boolean isEnableSslSessionCreation()

Returns `true` if new `SSLSession`s may be established by an `SSLEngine`.

See Also:
  `SSLEngine.getEnableSessionCreation()`

#### setEnableSslSessionCreation

    public void setEnableSslSessionCreation(boolean flag)

Sets whether new `SSLSession`s may be established by an `SSLEngine`.

See Also:
  `SSLEngine.setEnableSessionCreation(boolean)`

#### setOptions

    public void setOptions(Map<String,Object> options)

Description copied from interface: `ChannelConfig`
Sets the configuration properties from the specified `Map`.

Specified by:
  `setOptions` in interface `ChannelConfig`

#### 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 interface `ChannelConfig`
Returns:
  `true` if and only if the property has been set

#### getReceiveBufferSize

    public int getReceiveBufferSize()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.SO_RCVBUF` option.

Specified by:
  `getReceiveBufferSize` in interface `SocketChannelConfig`

#### getSendBufferSize

    public int getSendBufferSize()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.SO_SNDBUF` option.

Specified by:
  `getSendBufferSize` in interface `SocketChannelConfig`

#### getSoLinger

    public int getSoLinger()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.SO_LINGER` option.

Specified by:
  `getSoLinger` in interface `SocketChannelConfig`

#### getTrafficClass

    public int getTrafficClass()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.IP_TOS` option.

Specified by:
  `getTrafficClass` in interface `SocketChannelConfig`

#### isKeepAlive

    public boolean isKeepAlive()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.SO_KEEPALIVE` option.

Specified by:
  `isKeepAlive` in interface `SocketChannelConfig`

#### isReuseAddress

    public boolean isReuseAddress()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.SO_REUSEADDR` option.

Specified by:
  `isReuseAddress` in interface `SocketChannelConfig`

#### isTcpNoDelay

    public boolean isTcpNoDelay()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.TCP_NODELAY` option.

Specified by:
  `isTcpNoDelay` in interface `SocketChannelConfig`

#### setKeepAlive

    public void setKeepAlive(boolean keepAlive)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.SO_KEEPALIVE` option.

Specified by:
  `setKeepAlive` in interface `SocketChannelConfig`

#### setPerformancePreferences

    public void setPerformancePreferences(int connectionTime,
                                 int latency,
                                 int bandwidth)

Description copied from interface: `SocketChannelConfig`
Sets the performance preferences as specified in `Socket.setPerformancePreferences(int, int, int)`.

Specified by:
  `setPerformancePreferences` in interface `SocketChannelConfig`

#### setReceiveBufferSize

    public void setReceiveBufferSize(int receiveBufferSize)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.SO_RCVBUF` option.

Specified by:
  `setReceiveBufferSize` in interface `SocketChannelConfig`

#### setReuseAddress

    public void setReuseAddress(boolean reuseAddress)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.SO_REUSEADDR` option.

Specified by:
  `setReuseAddress` in interface `SocketChannelConfig`

#### setSendBufferSize

    public void setSendBufferSize(int sendBufferSize)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.SO_SNDBUF` option.

Specified by:
  `setSendBufferSize` in interface `SocketChannelConfig`

#### setSoLinger

    public void setSoLinger(int soLinger)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.SO_LINGER` option.

Specified by:
  `setSoLinger` in interface `SocketChannelConfig`

#### setTcpNoDelay

    public void setTcpNoDelay(boolean tcpNoDelay)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.TCP_NODELAY` option.

Specified by:
  `setTcpNoDelay` in interface `SocketChannelConfig`

#### setTrafficClass

    public void setTrafficClass(int trafficClass)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.IP_TOS` option.

Specified by:
  `setTrafficClass` in interface `SocketChannelConfig`

#### getBufferFactory

    public ChannelBufferFactory getBufferFactory()

Description copied from interface: `ChannelConfig`
Returns the default `ChannelBufferFactory` used to create a new `ChannelBuffer`. The default is `HeapChannelBufferFactory`. You can specify a different factory to change the default `ByteOrder` for example.

Specified by:
  `getBufferFactory` in interface `ChannelConfig`

#### getConnectTimeoutMillis

    public int getConnectTimeoutMillis()

Description copied from interface: `ChannelConfig`
Returns the connect timeout of the channel in milliseconds. If the `Channel` does not support connect operation, this property is not used at all, and therefore will be ignored.

Specified by:
  `getConnectTimeoutMillis` in interface `ChannelConfig`
Returns:
  the connect timeout in milliseconds. `0` if disabled.

#### getPipelineFactory

    public ChannelPipelineFactory getPipelineFactory()

Description copied from interface: `ChannelConfig`
Returns the `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.

Specified by:
  `getPipelineFactory` in interface `ChannelConfig`

#### setBufferFactory

    public void setBufferFactory(ChannelBufferFactory bufferFactory)

Description copied from interface: `ChannelConfig`
Sets the default `ChannelBufferFactory` used to create a new `ChannelBuffer`. The default is `HeapChannelBufferFactory`. You can specify a different factory to change the default `ByteOrder` for example.

Specified by:
  `setBufferFactory` in interface `ChannelConfig`

#### setConnectTimeoutMillis

    public void setConnectTimeoutMillis(int connectTimeoutMillis)

Description copied from interface: `ChannelConfig`
Sets the connect timeout of the channel in milliseconds. If the `Channel` does not support connect operation, this property is not used at all, and therefore will be ignored.

Specified by:
  `setConnectTimeoutMillis` in interface `ChannelConfig`
Parameters:
  `connectTimeoutMillis` - the connect timeout in milliseconds. `0` to disable.

#### setPipelineFactory

    public void setPipelineFactory(ChannelPipelineFactory pipelineFactory)

Description copied from interface: `ChannelConfig`
Sets the `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.

Specified by:
  `setPipelineFactory` in interface `ChannelConfig`