diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/module-info.java b/jetty-websocket/websocket-jetty-api/src/main/java/module-info.java index 9bd0d472ca8f..10fc108c444d 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/module-info.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/module-info.java @@ -16,12 +16,14 @@ // ======================================================================== // +import org.eclipse.jetty.websocket.api.ExtensionConfig; + module org.eclipse.jetty.websocket.jetty.api { exports org.eclipse.jetty.websocket.api; exports org.eclipse.jetty.websocket.api.annotations; - exports org.eclipse.jetty.websocket.api.extensions; + exports org.eclipse.jetty.websocket.api.exceptions; exports org.eclipse.jetty.websocket.api.util; - uses org.eclipse.jetty.websocket.api.extensions.ExtensionConfig.Parser; + uses ExtensionConfig.Parser; } diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/CloseStatus.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/CloseStatus.java index 015cd6f81bca..e6c3c50bda65 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/CloseStatus.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/CloseStatus.java @@ -23,8 +23,8 @@ public class CloseStatus private static final int MAX_CONTROL_PAYLOAD = 125; public static final int MAX_REASON_PHRASE = MAX_CONTROL_PAYLOAD - 2; - private int code; - private String phrase; + private final int code; + private final String phrase; /** * Creates a reason for closing a web socket connection with the given code and reason phrase. diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/extensions/ExtensionConfig.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/ExtensionConfig.java similarity index 97% rename from jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/extensions/ExtensionConfig.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/ExtensionConfig.java index 5902690f280a..6f43bcd66f9a 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/extensions/ExtensionConfig.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/ExtensionConfig.java @@ -16,7 +16,7 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.api.extensions; +package org.eclipse.jetty.websocket.api; import java.util.Map; import java.util.ServiceLoader; diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/Frame.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/Frame.java index c548759eef92..5b46e8c0a603 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/Frame.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/Frame.java @@ -46,7 +46,7 @@ public static Type from(byte op) throw new IllegalArgumentException("OpCode " + op + " is not a valid Frame.Type"); } - private byte opcode; + private final byte opcode; Type(byte code) { diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeRequest.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeRequest.java index b96f9e673735..86e71acda32a 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeRequest.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeRequest.java @@ -24,8 +24,6 @@ import java.util.List; import java.util.Map; -import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; - /** * The HTTP Upgrade to WebSocket Request */ diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeResponse.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeResponse.java index 6a8ab84dc149..bdca1630d51a 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeResponse.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeResponse.java @@ -22,8 +22,6 @@ import java.util.Map; import java.util.Set; -import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; - /** * The HTTP Upgrade to WebSocket Response */ diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketAdapter.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketAdapter.java index 6a0e5ded87fd..e7053d91dcb6 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketAdapter.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketAdapter.java @@ -39,14 +39,12 @@ public Session getSession() public boolean isConnected() { - Session sess = this.session; - return (sess != null) && (sess.isOpen()); + return session.isOpen(); } public boolean isNotConnected() { - Session sess = this.session; - return (sess == null) || (!sess.isOpen()); + return !isConnected(); } @Override diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/BadPayloadException.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/BadPayloadException.java similarity index 93% rename from jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/BadPayloadException.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/BadPayloadException.java index 444c0c871888..df4935acd8f3 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/BadPayloadException.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/BadPayloadException.java @@ -16,7 +16,9 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.api; +package org.eclipse.jetty.websocket.api.exceptions; + +import org.eclipse.jetty.websocket.api.StatusCode; /** * Exception to terminate the connection because it has received data within a frame payload that was not consistent with the requirements of that frame diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/CloseException.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/CloseException.java similarity index 93% rename from jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/CloseException.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/CloseException.java index 0e9e1c796330..59374c9e0518 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/CloseException.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/CloseException.java @@ -16,12 +16,12 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.api; +package org.eclipse.jetty.websocket.api.exceptions; @SuppressWarnings("serial") public class CloseException extends WebSocketException { - private int statusCode; + private final int statusCode; public CloseException(int closeCode, String message) { diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/InvalidWebSocketException.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/InvalidWebSocketException.java similarity index 89% rename from jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/InvalidWebSocketException.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/InvalidWebSocketException.java index 2cd01a8d30ea..6d3e84d6247a 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/InvalidWebSocketException.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/InvalidWebSocketException.java @@ -16,8 +16,10 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.api; +package org.eclipse.jetty.websocket.api.exceptions; +import org.eclipse.jetty.websocket.api.WebSocketAdapter; +import org.eclipse.jetty.websocket.api.WebSocketListener; import org.eclipse.jetty.websocket.api.annotations.WebSocket; /** diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/MessageTooLargeException.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/MessageTooLargeException.java similarity index 92% rename from jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/MessageTooLargeException.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/MessageTooLargeException.java index 166ae51d169b..56184b1aff2e 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/MessageTooLargeException.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/MessageTooLargeException.java @@ -16,7 +16,9 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.api; +package org.eclipse.jetty.websocket.api.exceptions; + +import org.eclipse.jetty.websocket.api.StatusCode; /** * Exception when a message is too large for the internal buffers occurs and should trigger a connection close. diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/PolicyViolationException.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/PolicyViolationException.java similarity index 92% rename from jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/PolicyViolationException.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/PolicyViolationException.java index 44c6663da8d2..f0ef4f1865a2 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/PolicyViolationException.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/PolicyViolationException.java @@ -16,7 +16,9 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.api; +package org.eclipse.jetty.websocket.api.exceptions; + +import org.eclipse.jetty.websocket.api.StatusCode; /** * Exception when a violation of policy occurs and should trigger a connection close. diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/ProtocolException.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/ProtocolException.java similarity index 92% rename from jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/ProtocolException.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/ProtocolException.java index 0ac3721c95d1..265bcb2414e3 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/ProtocolException.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/ProtocolException.java @@ -16,7 +16,9 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.api; +package org.eclipse.jetty.websocket.api.exceptions; + +import org.eclipse.jetty.websocket.api.StatusCode; /** * Per spec, a protocol error should result in a Close frame of status code 1002 (PROTOCOL_ERROR) diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeException.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/UpgradeException.java similarity index 97% rename from jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeException.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/UpgradeException.java index bdcc7d9e6556..0a0f0018a8f5 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeException.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/UpgradeException.java @@ -16,7 +16,7 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.api; +package org.eclipse.jetty.websocket.api.exceptions; import java.net.URI; diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketException.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/WebSocketException.java similarity index 96% rename from jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketException.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/WebSocketException.java index 3dd7eed0aa7b..cb45a1fbd44d 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketException.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/WebSocketException.java @@ -16,7 +16,7 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.api; +package org.eclipse.jetty.websocket.api.exceptions; /** * A recoverable exception within the websocket framework. diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketTimeoutException.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/WebSocketTimeoutException.java similarity index 96% rename from jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketTimeoutException.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/WebSocketTimeoutException.java index 1c859b8c9c2f..9f7aaaf686b1 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketTimeoutException.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/WebSocketTimeoutException.java @@ -16,7 +16,7 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.api; +package org.eclipse.jetty.websocket.api.exceptions; /** * Exception thrown to indicate a connection I/O timeout. diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/extensions/package-info.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/package-info.java similarity index 88% rename from jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/extensions/package-info.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/package-info.java index 9ab270f0695f..cac9316bc8a5 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/extensions/package-info.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/exceptions/package-info.java @@ -17,7 +17,7 @@ // /** - * Jetty WebSocket API : WebSocket Extension API + * Jetty WebSocket API : Exception Types */ -package org.eclipse.jetty.websocket.api.extensions; +package org.eclipse.jetty.websocket.api.exceptions; diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/util/WSURI.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/util/WSURI.java index 412296b76725..7ab4a833758a 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/util/WSURI.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/util/WSURI.java @@ -22,8 +22,6 @@ import java.net.URISyntaxException; import java.util.Objects; -// @checkstyle-disable-check : AbbreviationAsWordInNameCheck - /** * Utility methods for converting a {@link URI} between a HTTP(S) and WS(S) URI. */ diff --git a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketConstants.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/util/WebSocketConstants.java similarity index 96% rename from jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketConstants.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/util/WebSocketConstants.java index 24bddbcc9903..5c24ff692472 100644 --- a/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketConstants.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/util/WebSocketConstants.java @@ -16,7 +16,7 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.api; +package org.eclipse.jetty.websocket.api.util; public final class WebSocketConstants { diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/ClientUpgradeRequest.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/ClientUpgradeRequest.java index 06dc403d96df..8ca2852d82d4 100644 --- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/ClientUpgradeRequest.java +++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/ClientUpgradeRequest.java @@ -31,9 +31,9 @@ import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpScheme; +import org.eclipse.jetty.websocket.api.ExtensionConfig; import org.eclipse.jetty.websocket.api.UpgradeRequest; import org.eclipse.jetty.websocket.api.UpgradeResponse; -import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; /** * Client based UpgradeRequest API diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/DelegatedJettyClientUpgradeRequest.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/DelegatedJettyClientUpgradeRequest.java index 06a18e11d619..b9a5d33275c1 100644 --- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/DelegatedJettyClientUpgradeRequest.java +++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/DelegatedJettyClientUpgradeRequest.java @@ -32,8 +32,8 @@ import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.MultiMap; import org.eclipse.jetty.util.UrlEncoded; +import org.eclipse.jetty.websocket.api.ExtensionConfig; import org.eclipse.jetty.websocket.api.UpgradeRequest; -import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest; import static java.nio.charset.StandardCharsets.UTF_8; diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/DelegatedJettyClientUpgradeResponse.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/DelegatedJettyClientUpgradeResponse.java index 79eb3f5d54c0..1d5e8e6cafdf 100644 --- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/DelegatedJettyClientUpgradeResponse.java +++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/DelegatedJettyClientUpgradeResponse.java @@ -26,8 +26,8 @@ import org.eclipse.jetty.client.HttpResponse; import org.eclipse.jetty.http.HttpHeader; +import org.eclipse.jetty.websocket.api.ExtensionConfig; import org.eclipse.jetty.websocket.api.UpgradeResponse; -import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; /** * Representing the Jetty {@link org.eclipse.jetty.client.HttpClient}'s {@link org.eclipse.jetty.client.HttpResponse} diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java b/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java index 4bac66d7684a..848cf00520fa 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java @@ -16,7 +16,7 @@ // ======================================================================== // -import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; +import org.eclipse.jetty.websocket.api.ExtensionConfig; import org.eclipse.jetty.websocket.common.ExtensionConfigParser; module org.eclipse.jetty.websocket.jetty.common diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/ExtensionConfigParser.java b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/ExtensionConfigParser.java index 497174142c56..d886f844723a 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/ExtensionConfigParser.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/ExtensionConfigParser.java @@ -20,7 +20,7 @@ import org.eclipse.jetty.websocket.core.ExtensionConfig; -public class ExtensionConfigParser implements org.eclipse.jetty.websocket.api.extensions.ExtensionConfig.Parser +public class ExtensionConfigParser implements org.eclipse.jetty.websocket.api.ExtensionConfig.Parser { /** * Parse a single parameterized name. diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyExtensionConfig.java b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyExtensionConfig.java index 44f8e6320396..a4b493d2dcf0 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyExtensionConfig.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyExtensionConfig.java @@ -26,7 +26,7 @@ /** * Represents an Extension Configuration, as seen during the connection Handshake process. */ -public class JettyExtensionConfig implements org.eclipse.jetty.websocket.api.extensions.ExtensionConfig +public class JettyExtensionConfig implements org.eclipse.jetty.websocket.api.ExtensionConfig { private final ExtensionConfig config; diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java index 92bab40e1b78..484235984fc8 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java @@ -507,27 +507,27 @@ private void demand() public static Throwable convertCause(Throwable cause) { if (cause instanceof MessageTooLargeException) - return new org.eclipse.jetty.websocket.api.MessageTooLargeException(cause.getMessage(), cause); + return new org.eclipse.jetty.websocket.api.exceptions.MessageTooLargeException(cause.getMessage(), cause); if (cause instanceof ProtocolException) - return new org.eclipse.jetty.websocket.api.ProtocolException(cause.getMessage(), cause); + return new org.eclipse.jetty.websocket.api.exceptions.ProtocolException(cause.getMessage(), cause); if (cause instanceof BadPayloadException) - return new org.eclipse.jetty.websocket.api.BadPayloadException(cause.getMessage(), cause); + return new org.eclipse.jetty.websocket.api.exceptions.BadPayloadException(cause.getMessage(), cause); if (cause instanceof CloseException) - return new org.eclipse.jetty.websocket.api.CloseException(((CloseException)cause).getStatusCode(), cause.getMessage(), cause); + return new org.eclipse.jetty.websocket.api.exceptions.CloseException(((CloseException)cause).getStatusCode(), cause.getMessage(), cause); if (cause instanceof WebSocketTimeoutException) - return new org.eclipse.jetty.websocket.api.WebSocketTimeoutException(cause.getMessage(), cause); + return new org.eclipse.jetty.websocket.api.exceptions.WebSocketTimeoutException(cause.getMessage(), cause); if (cause instanceof InvalidSignatureException) - return new org.eclipse.jetty.websocket.api.InvalidWebSocketException(cause.getMessage(), cause); + return new org.eclipse.jetty.websocket.api.exceptions.InvalidWebSocketException(cause.getMessage(), cause); if (cause instanceof UpgradeException) { UpgradeException ue = (UpgradeException)cause; - return new org.eclipse.jetty.websocket.api.UpgradeException(ue.getRequestURI(), ue.getResponseStatusCode(), cause); + return new org.eclipse.jetty.websocket.api.exceptions.UpgradeException(ue.getRequestURI(), ue.getResponseStatusCode(), cause); } return cause; diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandlerMetadata.java b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandlerMetadata.java index 2e9b6c2ef0fc..ae782768f906 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandlerMetadata.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandlerMetadata.java @@ -21,7 +21,7 @@ import java.lang.invoke.MethodHandle; import org.eclipse.jetty.websocket.api.BatchMode; -import org.eclipse.jetty.websocket.api.InvalidWebSocketException; +import org.eclipse.jetty.websocket.api.exceptions.InvalidWebSocketException; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.util.messages.MessageSink; diff --git a/jetty-websocket/websocket-jetty-common/src/main/resources/META-INF/services/org.eclipse.jetty.websocket.api.extensions.ExtensionConfig$Parser b/jetty-websocket/websocket-jetty-common/src/main/resources/META-INF/services/org.eclipse.jetty.websocket.api.ExtensionConfig$Parser similarity index 100% rename from jetty-websocket/websocket-jetty-common/src/main/resources/META-INF/services/org.eclipse.jetty.websocket.api.extensions.ExtensionConfig$Parser rename to jetty-websocket/websocket-jetty-common/src/main/resources/META-INF/services/org.eclipse.jetty.websocket.api.ExtensionConfig$Parser diff --git a/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/LocalEndpointMetadataTest.java b/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/LocalEndpointMetadataTest.java index 9c02961fa263..de31a6b50470 100644 --- a/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/LocalEndpointMetadataTest.java +++ b/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/LocalEndpointMetadataTest.java @@ -18,7 +18,7 @@ package org.eclipse.jetty.websocket.common; -import org.eclipse.jetty.websocket.api.InvalidWebSocketException; +import org.eclipse.jetty.websocket.api.exceptions.InvalidWebSocketException; import org.eclipse.jetty.websocket.util.DuplicateAnnotationException; import org.eclipse.jetty.websocket.util.InvalidSignatureException; import org.eclipse.jetty.websocket.util.messages.ByteArrayMessageSink; diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyServerUpgradeResponse.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyServerUpgradeResponse.java index bd6fe1c9e7e1..67b0e67e52c9 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyServerUpgradeResponse.java +++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyServerUpgradeResponse.java @@ -21,9 +21,9 @@ import java.io.IOException; import java.util.List; +import org.eclipse.jetty.websocket.api.ExtensionConfig; import org.eclipse.jetty.websocket.api.UpgradeRequest; import org.eclipse.jetty.websocket.api.UpgradeResponse; -import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; public interface JettyServerUpgradeResponse extends UpgradeResponse { diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java index 78128a7a4bca..52c2d6b2f68c 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java +++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java @@ -150,7 +150,7 @@ public void addMapping(String pathSpec, final Class endpointClass) } catch (Exception e) { - throw new org.eclipse.jetty.websocket.api.WebSocketException("Unable to create instance of " + endpointClass.getName(), e); + throw new org.eclipse.jetty.websocket.api.exceptions.WebSocketException("Unable to create instance of " + endpointClass.getName(), e); } }); } diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/internal/DelegatedServerUpgradeRequest.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/internal/DelegatedServerUpgradeRequest.java index 2973aa53eba2..1969e792b4c4 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/internal/DelegatedServerUpgradeRequest.java +++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/internal/DelegatedServerUpgradeRequest.java @@ -31,7 +31,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; -import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; +import org.eclipse.jetty.websocket.api.ExtensionConfig; import org.eclipse.jetty.websocket.common.JettyExtensionConfig; import org.eclipse.jetty.websocket.server.JettyServerUpgradeRequest; import org.eclipse.jetty.websocket.util.server.internal.ServerUpgradeRequest; diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/internal/DelegatedServerUpgradeResponse.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/internal/DelegatedServerUpgradeResponse.java index e72af1202aa4..287e3649266f 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/internal/DelegatedServerUpgradeResponse.java +++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/internal/DelegatedServerUpgradeResponse.java @@ -24,7 +24,7 @@ import java.util.Set; import java.util.stream.Collectors; -import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; +import org.eclipse.jetty.websocket.api.ExtensionConfig; import org.eclipse.jetty.websocket.common.JettyExtensionConfig; import org.eclipse.jetty.websocket.server.JettyServerUpgradeResponse; import org.eclipse.jetty.websocket.util.server.internal.ServerUpgradeResponse; diff --git a/jetty-websocket/websocket-jetty-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserDebugTool.java b/jetty-websocket/websocket-jetty-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserDebugTool.java index 2ddb8dfb14c6..26cc31329b18 100644 --- a/jetty-websocket/websocket-jetty-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserDebugTool.java +++ b/jetty-websocket/websocket-jetty-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserDebugTool.java @@ -37,7 +37,7 @@ import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.resource.PathResource; import org.eclipse.jetty.util.resource.Resource; -import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; +import org.eclipse.jetty.websocket.api.ExtensionConfig; import org.eclipse.jetty.websocket.server.JettyServerUpgradeRequest; import org.eclipse.jetty.websocket.server.JettyServerUpgradeResponse; import org.eclipse.jetty.websocket.server.JettyWebSocketCreator; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/JettyWebSocketExtensionConfigTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/JettyWebSocketExtensionConfigTest.java index b9c8f0ed65d2..0a8e23d94c0d 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/JettyWebSocketExtensionConfigTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/JettyWebSocketExtensionConfigTest.java @@ -30,8 +30,8 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.ServletContextHandler; +import org.eclipse.jetty.websocket.api.ExtensionConfig; import org.eclipse.jetty.websocket.api.Session; -import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; import org.eclipse.jetty.websocket.client.ClientUpgradeRequest; import org.eclipse.jetty.websocket.client.JettyUpgradeListener; import org.eclipse.jetty.websocket.client.WebSocketClient; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/WebSocketOverHTTP2Test.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/WebSocketOverHTTP2Test.java index 744449a7741b..87725e660856 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/WebSocketOverHTTP2Test.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/WebSocketOverHTTP2Test.java @@ -59,7 +59,7 @@ import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.StatusCode; -import org.eclipse.jetty.websocket.api.UpgradeException; +import org.eclipse.jetty.websocket.api.exceptions.UpgradeException; import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.jetty.websocket.server.JettyWebSocketServlet; import org.eclipse.jetty.websocket.server.JettyWebSocketServletFactory; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientCloseTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientCloseTest.java index 2561ef271627..895b4f79f357 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientCloseTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientCloseTest.java @@ -37,12 +37,12 @@ import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.websocket.api.Frame; -import org.eclipse.jetty.websocket.api.MessageTooLargeException; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.StatusCode; import org.eclipse.jetty.websocket.api.WebSocketFrameListener; import org.eclipse.jetty.websocket.api.WebSocketListener; -import org.eclipse.jetty.websocket.api.WebSocketTimeoutException; +import org.eclipse.jetty.websocket.api.exceptions.MessageTooLargeException; +import org.eclipse.jetty.websocket.api.exceptions.WebSocketTimeoutException; import org.eclipse.jetty.websocket.api.util.WSURI; import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.jetty.websocket.core.CloseStatus; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConfigTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConfigTest.java index 8b3a47e5bbbb..c51997d7c7c3 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConfigTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConfigTest.java @@ -29,11 +29,11 @@ import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.websocket.api.BatchMode; -import org.eclipse.jetty.websocket.api.MessageTooLargeException; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.StatusCode; -import org.eclipse.jetty.websocket.api.WebSocketTimeoutException; import org.eclipse.jetty.websocket.api.annotations.WebSocket; +import org.eclipse.jetty.websocket.api.exceptions.MessageTooLargeException; +import org.eclipse.jetty.websocket.api.exceptions.WebSocketTimeoutException; import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.jetty.websocket.common.WebSocketSession; import org.eclipse.jetty.websocket.core.internal.WebSocketConnection; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConnectTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConnectTest.java index cfdef700f31b..787c2c832610 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConnectTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConnectTest.java @@ -40,7 +40,7 @@ import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.websocket.api.Session; -import org.eclipse.jetty.websocket.api.UpgradeException; +import org.eclipse.jetty.websocket.api.exceptions.UpgradeException; import org.eclipse.jetty.websocket.api.util.WSURI; import org.eclipse.jetty.websocket.client.ClientUpgradeRequest; import org.eclipse.jetty.websocket.client.WebSocketClient; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientTimeoutTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientTimeoutTest.java index a0071ef6a930..bdfdd4a25c8a 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientTimeoutTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientTimeoutTest.java @@ -29,7 +29,7 @@ import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.websocket.api.Session; -import org.eclipse.jetty.websocket.api.UpgradeException; +import org.eclipse.jetty.websocket.api.exceptions.UpgradeException; import org.eclipse.jetty.websocket.api.util.WSURI; import org.eclipse.jetty.websocket.client.ClientUpgradeRequest; import org.eclipse.jetty.websocket.client.WebSocketClient; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ConnectFutureTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ConnectFutureTest.java index f4b2345683cc..61be12cab526 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ConnectFutureTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ConnectFutureTest.java @@ -34,9 +34,9 @@ import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.StatusCode; -import org.eclipse.jetty.websocket.api.UpgradeException; -import org.eclipse.jetty.websocket.api.WebSocketException; import org.eclipse.jetty.websocket.api.WebSocketSessionListener; +import org.eclipse.jetty.websocket.api.exceptions.UpgradeException; +import org.eclipse.jetty.websocket.api.exceptions.WebSocketException; import org.eclipse.jetty.websocket.api.util.WSURI; import org.eclipse.jetty.websocket.client.ClientUpgradeRequest; import org.eclipse.jetty.websocket.client.JettyUpgradeListener; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/extensions/ExtensionConfigTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/extensions/ExtensionConfigTest.java index 1ef482ada5d6..926437ddb95e 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/extensions/ExtensionConfigTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/extensions/ExtensionConfigTest.java @@ -21,7 +21,7 @@ import java.util.HashMap; import java.util.Map; -import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; +import org.eclipse.jetty.websocket.api.ExtensionConfig; import org.junit.jupiter.api.Test; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerConfigTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerConfigTest.java index 6e30ef30f8e7..83d9bf1bdb8d 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerConfigTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerConfigTest.java @@ -33,11 +33,11 @@ import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.websocket.api.BatchMode; -import org.eclipse.jetty.websocket.api.MessageTooLargeException; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.StatusCode; -import org.eclipse.jetty.websocket.api.WebSocketTimeoutException; import org.eclipse.jetty.websocket.api.annotations.WebSocket; +import org.eclipse.jetty.websocket.api.exceptions.MessageTooLargeException; +import org.eclipse.jetty.websocket.api.exceptions.WebSocketTimeoutException; import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.jetty.websocket.common.WebSocketSession; import org.eclipse.jetty.websocket.core.internal.WebSocketConnection;