|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.websockets.WebSocketEngine
public class WebSocketEngine
WebSockets engine implementation (singleton), which handles WebSocketApplications registration, responsible
for client and server handshake validation.
WebSocket,
WebSocketApplication| Nested Class Summary | |
|---|---|
static class |
WebSocketEngine.WebSocketHolder
WebSocketHolder object, which gets associated with the Grizzly Connection. |
| Field Summary | |
|---|---|
static java.lang.String |
CLIENT_WS_ORIGIN_HEADER
|
static java.lang.String |
CONNECTION
|
static int |
DEFAULT_TIMEOUT
|
static Version |
DEFAULT_VERSION
|
static int |
INITIAL_BUFFER_SIZE
|
static int |
MASK_SIZE
|
static java.lang.String |
ORIGIN_HEADER
|
static java.lang.String |
RESPONSE_CODE_HEADER
|
static java.lang.String |
RESPONSE_CODE_MESSAGE
|
static int |
RESPONSE_CODE_VALUE
|
static java.lang.String |
SEC_WS_ACCEPT
|
static java.lang.String |
SEC_WS_EXTENSIONS_HEADER
|
static java.lang.String |
SEC_WS_KEY_HEADER
|
static java.lang.String |
SEC_WS_ORIGIN_HEADER
|
static java.lang.String |
SEC_WS_PROTOCOL_HEADER
|
static java.lang.String |
SEC_WS_VERSION
|
static java.lang.String |
SERVER_KEY_HASH
|
static java.lang.String |
UPGRADE
|
static java.lang.String |
WEBSOCKET
|
| Method Summary | |
|---|---|
WebSocketApplication |
getApplication(HttpRequestPacket request)
|
static WebSocketEngine |
getEngine()
|
WebSocket |
getWebSocket(Connection connection)
Get the WebSocket associated with the Grizzly Connection, or null, if there none is
associated. |
WebSocketEngine.WebSocketHolder |
getWebSocketHolder(Connection connection)
|
static ProtocolHandler |
loadHandler(MimeHeaders headers)
|
void |
register(java.lang.String name,
WebSocketApplication app)
Deprecated. use register(WebSocketApplication) |
void |
register(WebSocketApplication app)
Registers the specified WebSocketApplication with the
WebSocketEngine. |
WebSocketEngine.WebSocketHolder |
setWebSocketHolder(Connection connection,
ProtocolHandler handler,
WebSocket socket)
|
static byte[] |
toArray(long length)
|
static long |
toLong(byte[] bytes,
int start,
int end)
|
static java.util.List<java.lang.String> |
toString(byte[] bytes)
|
static java.util.List<java.lang.String> |
toString(byte[] bytes,
int start,
int end)
|
void |
unregister(WebSocketApplication app)
Un-registers the specified WebSocketApplication with the
WebSocketEngine. |
void |
unregisterAll()
Un-registers all WebSocketApplication instances with the
WebSocketEngine. |
boolean |
upgrade(FilterChainContext ctx,
HttpContent requestContent)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SEC_WS_ACCEPT
public static final java.lang.String SEC_WS_KEY_HEADER
public static final java.lang.String SEC_WS_ORIGIN_HEADER
public static final java.lang.String ORIGIN_HEADER
public static final java.lang.String SEC_WS_PROTOCOL_HEADER
public static final java.lang.String SEC_WS_EXTENSIONS_HEADER
public static final java.lang.String SEC_WS_VERSION
public static final java.lang.String WEBSOCKET
public static final java.lang.String RESPONSE_CODE_MESSAGE
public static final java.lang.String RESPONSE_CODE_HEADER
public static final int RESPONSE_CODE_VALUE
public static final java.lang.String UPGRADE
public static final java.lang.String CONNECTION
public static final java.lang.String CLIENT_WS_ORIGIN_HEADER
public static final Version DEFAULT_VERSION
public static final int INITIAL_BUFFER_SIZE
public static final int DEFAULT_TIMEOUT
public static final java.lang.String SERVER_KEY_HASH
public static final int MASK_SIZE
| Method Detail |
|---|
public static WebSocketEngine getEngine()
public static byte[] toArray(long length)
public static long toLong(byte[] bytes,
int start,
int end)
public static java.util.List<java.lang.String> toString(byte[] bytes)
public static java.util.List<java.lang.String> toString(byte[] bytes,
int start,
int end)
public WebSocketApplication getApplication(HttpRequestPacket request)
public boolean upgrade(FilterChainContext ctx,
HttpContent requestContent)
throws java.io.IOException
java.io.IOExceptionpublic static ProtocolHandler loadHandler(MimeHeaders headers)
@Deprecated
public void register(java.lang.String name,
WebSocketApplication app)
register(WebSocketApplication)
public void register(WebSocketApplication app)
WebSocketApplication with the
WebSocketEngine.
app - the WebSocketApplication to register.public void unregister(WebSocketApplication app)
WebSocketApplication with the
WebSocketEngine.
app - the WebSocketApplication to un-register.public void unregisterAll()
WebSocketApplication instances with the
WebSocketEngine.
public WebSocket getWebSocket(Connection connection)
WebSocket associated with the Grizzly Connection, or null, if there none is
associated.
connection - Grizzly Connection.
WebSocket associated with the Grizzly Connection, or null, if there none is
associated.public WebSocketEngine.WebSocketHolder getWebSocketHolder(Connection connection)
public WebSocketEngine.WebSocketHolder setWebSocketHolder(Connection connection,
ProtocolHandler handler,
WebSocket socket)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||