io.vertx.ext.stomp

## Class StompServerOptions

- java.lang.Object
- - io.vertx.core.net.NetworkOptions
  - - io.vertx.core.net.TCPSSLOptions
    - - io.vertx.core.net.NetServerOptions
      - - io.vertx.ext.stomp.StompServerOptions

- All Implemented Interfaces:
    StompOptions

      public class StompServerOptions
      extends NetServerOptions
      implements StompOptions

  STOMP Server options. You can also configure the Net Server used by the STOMP server from these options.
  Author:
    Clement Escoffier

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_MAX_BODY_LENGTH`
    `static int` | `DEFAULT_MAX_FRAME_IN_TRANSACTION`
    `static int` | `DEFAULT_MAX_HEADER_LENGTH`
    `static int` | `DEFAULT_MAX_HEADERS`
    `static int` | `DEFAULT_MAX_SUBSCRIPTIONS_BY_CLIENT`
    `static int` | `DEFAULT_TRANSACTION_CHUNK_SIZE`
    `static String` | `DEFAULT_WEBSOCKET_PATH`

    - ### Fields inherited from class io.vertx.core.net.NetServerOptions

      `DEFAULT_ACCEPT_BACKLOG, DEFAULT_CLIENT_AUTH, DEFAULT_HOST, DEFAULT_PORT`

    - ### Fields inherited from class io.vertx.core.net.TCPSSLOptions

      `DEFAULT_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_USE_ALPN, DEFAULT_USE_POOLED_BUFFERS`

    - ### Fields inherited from class io.vertx.core.net.NetworkOptions

      `DEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS`

    - ### Fields inherited from interface io.vertx.ext.stomp.StompOptions

      `DEFAULT_STOMP_HEARTBEAT, DEFAULT_STOMP_HOST, DEFAULT_STOMP_PORT, DEFAULT_SUPPORTED_VERSIONS, DEFAULT_TRAILING_LINE, UTF_8`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StompServerOptions()` Default constructor.
    `StompServerOptions(JsonObject json)` Create an instance from a `JsonObject`.
    `StompServerOptions(StompServerOptions other)` Copy constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `JsonObject` | `getHeartbeat()` Gets the heartbeat configuration.
    `int` | `getMaxBodyLength()` Gets the max length of the frame body accepted by the server.
    `int` | `getMaxFrameInTransaction()` Gets the maximum number of frames that can be added to a transaction.
    `int` | `getMaxHeaderLength()` Gets the max length of header's value.
    `int` | `getMaxHeaders()` Gets the maximum number of headers supported by the server.
    `int` | `getMaxSubscriptionsByClient()` Gets the maximum of subscriptions a client is allowed to register.
    `int` | `getPort()`
    `List<String>` | `getSupportedVersions()` Gets the STOMP protocol versions supported by the server.
    `int` | `getTimeFactor()` Gets the time factor, i.e.
    `int` | `getTransactionChunkSize()` Gets the chunk size when replaying a transaction.
    `String` | `getWebsocketPath()` Gets the path for the web socket.
    `boolean` | `isSecured()` Checks whether or not the server is secured (meaning it has an authentication mechanism).
    `boolean` | `isSendErrorOnNoSubscriptions()` Checks whether or not an error is sent to the client when this client sends a message to an not subscribed destinations (no subscriptions on this destination).
    `boolean` | `isTrailingLine()` Gets whether or not an empty line should be appended to the written STOMP frame.
    `boolean` | `isWebsocketBridge()` Checks whether or not the web socket bridge is enabled.
    `StompServerOptions` | `setHeartbeat(JsonObject heartbeat)` Sets the heartbeat configuration.
    `StompServerOptions` | `setHost(String host)` Set the host
    `StompServerOptions` | `setMaxBodyLength(int maxBodyLength)` Sets the max body length accepted by the server.
    `StompServerOptions` | `setMaxFrameInTransaction(int maxFrameInTransaction)` Sets the maximum number of frame that can be added in a transaction.
    `StompServerOptions` | `setMaxHeaderLength(int maxHeaderLength)` Sets the max header length.
    `StompServerOptions` | `setMaxHeaders(int maxHeaders)` Sets the maximum number of headers.
    `StompServerOptions` | `setMaxSubscriptionsByClient(int maxSubscriptionsByClient)` Sets the maximum of subscriptions a client is allowed to register.
    `StompServerOptions` | `setPort(int port)` Sets the port on which the server is going to listen for TCP connection.
    `StompServerOptions` | `setSecured(boolean secured)` Enables or disables the server security feature.
    `StompServerOptions` | `setSendErrorOnNoSubscriptions(boolean sendErrorOnNoSubscriptions)` Sets whether or not an error is sent to the client when this client sends a message to an not subscribed destinations (no subscriptions on this destination).
    `StompServerOptions` | `setSsl(boolean ssl)` Set whether SSL/TLS is enabled
    `StompServerOptions` | `setSupportedVersions(List<String> supportedVersions)` Sets the STOMP protocol versions supported by the server.
    `StompServerOptions` | `setTimeFactor(int timeFactor)` Sets the time factor.
    `StompServerOptions` | `setTrailingLine(boolean trailingLine)` Sets whether or not an empty line should be appended to the written STOMP frame.
    `StompServerOptions` | `setTransactionChunkSize(int transactionChunkSize)` Sets the chunk size when replaying a transaction.
    `StompServerOptions` | `setWebsocketBridge(boolean websocketBridge)` Enables or disables the web socket bridge.
    `StompServerOptions` | `setWebsocketPath(String websocketPath)` Sets the websocket path.
    `JsonObject` | `toJson()`

    - ### Methods inherited from class io.vertx.core.net.NetServerOptions

      `addCrlPath, addCrlValue, addEnabledCipherSuite, addEnabledSecureTransportProtocol, equals, getAcceptBacklog, getClientAuth, getHost, hashCode, isClientAuthRequired, setAcceptBacklog, setClientAuth, setClientAuthRequired, setIdleTimeout, setJdkSslEngineOptions, setKeyCertOptions, setKeyStoreOptions, setLogActivity, setOpenSslEngineOptions, setPemKeyCertOptions, setPemTrustOptions, setPfxKeyCertOptions, setPfxTrustOptions, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSoLinger, setSslEngineOptions, setTcpKeepAlive, setTcpNoDelay, setTrafficClass, setTrustOptions, setTrustStoreOptions, setUseAlpn, setUsePooledBuffers`

    - ### Methods inherited from class io.vertx.core.net.TCPSSLOptions

      `getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getKeyCertOptions, getSoLinger, getSslEngineOptions, getTrustOptions, isSsl, isTcpKeepAlive, isTcpNoDelay, isUseAlpn, isUsePooledBuffers`

    - ### Methods inherited from class io.vertx.core.net.NetworkOptions

      `getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress`

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

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

