Class JDKWSOptions.Builder

java.lang.Object
org.eclipse.net4j.ws.jdk.JDKWSOptions.Builder
Enclosing class:
JDKWSOptions

public static final class JDKWSOptions.Builder extends Object
Builds immutable JDK WebSocket provider options.
Since:
2.0
Author:
Eike Stepper
  • Method Details

    • webSocketConnectTimeout

      public JDKWSOptions.Builder webSocketConnectTimeout(Duration timeout)
      Sets the maximum time allowed for an opening handshake.
      Parameters:
      timeout - positive timeout that converts to at least one millisecond
      Returns:
      this builder
    • heartbeatInterval

      public JDKWSOptions.Builder heartbeatInterval(Duration interval)
      Sets the interval between unsolicited heartbeat Pong frames.
      Parameters:
      interval - positive interval that converts to at least one millisecond
      Returns:
      this builder
    • maxMessageSize

      public JDKWSOptions.Builder maxMessageSize(int size)
      Sets the maximum complete WebSocket message size, including its Net4j header.
      Parameters:
      size - message size from the Net4j header size through Short.MAX_VALUE
      Returns:
      this builder
    • build

      public JDKWSOptions build()
      Validates and creates immutable options.
      Returns:
      the immutable settings
      Throws:
      NullPointerException - if either duration is null
      IllegalArgumentException - if a duration does not convert to positive milliseconds or the message size is outside the Net4j frame limits