public abstract class AbstractGatewayWebSocket extends Object
FeedWebSocket and UIClientWebSocket.| Modifier and Type | Field and Description |
|---|---|
protected BusEndpointProcessors |
busEndpointProcessors
These perform some additional processing when UI clients or feeds connect and disconnect.
|
protected WsCommandContextFactory |
commandContextFactory |
protected String |
endpoint
This is the actual URL context of the websocket endpoint.
|
protected WsCommands |
wsCommands |
protected WsEndpoints |
wsEndpoints
A container that holds all known and currently active websocket clients (UI and feed clients).
|
| Constructor and Description |
|---|
AbstractGatewayWebSocket(String endpoint) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
handleRequest(javax.websocket.Session session,
BasicMessageWithExtraData<BasicMessage> requestWithBinary) |
void |
onBinaryMessage(InputStream binaryDataStream,
javax.websocket.Session session)
When a binary message is received from a WebSocket client, this method will lookup the
WsCommand for the
given request class and execute it. |
void |
onMessage(String nameAndJsonStr,
javax.websocket.Session session)
When a message is received from a WebSocket client, this method will lookup the
WsCommand for the
given request class and execute it. |
protected void |
sendErrorResponse(javax.websocket.Session session,
String errorMessage,
Throwable t) |
@Inject protected WsCommandContextFactory commandContextFactory
protected final String endpoint
@Inject protected WsCommands wsCommands
@Inject protected WsEndpoints wsEndpoints
@Inject protected BusEndpointProcessors busEndpointProcessors
public AbstractGatewayWebSocket(String endpoint)
protected void handleRequest(javax.websocket.Session session,
BasicMessageWithExtraData<BasicMessage> requestWithBinary)
throws NoCommandForMessageException,
Exception
public void onBinaryMessage(InputStream binaryDataStream, javax.websocket.Session session)
WsCommand for the
given request class and execute it.binaryDataStream - contains the JSON request and additional binary datasession - the client session making the requestpublic void onMessage(String nameAndJsonStr, javax.websocket.Session session)
WsCommand for the
given request class and execute it.nameAndJsonStr - the name of the API request followed by "=" followed then by the request's JSON datasession - the client session making the requestCopyright © 2014–2017 Red Hat, Inc.. All rights reserved.