org.apache.mina.session

## Class AbstractIoSessionConfig

- java.lang.Object
- - org.apache.mina.session.AbstractIoSessionConfig

- All Implemented Interfaces:
    IoSessionConfig
  Direct Known Subclasses:
    DefaultTcpSessionConfig, DefaultUdpSessionConfig

      public abstract class AbstractIoSessionConfig
      extends Object
      implements IoSessionConfig

  Base class for session configuration. Implements session configuration properties commons to all the different transports.
  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractIoSessionConfig()`

  - ### 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` | `getTimeout()` Get the SO_TIMEOUT set for this socket
    `int` | `getTrafficClass()`
    `Boolean` | `isReuseAddress()`
    `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` | `setReadBufferSize(int readBufferSize)` 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` | `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

    - #### AbstractIoSessionConfig

          public AbstractIoSessionConfig()

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

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

      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:
        `readBufferSize` - 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(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)`

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

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

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