public abstract class AbstractGatewayWebSocket extends Object
FeedWebSocket and UIClientWebSocket.| Modifier and Type | Field and Description |
|---|---|
protected org.hawkular.accounts.websocket.Authenticator |
authenticator |
protected BusEndpointProcessors |
busEndpointProcessors |
protected WsCommandContextFactory |
commandContextFactory |
protected String |
endpoint |
protected WsCommands |
wsCommands |
protected WsEndpoints |
wsEndpoints |
| Constructor and Description |
|---|
AbstractGatewayWebSocket(String endpoint) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
authenticate(org.hawkular.bus.common.BasicMessage basicMessage,
javax.websocket.Session session) |
protected void |
handleRequest(javax.websocket.Session session,
org.hawkular.bus.common.BasicMessageWithExtraData<org.hawkular.bus.common.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 org.hawkular.accounts.websocket.Authenticator authenticator
@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 authenticate(org.hawkular.bus.common.BasicMessage basicMessage,
javax.websocket.Session session)
throws org.hawkular.accounts.websocket.WebsocketAuthenticationException
org.hawkular.accounts.websocket.WebsocketAuthenticationExceptionprotected void handleRequest(javax.websocket.Session session,
org.hawkular.bus.common.BasicMessageWithExtraData<org.hawkular.bus.common.BasicMessage> requestWithBinary)
throws org.hawkular.accounts.websocket.WebsocketAuthenticationException,
NoCommandForMessageException,
Exception
org.hawkular.accounts.websocket.WebsocketAuthenticationExceptionNoCommandForMessageExceptionExceptionpublic 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 © 2015 Red Hat. All rights reserved.