Interface BaseWeb2SocketExchange.Outbound

All Superinterfaces:
BaseWebSocketExchange.Outbound
Enclosing interface:
BaseWeb2SocketExchange<A extends ExchangeContext>

public static interface BaseWeb2SocketExchange.Outbound extends BaseWebSocketExchange.Outbound

Extends BaseWebSocketExchange.Outbound to support WebSocket message encoding.

Since:
1.12
Author:
Jeremy Kuhn
  • Method Details

    • closeOnComplete

      BaseWeb2SocketExchange.Outbound closeOnComplete(boolean closeOnComplete)
      Description copied from interface: BaseWebSocketExchange.Outbound

      Specifies whether the WebSocket exchange should be closed when the frames publisher completes successfully.

      When the WebSocket frames publisher completes, it is sometimes desirable to keep the socket opened in order to consume yet to be received messages sent by the remote endpoint before or after receiving the close frame. Note that when the publisher terminates in error, this is considered a failure and the WebSocket exchange is always closed.

      The default behaviour is to close the WebSocket exchange.

      Specified by:
      closeOnComplete in interface BaseWebSocketExchange.Outbound
      Parameters:
      closeOnComplete - true to close the WebSocket exchange when the frames publisher completes, false otherwise
      Returns:
      the outbound
    • encodeTextMessages

      default <T> void encodeTextMessages(Publisher<T> messages)

      Encodes the specified messages to WebSocket text messages sent to the client.

      The negotiated subprotocol shall be used to determine the converter to use to encode the message, the subprotocol is then assumed to be a compact application media type (see MediaTypes.normalizeApplicationMediaType(java.lang.String)).

      Type Parameters:
      T - the type of message to encode
      Parameters:
      messages - the messages to send
    • encodeTextMessages

      default <T> void encodeTextMessages(Publisher<T> messages, Class<T> type)

      Encodes the specified messages of the specified type to WebSocket text messages sent to the client.

      The negotiated subprotocol shall be used to determine the converter to use to encode the message, the subprotocol is then assumed to be a compact application media type (see MediaTypes.normalizeApplicationMediaType(java.lang.String)).

      Type Parameters:
      T - the type of message to encode
      Parameters:
      messages - the messages to send
      type - the type of message to encode
    • encodeTextMessages

      <T> void encodeTextMessages(Publisher<T> messages, Type type)

      Encodes the specified messages of the specified type to WebSocket text messages sent to the client.

      The negotiated subprotocol shall be used to determine the converter to use to encode the message, the subprotocol is then assumed to be a compact application media type (see MediaTypes.normalizeApplicationMediaType(java.lang.String)).

      Type Parameters:
      T - the type of message to encode
      Parameters:
      messages - the messages to send
      type - the type of message to encode
    • encodeBinaryMessages

      default <T> void encodeBinaryMessages(Publisher<T> messages)

      Encodes the specified messages to WebSocket binary messages sent to the client.

      The negotiated subprotocol shall be used to determine the converter to use to encode the message, the subprotocol is then assumed to be a compact application media type (see MediaTypes.normalizeApplicationMediaType(java.lang.String)).

      Type Parameters:
      T - the type of message to encode
      Parameters:
      messages - the messages to send
    • encodeBinaryMessages

      default <T> void encodeBinaryMessages(Publisher<T> messages, Class<T> type)

      Encodes the specified messages of the specified type to WebSocket binary messages sent to the client.

      The negotiated subprotocol shall be used to determine the converter to use to encode the message, the subprotocol is then assumed to be a compact application media type (see MediaTypes.normalizeApplicationMediaType(java.lang.String)).

      Type Parameters:
      T - the type of message to encode
      Parameters:
      messages - the messages to send
      type - the type of message to encode
    • encodeBinaryMessages

      <T> void encodeBinaryMessages(Publisher<T> messages, Type type)

      Encodes the specified messages of the specified type to WebSocket binary messages sent to the client.

      The negotiated subprotocol shall be used to determine the converter to use to encode the message, the subprotocol is then assumed to be a compact application media type (see MediaTypes.normalizeApplicationMediaType(java.lang.String)).

      Type Parameters:
      T - the type of message to encode
      Parameters:
      messages - the messages to send
      type - the type of message to encode