@Service public class WebSocketService extends Object
Constructor and Description |
---|
WebSocketService(QueryService queryService,
HandlerService handlerService,
org.springframework.messaging.simp.SimpMessagingTemplate messagingTemplate,
String clientDestination)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
deleteSession(String sessionID)
Deletes a session from the session id map.
|
void |
killQuery(String sessionID,
String queryID)
Kills the query and cleans up.
|
void |
sendResponse(String sessionID,
WebSocketResponse response,
org.springframework.messaging.simp.SimpMessageHeaderAccessor headerAccessor)
Sends a response to the client through WebSocket connection.
|
void |
submitQuery(String queryID,
String sessionID,
com.yahoo.bullet.query.Query query,
String queryString,
WebSocketQueryHandler queryHandler)
Submits a query by
HandlerService . |
@Autowired public WebSocketService(QueryService queryService, HandlerService handlerService, org.springframework.messaging.simp.SimpMessagingTemplate messagingTemplate, @Value(value="${bullet.websocket.client.destination}") String clientDestination)
queryService
- The QueryService
to use.handlerService
- The HandlerService
to use.messagingTemplate
- The SimpMessagingTemplate
to use.clientDestination
- The client destination to use for websockets.public void killQuery(String sessionID, String queryID)
sessionID
- The session ID to represent the client.queryID
- The query ID of the query to be killed or null to kill the query associated with the session.public void deleteSession(String sessionID)
sessionID
- The session ID to be deleted.public void submitQuery(String queryID, String sessionID, com.yahoo.bullet.query.Query query, String queryString, WebSocketQueryHandler queryHandler)
HandlerService
.queryID
- The query ID to register request with.sessionID
- The session ID to represent the client.query
- The valid Query
to submit.queryString
- The string representation of the query.queryHandler
- The Query Handler to submit the query.public void sendResponse(String sessionID, WebSocketResponse response, org.springframework.messaging.simp.SimpMessageHeaderAccessor headerAccessor)
sessionID
- The session ID to represent the client.response
- The WebSocketResponse
response to be sent.headerAccessor
- The SimpMessageHeaderAccessor
headers to be associated with the response message.Copyright © 2021 Pivotal Software, Inc.. All rights reserved.