diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketClient.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java similarity index 97% rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketClient.java rename to jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java index 743bdc38b64..077fa921b00 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketClient.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java @@ -13,7 +13,7 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.client; import java.io.IOException; import java.net.InetSocketAddress; @@ -33,6 +33,13 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.eclipse.jetty.util.log.Logger; +import org.eclipse.jetty.websocket.MaskGen; +import org.eclipse.jetty.websocket.WebSocket; +import org.eclipse.jetty.websocket.WebSocketConnection; +import org.eclipse.jetty.websocket.WebSocketConnectionRFC6455; +import org.eclipse.jetty.websocket.WebSocket.Connection; +import org.eclipse.jetty.websocket.WebSocket.FrameConnection; +import org.eclipse.jetty.websocket.WebSocket.OnFrame; /* ------------------------------------------------------------ */ diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketClientFactory.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClientFactory.java similarity index 98% rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketClientFactory.java rename to jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClientFactory.java index fc6753c9c85..bd969357031 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketClientFactory.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClientFactory.java @@ -13,7 +13,7 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.client; import java.io.EOFException; import java.io.IOException; @@ -49,6 +49,12 @@ import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.ThreadPool; +import org.eclipse.jetty.websocket.MaskGen; +import org.eclipse.jetty.websocket.RandomMaskGen; +import org.eclipse.jetty.websocket.WebSocket; +import org.eclipse.jetty.websocket.WebSocketConnection; +import org.eclipse.jetty.websocket.WebSocketConnectionRFC6455; +import org.eclipse.jetty.websocket.extensions.Extension; /* ------------------------------------------------------------ */ /** diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/TestClient.java b/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/TestClient.java similarity index 96% rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/TestClient.java rename to jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/TestClient.java index 4387b7573d4..a8378f09296 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/TestClient.java +++ b/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/TestClient.java @@ -13,7 +13,7 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.client; import java.net.InetSocketAddress; import java.net.URI; @@ -28,6 +28,13 @@ import java.util.concurrent.atomic.AtomicLong; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.TypeUtil; +import org.eclipse.jetty.websocket.WebSocket; +import org.eclipse.jetty.websocket.WebSocketConnectionRFC6455; +import org.eclipse.jetty.websocket.WebSocket.Connection; +import org.eclipse.jetty.websocket.WebSocket.FrameConnection; +import org.eclipse.jetty.websocket.WebSocket.OnFrame; +import org.eclipse.jetty.websocket.client.WebSocketClient; +import org.eclipse.jetty.websocket.client.WebSocketClientFactory; /** * This is not a general purpose websocket client. diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketClientTest.java b/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/WebSocketClientTest.java similarity index 98% rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketClientTest.java rename to jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/WebSocketClientTest.java index 07a9060baa0..b070126a1b0 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketClientTest.java +++ b/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/WebSocketClientTest.java @@ -13,7 +13,7 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.client; import java.io.BufferedReader; import java.io.IOException; @@ -39,6 +39,13 @@ import java.util.concurrent.atomic.AtomicLong; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.thread.QueuedThreadPool; +import org.eclipse.jetty.websocket.WebSocket; +import org.eclipse.jetty.websocket.WebSocketConnectionRFC6455; +import org.eclipse.jetty.websocket.ZeroMaskGen; +import org.eclipse.jetty.websocket.WebSocket.Connection; +import org.eclipse.jetty.websocket.WebSocket.OnTextMessage; +import org.eclipse.jetty.websocket.client.WebSocketClient; +import org.eclipse.jetty.websocket.client.WebSocketClientFactory; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketConnection.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketConnection.java index 0fb93e81af6..2f50265a0a2 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketConnection.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketConnection.java @@ -20,6 +20,7 @@ import java.nio.ByteBuffer; import java.util.List; import org.eclipse.jetty.io.AsyncConnection; +import org.eclipse.jetty.websocket.extensions.Extension; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionRFC6455.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionRFC6455.java index 8bf13044896..67f1a577878 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionRFC6455.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionRFC6455.java @@ -50,6 +50,7 @@ import org.eclipse.jetty.websocket.WebSocket.OnBinaryMessage; import org.eclipse.jetty.websocket.WebSocket.OnControl; import org.eclipse.jetty.websocket.WebSocket.OnFrame; import org.eclipse.jetty.websocket.WebSocket.OnTextMessage; +import org.eclipse.jetty.websocket.extensions.Extension; /* ------------------------------------------------------------ */ diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketFactory.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketFactory.java index 90d335e7962..97fb6fdf3aa 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketFactory.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketFactory.java @@ -44,6 +44,12 @@ import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; +import org.eclipse.jetty.websocket.extensions.Extension; +import org.eclipse.jetty.websocket.extensions.deflate.DeflateFrameExtension; +import org.eclipse.jetty.websocket.extensions.fragment.FragmentExtension; +import org.eclipse.jetty.websocket.extensions.identity.IdentityExtension; +import org.eclipse.jetty.websocket.servlet.helper.WebSocketServletConnection; +import org.eclipse.jetty.websocket.servlet.helper.WebSocketServletConnectionRFC6455; /** * Factory to create WebSocket connections diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/api/WebSocket.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/api/WebSocket.java new file mode 100644 index 00000000000..d9b29242815 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/api/WebSocket.java @@ -0,0 +1,12 @@ +package org.eclipse.jetty.websocket.api; + +public class WebSocket { + /** + * Version in use by Safari / OSX + */ + public static final short DRAFT0 = 0; + /** + * Version declared by RFC6455 + */ + public static final short RFC6455 = 13; +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/api/WebSocketException.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/api/WebSocketException.java new file mode 100644 index 00000000000..bebf45e6706 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/api/WebSocketException.java @@ -0,0 +1,23 @@ +package org.eclipse.jetty.websocket.api; + +/** + * A recoverable exception within the websocket framework. + */ +@SuppressWarnings("serial") +public class WebSocketException extends RuntimeException { + public WebSocketException() { + super(); + } + + public WebSocketException(String message, Throwable cause) { + super(message, cause); + } + + public WebSocketException(String message) { + super(message); + } + + public WebSocketException(Throwable cause) { + super(cause); + } +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/AbstractExtension.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/AbstractExtension.java similarity index 94% rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/AbstractExtension.java rename to jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/AbstractExtension.java index d6d3a1a58b6..b121d47d268 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/AbstractExtension.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/AbstractExtension.java @@ -13,7 +13,7 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.extensions; import java.io.IOException; import java.util.HashMap; @@ -21,6 +21,10 @@ import java.util.Map; import org.eclipse.jetty.util.QuotedStringTokenizer; +import org.eclipse.jetty.websocket.WebSocket; +import org.eclipse.jetty.websocket.WebSocketGenerator; +import org.eclipse.jetty.websocket.WebSocketParser; +import org.eclipse.jetty.websocket.WebSocket.FrameConnection; import org.eclipse.jetty.websocket.WebSocketParser.FrameHandler; public class AbstractExtension implements Extension diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/Extension.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/Extension.java similarity index 77% rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/Extension.java rename to jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/Extension.java index 67a2a521f96..b5913cfc410 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/Extension.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/Extension.java @@ -13,10 +13,16 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.extensions; import java.util.Map; +import org.eclipse.jetty.websocket.WebSocket; +import org.eclipse.jetty.websocket.WebSocketGenerator; +import org.eclipse.jetty.websocket.WebSocketParser; +import org.eclipse.jetty.websocket.WebSocket.FrameConnection; +import org.eclipse.jetty.websocket.WebSocketParser.FrameHandler; + public interface Extension extends WebSocketParser.FrameHandler, WebSocketGenerator { public String getName(); diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/DeflateFrameExtension.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/deflate/DeflateFrameExtension.java similarity index 96% rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/DeflateFrameExtension.java rename to jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/deflate/DeflateFrameExtension.java index 264a8f0ccba..40c32df298e 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/DeflateFrameExtension.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/deflate/DeflateFrameExtension.java @@ -13,7 +13,7 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.extensions.deflate; import java.io.IOException; import java.util.Map; @@ -25,6 +25,8 @@ import java.util.zip.Inflater; import org.eclipse.jetty.io.ByteArrayBuffer; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; +import org.eclipse.jetty.websocket.WebSocketConnectionRFC6455; +import org.eclipse.jetty.websocket.extensions.AbstractExtension; /** * @TODO Implement proposed deflate frame draft diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/FragmentExtension.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/fragment/FragmentExtension.java similarity index 95% rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/FragmentExtension.java rename to jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/fragment/FragmentExtension.java index 069aa17d7b0..1399ff37a60 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/FragmentExtension.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/fragment/FragmentExtension.java @@ -13,11 +13,13 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.extensions.fragment; import java.io.IOException; import java.util.Map; +import org.eclipse.jetty.websocket.extensions.AbstractExtension; + public class FragmentExtension extends AbstractExtension { private int _maxLength=-1; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/IdentityExtension.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/identity/IdentityExtension.java similarity index 87% rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/IdentityExtension.java rename to jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/identity/IdentityExtension.java index 2faac0525da..f441fb9b862 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/IdentityExtension.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/extensions/identity/IdentityExtension.java @@ -13,7 +13,9 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.extensions.identity; + +import org.eclipse.jetty.websocket.extensions.AbstractExtension; public class IdentityExtension extends AbstractExtension { diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/BinaryFrame.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/BinaryFrame.java new file mode 100644 index 00000000000..3023fd3d5d5 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/BinaryFrame.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.frames; + +public class BinaryFrame { + +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/CloseFrame.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/CloseFrame.java new file mode 100644 index 00000000000..b6f2fdd1bb5 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/CloseFrame.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.frames; + +public class CloseFrame { + +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/ContinuationFrame.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/ContinuationFrame.java new file mode 100644 index 00000000000..907bd627ab1 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/ContinuationFrame.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.frames; + +public class ContinuationFrame { + +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/ControlFrame.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/ControlFrame.java new file mode 100644 index 00000000000..21062919999 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/ControlFrame.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.frames; + +public class ControlFrame { + +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/ControlFrameType.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/ControlFrameType.java new file mode 100644 index 00000000000..11d58413c77 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/ControlFrameType.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.frames; + +public class ControlFrameType { + +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/PingFrame.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/PingFrame.java new file mode 100644 index 00000000000..0b8313cb838 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/PingFrame.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.frames; + +public class PingFrame { + +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/PongFrame.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/PongFrame.java new file mode 100644 index 00000000000..952554b6ec2 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/PongFrame.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.frames; + +public class PongFrame { + +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/TextFrame.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/TextFrame.java new file mode 100644 index 00000000000..e1ceb180ed1 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/frames/TextFrame.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.frames; + +public class TextFrame { + +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/generator/ControlFrameGenerator.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/generator/ControlFrameGenerator.java new file mode 100644 index 00000000000..ebf98e92ad3 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/generator/ControlFrameGenerator.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.generator; + +public class ControlFrameGenerator { + +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/generator/Generator.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/generator/Generator.java new file mode 100644 index 00000000000..cac7ba69896 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/generator/Generator.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.generator; + +public class Generator { + +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/parser/ControlFrameBodyParser.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/parser/ControlFrameBodyParser.java new file mode 100644 index 00000000000..a8f386e5476 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/parser/ControlFrameBodyParser.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.parser; + +public class ControlFrameBodyParser { + +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/parser/ControlFrameParser.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/parser/ControlFrameParser.java new file mode 100644 index 00000000000..f81075cdc90 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/parser/ControlFrameParser.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.parser; + +public class ControlFrameParser { + +} diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/parser/Parser.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/parser/Parser.java new file mode 100644 index 00000000000..c864ac9c2d9 --- /dev/null +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/parser/Parser.java @@ -0,0 +1,5 @@ +package org.eclipse.jetty.websocket.parser; + +public class Parser { + +} diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketCommTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketCommTest.java index 1668d13b5ad..b60259b6b1c 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketCommTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketCommTest.java @@ -22,9 +22,11 @@ import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.websocket.helper.CaptureSocket; -import org.eclipse.jetty.websocket.helper.MessageSender; -import org.eclipse.jetty.websocket.helper.WebSocketCaptureServlet; +import org.eclipse.jetty.websocket.client.WebSocketClient; +import org.eclipse.jetty.websocket.client.WebSocketClientFactory; +import org.eclipse.jetty.websocket.servlet.helper.CaptureSocket; +import org.eclipse.jetty.websocket.servlet.helper.MessageSender; +import org.eclipse.jetty.websocket.servlet.helper.WebSocketCaptureServlet; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketOverSSLTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketOverSSLTest.java index 524d8d0ece3..a23b3cb1943 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketOverSSLTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketOverSSLTest.java @@ -27,6 +27,8 @@ import org.eclipse.jetty.server.ssl.SslSelectChannelConnector; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; +import org.eclipse.jetty.websocket.client.WebSocketClient; +import org.eclipse.jetty.websocket.client.WebSocketClientFactory; import org.junit.After; import org.junit.Assert; import org.junit.Test; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketRedeployTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketRedeployTest.java index 39f218085d9..eddbe40045b 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketRedeployTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketRedeployTest.java @@ -26,6 +26,9 @@ import org.eclipse.jetty.server.handler.HandlerCollection; import org.eclipse.jetty.server.nio.SelectChannelConnector; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; +import org.eclipse.jetty.websocket.client.WebSocketClient; +import org.eclipse.jetty.websocket.client.WebSocketClientFactory; +import org.eclipse.jetty.websocket.servlet.helper.WebSocketServlet; import org.junit.After; import org.junit.Assert; import org.junit.Test; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketServlet.java b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServlet.java similarity index 96% rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketServlet.java rename to jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServlet.java index 1e765263e62..dab5f56bfa6 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketServlet.java +++ b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServlet.java @@ -26,7 +26,7 @@ // You may elect to redistribute this code under either of these licenses. // ======================================================================== -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.servlet; import java.io.IOException; import javax.servlet.ServletException; @@ -36,6 +36,8 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; +import org.eclipse.jetty.websocket.WebSocketFactory; +import org.eclipse.jetty.websocket.WebSocketFactory.Acceptor; /* ------------------------------------------------------------ */ /** diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnection.java b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServletConnection.java similarity index 91% rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnection.java rename to jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServletConnection.java index 8e9daaff4d3..d996cd34e53 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnection.java +++ b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServletConnection.java @@ -13,12 +13,14 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.servlet; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.eclipse.jetty.websocket.WebSocketConnection; + public interface WebSocketServletConnection extends WebSocketConnection { void handshake(HttpServletRequest request, HttpServletResponse response, String subprotocol) throws IOException; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionRFC6455.java b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServletConnectionRFC6455.java similarity index 90% rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionRFC6455.java rename to jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServletConnectionRFC6455.java index b6e44fcbec0..74935cd3d66 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionRFC6455.java +++ b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServletConnectionRFC6455.java @@ -13,7 +13,7 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.servlet; import java.io.IOException; import java.util.List; @@ -21,6 +21,10 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.io.EndPoint; +import org.eclipse.jetty.websocket.WebSocket; +import org.eclipse.jetty.websocket.WebSocketConnectionRFC6455; +import org.eclipse.jetty.websocket.WebSocketFactory; +import org.eclipse.jetty.websocket.extensions.Extension; public class WebSocketServletConnectionRFC6455 extends WebSocketConnectionRFC6455 implements WebSocketServletConnection { diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/TestServer.java b/jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/TestServer.java similarity index 96% rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/TestServer.java rename to jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/TestServer.java index 249b632e066..94a1ca0663e 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/TestServer.java +++ b/jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/TestServer.java @@ -13,7 +13,7 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.servlet; import java.io.IOException; import java.util.concurrent.ConcurrentLinkedQueue; @@ -29,6 +29,15 @@ import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; +import org.eclipse.jetty.websocket.WebSocket; +import org.eclipse.jetty.websocket.WebSocketConnectionRFC6455; +import org.eclipse.jetty.websocket.WebSocketHandler; +import org.eclipse.jetty.websocket.WebSocket.Connection; +import org.eclipse.jetty.websocket.WebSocket.FrameConnection; +import org.eclipse.jetty.websocket.WebSocket.OnBinaryMessage; +import org.eclipse.jetty.websocket.WebSocket.OnControl; +import org.eclipse.jetty.websocket.WebSocket.OnFrame; +import org.eclipse.jetty.websocket.WebSocket.OnTextMessage; public class TestServer extends Server { diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketServletRFCTest.java b/jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/WebSocketServletRFCTest.java similarity index 91% rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketServletRFCTest.java rename to jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/WebSocketServletRFCTest.java index fcde6e3135e..894bcaa8cf2 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/WebSocketServletRFCTest.java +++ b/jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/WebSocketServletRFCTest.java @@ -1,4 +1,4 @@ -package org.eclipse.jetty.websocket; +package org.eclipse.jetty.websocket.servlet; import static org.hamcrest.Matchers.*; @@ -20,7 +20,16 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.websocket.helper.MessageSender; +import org.eclipse.jetty.websocket.WebSocket; +import org.eclipse.jetty.websocket.WebSocketGeneratorRFC6455Test; +import org.eclipse.jetty.websocket.WebSocketMessageRFC6455Test; +import org.eclipse.jetty.websocket.WebSocketParserRFC6455Test; +import org.eclipse.jetty.websocket.WebSocket.Connection; +import org.eclipse.jetty.websocket.WebSocket.OnTextMessage; +import org.eclipse.jetty.websocket.client.WebSocketClient; +import org.eclipse.jetty.websocket.client.WebSocketClientFactory; +import org.eclipse.jetty.websocket.servlet.helper.MessageSender; +import org.eclipse.jetty.websocket.servlet.helper.WebSocketServlet; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/helper/CaptureSocket.java b/jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/helper/CaptureSocket.java similarity index 96% rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/helper/CaptureSocket.java rename to jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/helper/CaptureSocket.java index de969280a34..42d60f56a35 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/helper/CaptureSocket.java +++ b/jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/helper/CaptureSocket.java @@ -13,7 +13,7 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket.helper; +package org.eclipse.jetty.websocket.servlet.helper; import java.util.ArrayList; import java.util.List; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/helper/MessageSender.java b/jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/helper/MessageSender.java similarity index 97% rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/helper/MessageSender.java rename to jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/helper/MessageSender.java index 65896aab982..c2156720b6d 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/helper/MessageSender.java +++ b/jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/helper/MessageSender.java @@ -13,7 +13,7 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket.helper; +package org.eclipse.jetty.websocket.servlet.helper; import java.io.IOException; import java.util.concurrent.CountDownLatch; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/helper/SafariD00.java b/jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/helper/SafariD00.java similarity index 98% rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/helper/SafariD00.java rename to jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/helper/SafariD00.java index 85ab83c2ae4..af015f265f4 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/helper/SafariD00.java +++ b/jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/helper/SafariD00.java @@ -13,7 +13,7 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket.helper; +package org.eclipse.jetty.websocket.servlet.helper; import java.io.BufferedReader; import java.io.IOException; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/helper/WebSocketCaptureServlet.java b/jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/helper/WebSocketCaptureServlet.java similarity index 92% rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/helper/WebSocketCaptureServlet.java rename to jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/helper/WebSocketCaptureServlet.java index b4731283823..d049b16d18b 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/helper/WebSocketCaptureServlet.java +++ b/jetty-websocket/websocket-servlet/src/test/java/org/eclipse/jetty/websocket/servlet/helper/WebSocketCaptureServlet.java @@ -13,7 +13,7 @@ * * You may elect to redistribute this code under either of these licenses. *******************************************************************************/ -package org.eclipse.jetty.websocket.helper; +package org.eclipse.jetty.websocket.servlet.helper; import java.io.IOException; import java.util.ArrayList; @@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.websocket.WebSocket; -import org.eclipse.jetty.websocket.WebSocketServlet; +import org.eclipse.jetty.websocket.servlet.helper.WebSocketServlet; @SuppressWarnings("serial") public class WebSocketCaptureServlet extends WebSocketServlet