org.apache.mina.transport.tcp

## Class ProxyTcpSessionConfig

- java.lang.Object
- - org.apache.mina.transport.tcp.ProxyTcpSessionConfig

- All Implemented Interfaces:
    IoSessionConfig, TcpSessionConfig

      public class ProxyTcpSessionConfig
      extends Object
      implements TcpSessionConfig

  This class proxy the inner java.net.Socket configuration with the SocketSessionConfig of the session.
  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProxyTcpSessionConfig(Socket socket)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getIdleTimeInMillis(IdleStatus status)` Returns idle time for the specified type of idleness in milli-seconds.
    `Integer` | `getReadBufferSize()` Returns the size of the read buffer that I/O processor allocates per each read.
    `Integer` | `getSendBufferSize()`
    `Integer` | `getSoLinger()` Please note that enabling `SO_LINGER` in Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.
    `SSLContext` | `getSslContext()`
    `Integer` | `getTimeout()` Get the SO_TIMEOUT set for this socket
    `int` | `getTrafficClass()`
    `Boolean` | `isKeepAlive()`
    `Boolean` | `isOobInline()`
    `Boolean` | `isReuseAddress()`
    `boolean` | `isSecured()` Tells if the session provides some encryption (SSL/TLS)
    `Boolean` | `isTcpNoDelay()`
    `void` | `setIdleTimeInMillis(IdleStatus status, long ildeTimeInMilli)` Set the delay before an `IoSession` is considered idle for a given operation type (read/write/both) @see IdleStatus
    `void` | `setKeepAlive(boolean keepAlive)`
    `void` | `setOobInline(boolean oobInline)`
    `void` | `setReadBufferSize(int receiveBufferSize)` Sets the size of the read buffer that I/O processor allocates per each read.
    `void` | `setReuseAddress(boolean reuseAddress)`
    `void` | `setSendBufferSize(int sendBufferSize)` Sets the size of the buffer that I/O processor allocates per each write.
    `void` | `setSoLinger(int soLinger)` Please note that enabling `SO_LINGER` in Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.
    `void` | `setSslContext(SSLContext sslContext)`
    `void` | `setTcpNoDelay(boolean tcpNoDelay)`
    `void` | `setTimeout(int timeout)` Sets the SO_TIMEOUT option for this socket
    `void` | `setTrafficClass(int trafficClass)` Set the ToS flag for this session
    `void` | `setTrafficClass(TrafficClassEnum trafficClass)` Set the ToS flag for this session

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

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

- - ### Constructor Detail

    - #### ProxyTcpSessionConfig

          public ProxyTcpSessionConfig(Socket socket)

  - ### Method Detail

    - #### getIdleTimeInMillis

          public long getIdleTimeInMillis(IdleStatus status)

      Returns idle time for the specified type of idleness in milli-seconds.
      Specified by:
        `getIdleTimeInMillis` in interface `IoSessionConfig`
      Returns:
        the idle time in ms or `-1` if no idle time configured for this status
      See Also:
        `IdleStatus`

    - #### setIdleTimeInMillis

          public void setIdleTimeInMillis(IdleStatus status,
                                 long ildeTimeInMilli)

      Set the delay before an `IoSession` is considered idle for a given operation type (read/write/both) @see IdleStatus
      Specified by:
        `setIdleTimeInMillis` in interface `IoSessionConfig`
      Parameters:
        `status` - the type of idle (read/write/both) timeout to set
        `ildeTimeInMilli` - the timeout in milliseconds (`-1` for no idle detection on this status)

    - #### isTcpNoDelay

          public Boolean isTcpNoDelay()

      Specified by:
        `isTcpNoDelay` in interface `TcpSessionConfig`
      See Also:
        `Socket.getTcpNoDelay()`

    - #### setTcpNoDelay

          public void setTcpNoDelay(boolean tcpNoDelay)

      Specified by:
        `setTcpNoDelay` in interface `TcpSessionConfig`
      See Also:
        `Socket.setTcpNoDelay(boolean)`

    - #### isReuseAddress

          public Boolean isReuseAddress()

      Specified by:
        `isReuseAddress` in interface `IoSessionConfig`
      See Also:
        `Socket.getReuseAddress()`

    - #### setReuseAddress

          public void setReuseAddress(boolean reuseAddress)

      Specified by:
        `setReuseAddress` in interface `IoSessionConfig`
      See Also:
        `Socket.setReuseAddress(boolean)`, `return `null` if the default system value is used`

    - #### getReadBufferSize

          public Integer getReadBufferSize()

      Returns the size of the read buffer that I/O processor allocates per each read. It's unusual to adjust this property because it's often adjusted automatically by the I/O processor.
      Specified by:
        `getReadBufferSize` in interface `IoSessionConfig`
      Returns:
        The buffer size, or null if its not set

    - #### setReadBufferSize

          public void setReadBufferSize(int receiveBufferSize)

      Sets the size of the read buffer that I/O processor allocates per each read. It's unusual to adjust this property because it's often adjusted automatically by the I/O processor.
      Specified by:
        `setReadBufferSize` in interface `IoSessionConfig`
      Parameters:
        `receiveBufferSize` - The buffer size used to read data from the socket

    - #### getSendBufferSize

          public Integer getSendBufferSize()

      Specified by:
        `getSendBufferSize` in interface `IoSessionConfig`
      See Also:
        `DatagramSocket.getSendBufferSize()`

    - #### setSendBufferSize

          public void setSendBufferSize(int sendBufferSize)

      Sets the size of the buffer that I/O processor allocates per each write. It's unusual to adjust this property because it's often adjusted automatically by the I/O processor.
      Specified by:
        `setSendBufferSize` in interface `IoSessionConfig`
      Parameters:
        `sendBufferSize` - The buffer size used to send data into the socket

    - #### getTrafficClass

          public int getTrafficClass()

      Specified by:
        `getTrafficClass` in interface `IoSessionConfig`
      Returns:
        The ToS set for this session
      See Also:
        `Socket.getTrafficClass()`

    - #### setTrafficClass

          public void setTrafficClass(int trafficClass)

      Set the ToS flag for this session
      Specified by:
        `setTrafficClass` in interface `IoSessionConfig`
      Parameters:
        `trafficClass` - The ToS to set
      See Also:
        `Socket.setTrafficClass(int)`

    - #### setTrafficClass

          public void setTrafficClass(TrafficClassEnum trafficClass)

      Set the ToS flag for this session
      Specified by:
        `setTrafficClass` in interface `IoSessionConfig`
      Parameters:
        `trafficClass` - The ToS to set
      See Also:
        `Socket.setTrafficClass(int)`

    - #### isKeepAlive

          public Boolean isKeepAlive()

      Specified by:
        `isKeepAlive` in interface `TcpSessionConfig`
      See Also:
        `return `null` if the default system value is used`

    - #### setKeepAlive

          public void setKeepAlive(boolean keepAlive)

      Specified by:
        `setKeepAlive` in interface `TcpSessionConfig`
      See Also:
        `Socket.setKeepAlive(boolean)`

    - #### isOobInline

          public Boolean isOobInline()

      Specified by:
        `isOobInline` in interface `TcpSessionConfig`
      See Also:
        `return `null` if the default system value is used`

    - #### setOobInline

          public void setOobInline(boolean oobInline)

      Specified by:
        `setOobInline` in interface `TcpSessionConfig`
      See Also:
        `Socket.setOOBInline(boolean)`

    - #### getSoLinger

          public Integer getSoLinger()

      Please note that enabling `SO_LINGER` in Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.
      Specified by:
        `getSoLinger` in interface `TcpSessionConfig`
      See Also:
        `Socket.getSoLinger()`, Sun Bug Database return `null` if the default system value is used

    - #### setSoLinger

          public void setSoLinger(int soLinger)

      Please note that enabling `SO_LINGER` in Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.
      Specified by:
        `setSoLinger` in interface `TcpSessionConfig`
      Parameters:
        `soLinger` - Please specify a negative value to disable `SO_LINGER`.
      See Also:
        `Socket.setSoLinger(boolean, int)`, Sun Bug Database

    - #### isSecured

          public boolean isSecured()

      Tells if the session provides some encryption (SSL/TLS)
      Specified by:
        `isSecured` in interface `TcpSessionConfig`
      Returns:
        `true` if the session is secured

    - #### getSslContext

          public SSLContext getSslContext()

      Specified by:
        `getSslContext` in interface `TcpSessionConfig`
      Returns:
        The `SSLContext` instance stored in the configuration.

    - #### setSslContext

          public void setSslContext(SSLContext sslContext)

      Specified by:
        `setSslContext` in interface `TcpSessionConfig`

    - #### getTimeout

          public Integer getTimeout()

      Get the SO_TIMEOUT set for this socket
      Specified by:
        `getTimeout` in interface `IoSessionConfig`
      Returns:
        The Timeout, in milliseconds. 0 means infinite.
      See Also:
        `Socket.getSoTimeout()`, `DatagramSocket.getSoTimeout()`

    - #### setTimeout

          public void setTimeout(int timeout)

      Sets the SO_TIMEOUT option for this socket
      Specified by:
        `setTimeout` in interface `IoSessionConfig`
      Parameters:
        `timeout` - The timeout to set, in milliseconds. 0 means infinite
      See Also:
        `Socket.setSoTimeout(int)`, `DatagramSocket.setSoTimeout(int)`

Copyright © 2009–2013 Apache MINA Project. All rights reserved.