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
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 |
authenticate(org.hawkular.bus.common.BasicMessage basicMessage,
javax.websocket.Session session)
This makes sure the message is properly authenticated.
|
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
basicMessage - the message (including its authentication credentials) to be authenticatedsession - the session that sent the messageorg.hawkular.accounts.websocket.WebsocketAuthenticationException - if the authentication check failsprotected 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–2016 Red Hat. All rights reserved.