Add constructors and Javadoc comments to improve clarity and completeness across server components, including WebSocket and routing classes.
This commit is contained in:
@@ -80,6 +80,8 @@ public final class WebSocketConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum size of a single WebSocket frame payload.
|
||||
*
|
||||
* @return the maximum single-frame payload size in bytes
|
||||
*/
|
||||
public int maxFramePayloadLength() {
|
||||
@@ -87,6 +89,8 @@ public final class WebSocketConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum size of an aggregated (multi-frame) message.
|
||||
*
|
||||
* @return the maximum aggregated message size in bytes
|
||||
*/
|
||||
public int maxAggregatedMessageSize() {
|
||||
@@ -94,6 +98,8 @@ public final class WebSocketConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the idle timeout after which inactive connections are closed.
|
||||
*
|
||||
* @return the idle timeout, or {@code null} if idle connections are never closed
|
||||
*/
|
||||
public Duration idleTimeout() {
|
||||
@@ -101,6 +107,8 @@ public final class WebSocketConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether connections from any origin are accepted.
|
||||
*
|
||||
* @return {@code true} if connections from any origin are accepted
|
||||
*/
|
||||
public boolean allowAnyOrigin() {
|
||||
@@ -108,6 +116,8 @@ public final class WebSocketConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the explicitly allowed origins.
|
||||
*
|
||||
* @return the immutable set of explicitly allowed origins
|
||||
*/
|
||||
public Set<String> allowedOrigins() {
|
||||
@@ -126,6 +136,8 @@ public final class WebSocketConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether per-message deflate compression is enabled.
|
||||
*
|
||||
* @return {@code true} if per-message compression is enabled
|
||||
*/
|
||||
public boolean compression() {
|
||||
@@ -133,6 +145,8 @@ public final class WebSocketConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the WebSocket path is matched by prefix rather than exact equality.
|
||||
*
|
||||
* @return {@code true} if the WebSocket path is matched by prefix rather than exactly
|
||||
*/
|
||||
public boolean checkStartsWith() {
|
||||
@@ -162,6 +176,13 @@ public final class WebSocketConfig {
|
||||
/** Whether path matching uses a prefix check; defaults to {@code false}. */
|
||||
private boolean checkStartsWith = false;
|
||||
|
||||
/**
|
||||
* Creates a builder pre-populated with the default configuration values described
|
||||
* above. Obtain instances via {@link WebSocketConfig#builder()}.
|
||||
*/
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum single-frame payload size.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user