- - ### Field Detail

    - #### DEFAULT_MAX_HEADER_LENGTH

          public static final int DEFAULT_MAX_HEADER_LENGTH

      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_HEADERS

          public static final int DEFAULT_MAX_HEADERS

      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_BODY_LENGTH

          public static final int DEFAULT_MAX_BODY_LENGTH

      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_FRAME_IN_TRANSACTION

          public static final int DEFAULT_MAX_FRAME_IN_TRANSACTION

      See Also:
        Constant Field Values

    - #### DEFAULT_TRANSACTION_CHUNK_SIZE

          public static final int DEFAULT_TRANSACTION_CHUNK_SIZE

      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_SUBSCRIPTIONS_BY_CLIENT

          public static final int DEFAULT_MAX_SUBSCRIPTIONS_BY_CLIENT

      See Also:
        Constant Field Values

    - #### DEFAULT_WEBSOCKET_PATH

          public static final String DEFAULT_WEBSOCKET_PATH

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### StompServerOptions

          public StompServerOptions()

      Default constructor.

    - #### StompServerOptions

          public StompServerOptions(StompServerOptions other)

      Copy constructor.
      Parameters:
        `other` - The other `StompServerOptions` to copy when creating this

    - #### StompServerOptions

          public StompServerOptions(JsonObject json)

      Create an instance from a `JsonObject`.
      Parameters:
        `json` - the JsonObject to create it from

  - ### Method Detail

    - #### toJson

          public JsonObject toJson()

      Returns:
        the JSON representation of this object.

    - #### getMaxBodyLength

          public int getMaxBodyLength()

      Gets the max length of the frame body accepted by the server. If a frame exceeds this size, the frame is rejected and an error is sent to the client.
      Returns:
        the max body length in bytes

    - #### setMaxBodyLength

          public StompServerOptions setMaxBodyLength(int maxBodyLength)

      Sets the max body length accepted by the server. 10 Mb by default.
      Parameters:
        `maxBodyLength` - the length in bytes.
      Returns:
        the current `StompServerOptions`

    - #### getMaxHeaderLength

          public int getMaxHeaderLength()

      Gets the max length of header's value. If a frame has an header with a value exceeding this length, the frame is rejected and an error is sent to the client. 10240 by default.
      Returns:
        the max header length

    - #### setMaxHeaderLength

          public StompServerOptions setMaxHeaderLength(int maxHeaderLength)

      Sets the max header length.
      Parameters:
        `maxHeaderLength` - the max length of headers
      Returns:
        the current `StompServerOptions`

    - #### getMaxHeaders

          public int getMaxHeaders()

      Gets the maximum number of headers supported by the server. If a frame exceeds the number of headers, the frame is rejected and an error is sent to the client.
      Returns:
        the max number of headers

    - #### setMaxHeaders

          public StompServerOptions setMaxHeaders(int maxHeaders)

      Sets the maximum number of headers. 1000 by default.
      Parameters:
        `maxHeaders` - the number of headers
      Returns:
        the current `StompServerOptions`

    - #### getSupportedVersions

          public List<String> getSupportedVersions()

      Gets the STOMP protocol versions supported by the server. Versions are provided in the decreasing order. By default it's `"1.2", "1.1", "1.0"`.
      Returns:
        the list of supported versions

    - #### setSupportedVersions

          public StompServerOptions setSupportedVersions(List<String> supportedVersions)

      Sets the STOMP protocol versions supported by the server. Versions must be given in the decreasing order.
      Parameters:
        `supportedVersions` - the set of supported versions.
      Returns:
        the current `StompServerOptions`

    - #### isSecured

          public boolean isSecured()

      Checks whether or not the server is secured (meaning it has an authentication mechanism). Security is disabled by default and requires an `AuthProvider` handler.
      Returns:
        whether or not the option is enabled.

    - #### setSecured

          public StompServerOptions setSecured(boolean secured)

      Enables or disables the server security feature. It requires an `AuthProvider` handler.
      Parameters:
        `secured` - whether or not the option should be enabled.
      Returns:
        the current `StompServerOptions`

    - #### isSendErrorOnNoSubscriptions

          public boolean isSendErrorOnNoSubscriptions()

      Checks whether or not an error is sent to the client when this client sends a message to an not subscribed destinations (no subscriptions on this destination).
      Returns:
        whether or not the option is enabled.

    - #### setSendErrorOnNoSubscriptions

          public StompServerOptions setSendErrorOnNoSubscriptions(boolean sendErrorOnNoSubscriptions)

      Sets whether or not an error is sent to the client when this client sends a message to an not subscribed destinations (no subscriptions on this destination).
      Parameters:
        `sendErrorOnNoSubscriptions` - whether or not the option should be enabled.
      Returns:
        the current `StompServerOptions`

    - #### getTimeFactor

          public int getTimeFactor()

      Gets the time factor, i.e. a multiplier applied to time constraints as a window error. 1 by default.
      Returns:
        the time factor.

    - #### setTimeFactor

          public StompServerOptions setTimeFactor(int timeFactor)

      Sets the time factor.
      Parameters:
        `timeFactor` - the time factor
      Returns:
        the current `StompServerOptions`

    - #### setSsl

          public StompServerOptions setSsl(boolean ssl)

      Description copied from class: `TCPSSLOptions`
      Set whether SSL/TLS is enabled
      Overrides:
        `setSsl` in class `NetServerOptions`
      Parameters:
        `ssl` - true if enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPort

          public StompServerOptions setPort(int port)

      Sets the port on which the server is going to listen for TCP connection.
      Overrides:
        `setPort` in class `NetServerOptions`
      Parameters:
        `port` - the port number, `-1` to disable the TCP server.
      Returns:
        the current `StompServerOptions`.

    - #### getPort

          public int getPort()

      Overrides:
        `getPort` in class `NetServerOptions`
      Returns:
        the port, -1 if the TCP server has been disabled.

    - #### setHost

          public StompServerOptions setHost(String host)

      Description copied from class: `NetServerOptions`
      Set the host
      Overrides:
        `setHost` in class `NetServerOptions`
      Parameters:
        `host` - the host
      Returns:
        a reference to this, so the API can be used fluently

    - #### getHeartbeat

          public JsonObject getHeartbeat()

      Gets the heartbeat configuration. Defaults to `x: 1000, y: 1000`.
      Returns:
        the heartbeat configuration.
      See Also:
        `Frame.Heartbeat`

    - #### setHeartbeat

          public StompServerOptions setHeartbeat(JsonObject heartbeat)

      Sets the heartbeat configuration.
      Parameters:
        `heartbeat` - the heartbeat configuration
      Returns:
        the current `StompServerOptions`
      See Also:
        `Frame.Heartbeat`

    - #### getMaxFrameInTransaction

          public int getMaxFrameInTransaction()

      Gets the maximum number of frames that can be added to a transaction. If the number of frame added to a transaction exceeds this threshold, the client receives an `ERROR` frame and is disconnected.
      Returns:
        the max number of frame in transaction

    - #### setMaxFrameInTransaction

          public StompServerOptions setMaxFrameInTransaction(int maxFrameInTransaction)

      Sets the maximum number of frame that can be added in a transaction. If the number of frame added to a transaction exceeds this threshold, the client receives an `ERROR` frame and is disconnected. The default is 1000.
      Parameters:
        `maxFrameInTransaction` - the max number of frame
      Returns:
        the current `StompServerOptions`

    - #### getTransactionChunkSize

          public int getTransactionChunkSize()

      Gets the chunk size when replaying a transaction. To avoid blocking the event loop for too long, large transactions are split into chunks, replayed one by one. This settings gets the chunk size.
      Returns:
        the size of the chunk

    - #### setTransactionChunkSize

          public StompServerOptions setTransactionChunkSize(int transactionChunkSize)

      Sets the chunk size when replaying a transaction. To avoid blocking the event loop for too long, large transactions are split into chunks, replayed one by one. This settings sets the chunk size.
      Parameters:
        `transactionChunkSize` - the size, must be strictly positive
      Returns:
        the current `StompServerOptions`

    - #### getMaxSubscriptionsByClient

          public int getMaxSubscriptionsByClient()

      Gets the maximum of subscriptions a client is allowed to register. If a client exceeds this number, it receives an error and the connection is closed.
      Returns:
        the max number of subscriptions per client

    - #### setMaxSubscriptionsByClient

          public StompServerOptions setMaxSubscriptionsByClient(int maxSubscriptionsByClient)

      Sets the maximum of subscriptions a client is allowed to register. If a client exceeds this number, it receives an error and the connection is closed.
      Parameters:
        `maxSubscriptionsByClient` - the max number of subscriptions
      Returns:
        the current `StompServerOptions`

    - #### isWebsocketBridge

          public boolean isWebsocketBridge()

      Checks whether or not the web socket bridge is enabled. This bridge allows receiving and sending STOMP frames on a web socket. If set to `true`, the Stomp server provides a `io.vertx.core.Handler` to read and write from the web socket. This `Handler` must be passed to `HttpServer.websocketHandler(Handler)`.
      Returns:
        whether or not the web socket bridge is enabled, `false` by default.

    - #### setWebsocketBridge

          public StompServerOptions setWebsocketBridge(boolean websocketBridge)

      Enables or disables the web socket bridge.
      Parameters:
        `websocketBridge` - whether or not the web socket bridge should be enabled.
      Returns:
        the current `StompServerOptions`

    - #### getWebsocketPath

          public String getWebsocketPath()

      Gets the path for the web socket. Only web sockets frame receiving on this path would be handled. By default it's `DEFAULT_WEBSOCKET_PATH`. The returned String is not a prefix but an exact match.
      Returns:
        the path

    - #### setWebsocketPath

          public StompServerOptions setWebsocketPath(String websocketPath)

      Sets the websocket path. Only frames received on this path would be considered as STOMP frame.
      Parameters:
        `websocketPath` - the path, must not be `null`.
      Returns:
        the current `StompServerOptions`

    - #### isTrailingLine

          public boolean isTrailingLine()

      Gets whether or not an empty line should be appended to the written STOMP frame. This option is disabled by default. This option is not compliant with the STOMP specification, and so is not documented on purpose.
      Returns:
        whether or not an empty line should be appended to the written STOMP frame.

    - #### setTrailingLine

          public StompServerOptions setTrailingLine(boolean trailingLine)

      Sets whether or not an empty line should be appended to the written STOMP frame. This option is disabled by default. This option is not compliant with the STOMP specification, and so is not documented on purpose.
      Parameters:
        `trailingLine` - `true` to add an empty line, `false` otherwise
      Returns:
        the current `StompServerOptions`

Copyright © 2016. All rights reserved.