StreamInbound (Apache Tomcat 7.0.81 API Documentation)

org.apache.catalina.websocket

## Class StreamInbound

- java.lang.Object
- - org.apache.catalina.websocket.StreamInbound

- All Implemented Interfaces:
    UpgradeInbound
  Direct Known Subclasses:
    MessageInbound

  Deprecated.
  Replaced by the JSR356 WebSocket 1.1 implementation and will be removed in Tomcat 8.0.x.

      @Deprecated
      public abstract class StreamInbound
      extends Object
      implements UpgradeInbound

  Base implementation of the class used to process WebSocket connections based on streams. Applications should extend this class to provide application specific functionality. Applications that wish to operate on a message basis rather than a stream basis should use `MessageInbound`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StreamInbound()` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getOutboundByteBufferSize()` Deprecated.
    `int` | `getOutboundCharBufferSize()` Deprecated.
    `int` | `getReadTimeout()` Deprecated. This default implementation sets the read timeout to infinite and expects the WebSocket application to close the connection when it is no longer required.
    `WsOutbound` | `getWsOutbound()` Deprecated. Obtain the outbound side of this WebSocket connection used for writing data to the client.
    `protected abstract void` | `onBinaryData(InputStream is)` Deprecated. This method is called when there is a binary WebSocket message available to process.
    `protected void` | `onClose(int status)` Deprecated. Intended to be overridden by sub-classes that wish to be notified when the outbound connection is closed.
    `AbstractEndpoint.Handler.SocketState` | `onData()` Deprecated.
    `protected void` | `onOpen(WsOutbound outbound)` Deprecated. Intended to be overridden by sub-classes that wish to be notified when the outbound connection is established.
    `protected void` | `onPong(ByteBuffer payload)` Deprecated. Intended to be overridden by sub-classes that wish to be notified when a pong is received.
    `protected abstract void` | `onTextData(Reader r)` Deprecated. This method is called when there is a textual WebSocket message available to process.
    `void` | `onUpgradeComplete()` Deprecated.
    `void` | `setOutboundByteBufferSize(int outboundByteBufferSize)` Deprecated. This only applies to the `WsOutbound` instance returned from `getWsOutbound()` created by a subsequent call to `setUpgradeOutbound(UpgradeOutbound)`.
    `void` | `setOutboundCharBufferSize(int outboundCharBufferSize)` Deprecated. This only applies to the `WsOutbound` instance returned from `getWsOutbound()` created by a subsequent call to `setUpgradeOutbound(UpgradeOutbound)`.
    `void` | `setUpgradeOutbound(UpgradeOutbound upgradeOutbound)` Deprecated.
    `void` | `setUpgradeProcessor(UpgradeProcessor<?> processor)` Deprecated.

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

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

- - ### Constructor Detail

    - #### StreamInbound

          public StreamInbound()

      Deprecated.

  - ### Method Detail

    - #### getOutboundByteBufferSize

          public int getOutboundByteBufferSize()

      Deprecated.

    - #### setOutboundByteBufferSize

          public void setOutboundByteBufferSize(int outboundByteBufferSize)

      Deprecated.
      This only applies to the `WsOutbound` instance returned from `getWsOutbound()` created by a subsequent call to `setUpgradeOutbound(UpgradeOutbound)`. The current `WsOutbound` instance, if any, is not affected.
      Parameters:
        `outboundByteBufferSize` -

    - #### getOutboundCharBufferSize

          public int getOutboundCharBufferSize()

      Deprecated.

    - #### setOutboundCharBufferSize

          public void setOutboundCharBufferSize(int outboundCharBufferSize)

      Deprecated.
      This only applies to the `WsOutbound` instance returned from `getWsOutbound()` created by a subsequent call to `setUpgradeOutbound(UpgradeOutbound)`. The current `WsOutbound` instance, if any, is not affected.
      Parameters:
        `outboundCharBufferSize` -

    - #### setUpgradeOutbound

          public final void setUpgradeOutbound(UpgradeOutbound upgradeOutbound)

      Deprecated.
      Specified by:
        `setUpgradeOutbound` in interface `UpgradeInbound`

    - #### setUpgradeProcessor

          public final void setUpgradeProcessor(UpgradeProcessor<?> processor)

      Deprecated.
      Specified by:
        `setUpgradeProcessor` in interface `UpgradeInbound`

    - #### getWsOutbound

          public final WsOutbound getWsOutbound()

      Deprecated.
      Obtain the outbound side of this WebSocket connection used for writing data to the client.

    - #### onData

          public final AbstractEndpoint.Handler.SocketState onData()
                                                            throws IOException

      Deprecated.
      Specified by:
        `onData` in interface `UpgradeInbound`
      Throws:
        `IOException`

    - #### onUpgradeComplete

          public final void onUpgradeComplete()

      Deprecated.
      Specified by:
        `onUpgradeComplete` in interface `UpgradeInbound`

    - #### onOpen

          protected void onOpen(WsOutbound outbound)

      Deprecated.
      Intended to be overridden by sub-classes that wish to be notified when the outbound connection is established. The default implementation is a NO-OP.
      Parameters:
        `outbound` - The outbound WebSocket connection.

    - #### onClose

          protected void onClose(int status)

      Deprecated.
      Intended to be overridden by sub-classes that wish to be notified when the outbound connection is closed. The default implementation is a NO-OP.
      Parameters:
        `status` - The status code of the close reason.

    - #### onPong

          protected void onPong(ByteBuffer payload)

      Deprecated.
      Intended to be overridden by sub-classes that wish to be notified when a pong is received. The default implementation is a NO-OP.
      Parameters:
        `payload` - The payload included in the pong.

    - #### onBinaryData

          protected abstract void onBinaryData(InputStream is)
                                        throws IOException

      Deprecated.
      This method is called when there is a binary WebSocket message available to process. The message is presented via a stream and may be formed from one or more frames. The number of frames used to transmit the message is not made visible to the application.
      Parameters:
        `is` - The WebSocket message
      Throws:
        `IOException` - If a problem occurs processing the message. Any exception will trigger the closing of the WebSocket connection.

    - #### onTextData

          protected abstract void onTextData(Reader r)
                                      throws IOException

      Deprecated.
      This method is called when there is a textual WebSocket message available to process. The message is presented via a reader and may be formed from one or more frames. The number of frames used to transmit the message is not made visible to the application.
      Parameters:
        `r` - The WebSocket message
      Throws:
        `IOException` - If a problem occurs processing the message. Any exception will trigger the closing of the WebSocket connection.

    - #### getReadTimeout

          public int getReadTimeout()

      Deprecated.
      This default implementation sets the read timeout to infinite and expects the WebSocket application to close the connection when it is no longer required. Applications wishing to set an explicit timeout may override this method and return a value of their choice.
      Specified by:
        `getReadTimeout` in interface `UpgradeInbound`
      Returns:
        The read timeout in milliseconds or -1 for infinite

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.