Interface WebSocketPolicy

  • All Known Subinterfaces:
    Session

    public interface WebSocketPolicy
    Settings for WebSocket operations.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      WebSocketBehavior getBehavior()  
      java.time.Duration getIdleTimeout()
      The duration that a websocket may be idle before being closed by the implementation
      int getInputBufferSize()
      The input (read from network layer) buffer size.
      long getMaxBinaryMessageSize()
      Get the maximum size of a binary message during parsing.
      long getMaxFrameSize()
      The maximum payload size of any WebSocket Frame which can be received.
      long getMaxTextMessageSize()
      Get the maximum size of a text message during parsing.
      int getOutputBufferSize()
      The output (write to network layer) buffer size.
      boolean isAutoFragment()
      If true, frames are automatically fragmented to respect the maximum frame size.
      void setAutoFragment​(boolean autoFragment)
      If set to true, frames are automatically fragmented to respect the maximum frame size.
      void setIdleTimeout​(java.time.Duration duration)
      The duration that a websocket may be idle before being closed by the implementation
      void setInputBufferSize​(int size)
      The input (read from network layer) buffer size.
      void setMaxBinaryMessageSize​(long size)
      The maximum size of a binary message during parsing/generating.
      void setMaxFrameSize​(long maxFrameSize)
      The maximum payload size of any WebSocket Frame which can be received.
      void setMaxTextMessageSize​(long size)
      The maximum size of a text message during parsing/generating.
      void setOutputBufferSize​(int size)
      The output (write to network layer) buffer size.
    • Method Detail

      • getIdleTimeout

        java.time.Duration getIdleTimeout()
        The duration that a websocket may be idle before being closed by the implementation
        Returns:
        the timeout duration
      • getInputBufferSize

        int getInputBufferSize()
        The input (read from network layer) buffer size.

        This is the raw read operation buffer size, before the parsing of the websocket frames.

        Returns:
        the raw network buffer input size.
      • getOutputBufferSize

        int getOutputBufferSize()
        The output (write to network layer) buffer size.

        This is the raw write operation buffer size and has no relationship to the websocket frame.

        Returns:
        the raw network buffer output size.
      • getMaxBinaryMessageSize

        long getMaxBinaryMessageSize()
        Get the maximum size of a binary message during parsing.

        This is a memory conservation option, memory over this limit will not be allocated by Jetty for handling binary messages. This applies to individual frames, whole message handling, and partial message handling.

        Binary messages over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE

        Returns:
        the maximum size of a binary message
      • getMaxTextMessageSize

        long getMaxTextMessageSize()
        Get the maximum size of a text message during parsing.

        This is a memory conservation option, memory over this limit will not be allocated by Jetty for handling text messages. This applies to individual frames, whole message handling, and partial message handling.

        Text messages over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE

        Returns:
        the maximum size of a text message.
      • getMaxFrameSize

        long getMaxFrameSize()
        The maximum payload size of any WebSocket Frame which can be received.
        Returns:
        the maximum size of a WebSocket Frame.
      • isAutoFragment

        boolean isAutoFragment()
        If true, frames are automatically fragmented to respect the maximum frame size.
        Returns:
        whether to automatically fragment incoming WebSocket Frames.
      • setIdleTimeout

        void setIdleTimeout​(java.time.Duration duration)
        The duration that a websocket may be idle before being closed by the implementation
        Parameters:
        duration - the timeout duration (may not be null or negative)
      • setInputBufferSize

        void setInputBufferSize​(int size)
        The input (read from network layer) buffer size.
        Parameters:
        size - the size in bytes
      • setOutputBufferSize

        void setOutputBufferSize​(int size)
        The output (write to network layer) buffer size.
        Parameters:
        size - the size in bytes
      • setMaxBinaryMessageSize

        void setMaxBinaryMessageSize​(long size)
        The maximum size of a binary message during parsing/generating.

        Binary messages over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE

        Parameters:
        size - the maximum allowed size of a binary message.
      • setMaxTextMessageSize

        void setMaxTextMessageSize​(long size)
        The maximum size of a text message during parsing/generating.

        Text messages over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE

        Parameters:
        size - the maximum allowed size of a text message.
      • setMaxFrameSize

        void setMaxFrameSize​(long maxFrameSize)
        The maximum payload size of any WebSocket Frame which can be received.

        WebSocket Frames over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE

        Parameters:
        maxFrameSize - the maximum allowed size of a WebSocket Frame.
      • setAutoFragment

        void setAutoFragment​(boolean autoFragment)
        If set to true, frames are automatically fragmented to respect the maximum frame size.
        Parameters:
        autoFragment - whether to automatically fragment incoming WebSocket Frames.