Package io.vertx.ext.stomp.lite
Class StompServerOptions
- java.lang.Object
-
- io.vertx.ext.stomp.lite.StompServerOptions
-
public class StompServerOptions extends java.lang.ObjectSTOMP Server options. You can also configure the Net Server used by the STOMP server from these options.
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_DEBUG_ENABLEDstatic intDEFAULT_MAX_BODY_LENGTHstatic intDEFAULT_MAX_CONNECT_FRAME_LENGTHstatic intDEFAULT_MAX_HEADER_LENGTHstatic intDEFAULT_MAX_HEADERSstatic io.vertx.core.json.JsonObjectDEFAULT_STOMP_HEARTBEATstatic java.lang.StringDEFAULT_STOMP_HOSTstatic intDEFAULT_STOMP_PORTstatic booleanDEFAULT_TRAILING_LINEstatic java.lang.StringDEFAULT_WEBSOCKET_PATH
-
Constructor Summary
Constructors Constructor Description StompServerOptions()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.vertx.core.json.JsonObjectgetHeartbeat()Gets the heartbeat configuration.java.lang.StringgetHost()intgetMaxBodyLength()Gets the max length of the frame body accepted by the server.intgetMaxConnectFrameLength()Gets the maximum length of the CONNECT frame that can be provided by the clientintgetMaxHeaderLength()Gets the max length of header's value.intgetMaxHeaders()Gets the maximum number of headers supported by the server.intgetPort()java.lang.StringgetWebsocketPath()Gets the path for the web socket.booleanisDebugEnabled()Gets whether or not debug is enabled.booleanisTrailingLine()Gets whether or not an empty line should be appended to the written STOMP frame.StompServerOptionssetDebugEnabled(boolean debugEnabled)Sets if debug should be enabled or not.StompServerOptionssetHeartbeat(io.vertx.core.json.JsonObject heartbeat)Sets the heartbeat configuration.StompServerOptionssetHost(java.lang.String host)Set the hostStompServerOptionssetMaxBodyLength(int maxBodyLength)Sets the max body length accepted by the server.StompServerOptionssetMaxConnectFrameLength(int maxConnectFrameLength)Sets the maximum length of the CONNECT frame that can be provided by the clientStompServerOptionssetMaxHeaderLength(int maxHeaderLength)Sets the max header length.StompServerOptionssetMaxHeaders(int maxHeaders)Sets the maximum number of headers.StompServerOptionssetPort(int port)Sets the port on which the server is going to listen for connections.StompServerOptionssetTrailingLine(boolean trailingLine)Sets whether or not an empty line should be appended to the written STOMP frame.StompServerOptionssetWebsocketPath(java.lang.String websocketPath)Sets the websocket path.
-
-
-
Field Detail
-
DEFAULT_MAX_CONNECT_FRAME_LENGTH
public static final int DEFAULT_MAX_CONNECT_FRAME_LENGTH
- See Also:
- Constant Field Values
-
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_WEBSOCKET_PATH
public static final java.lang.String DEFAULT_WEBSOCKET_PATH
- See Also:
- Constant Field Values
-
DEFAULT_STOMP_PORT
public static int DEFAULT_STOMP_PORT
-
DEFAULT_STOMP_HOST
public static java.lang.String DEFAULT_STOMP_HOST
-
DEFAULT_STOMP_HEARTBEAT
public static io.vertx.core.json.JsonObject DEFAULT_STOMP_HEARTBEAT
-
DEFAULT_TRAILING_LINE
public static boolean DEFAULT_TRAILING_LINE
-
DEFAULT_DEBUG_ENABLED
public static boolean DEFAULT_DEBUG_ENABLED
-
-
Method Detail
-
getMaxConnectFrameLength
public int getMaxConnectFrameLength()
Gets the maximum length of the CONNECT frame that can be provided by the client- Returns:
- the max length of the connect frame in bytes
-
setMaxConnectFrameLength
public StompServerOptions setMaxConnectFrameLength(int maxConnectFrameLength)
Sets the maximum length of the CONNECT frame that can be provided by the client- Parameters:
maxConnectFrameLength- the max length of the connect frame in bytes- Returns:
- the current
StompServerOptions
-
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
-
setPort
public StompServerOptions setPort(int port)
Sets the port on which the server is going to listen for connections.- Parameters:
port- the port number- Returns:
- the current
StompServerOptions.
-
getPort
public int getPort()
- Returns:
- the port
-
setHost
public StompServerOptions setHost(java.lang.String host)
Set the host- Parameters:
host- the host- Returns:
- a reference to this, so the API can be used fluently
-
getHost
public java.lang.String getHost()
- Returns:
- the host
-
getHeartbeat
public io.vertx.core.json.JsonObject getHeartbeat()
Gets the heartbeat configuration. Defaults tox: 1000, y: 1000.- Returns:
- the heartbeat configuration.
- See Also:
Frame.Heartbeat
-
setHeartbeat
public StompServerOptions setHeartbeat(io.vertx.core.json.JsonObject heartbeat)
Sets the heartbeat configuration.- Parameters:
heartbeat- the heartbeat configuration- Returns:
- the current
StompServerOptions - See Also:
Frame.Heartbeat
-
getWebsocketPath
public java.lang.String getWebsocketPath()
Gets the path for the web socket. Only web sockets frame receiving on this path would be handled. By default it'sDEFAULT_WEBSOCKET_PATH. The returned String is not a prefix but an exact match.- Returns:
- the path
-
setWebsocketPath
public StompServerOptions setWebsocketPath(java.lang.String websocketPath)
Sets the websocket path. Only frames received on this path would be considered as STOMP frame.- Parameters:
websocketPath- the path, must not benull.- 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-trueto add an empty line,falseotherwise- Returns:
- the current
StompServerOptions
-
isDebugEnabled
public boolean isDebugEnabled()
Gets whether or not debug is enabled. Debug tells the stomp server to provide additional information to the client. Such as stack traces upon an error. This is typically disabled in production.- Returns:
- true if debug is enabled false if not
-
setDebugEnabled
public StompServerOptions setDebugEnabled(boolean debugEnabled)
Sets if debug should be enabled or not.- Parameters:
debugEnabled- true to enable debug false to disable it.- Returns:
- this
-
-