Class QuestionnaireWebSocketHandler
- java.lang.Object
-
- org.springframework.web.socket.handler.AbstractWebSocketHandler
-
- org.springframework.web.socket.handler.TextWebSocketHandler
-
- io.dialob.questionnaire.service.sockjs.QuestionnaireWebSocketHandler
-
- All Implemented Interfaces:
QuestionnaireActionsService,org.springframework.web.socket.WebSocketHandler
public class QuestionnaireWebSocketHandler extends org.springframework.web.socket.handler.TextWebSocketHandler implements QuestionnaireActionsService
-
-
Constructor Summary
Constructors Constructor Description QuestionnaireWebSocketHandler(io.dialob.settings.DialobSettings settings, QuestionnaireEventPublisher eventPublisher, ActionProcessingService actionProcessingService, com.fasterxml.jackson.databind.ObjectMapper mapper, QuestionnaireSessionService questionnaireSessionService, org.springframework.core.task.TaskExecutor taskExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterConnectionClosed(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus closeStatus)voidafterConnectionEstablished(org.springframework.web.socket.WebSocketSession session)io.dialob.api.proto.ActionsanswerQuestion(String questionnaireId, String revision, List<io.dialob.api.proto.Action> actions)voidhandleTextMessage(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.TextMessage message)voidhandleTransportError(org.springframework.web.socket.WebSocketSession session, Throwable exception)protected booleanisDefaultTenantPathPlaceholder(String tenantId)protected booleanisForThisHandler(QuestionnaireEvent event)voidonQuestionnaireActionsEvent(QuestionnaireActionsEvent event)voidonQuestionnaireCompletedEvent(QuestionnaireCompletedEvent event)protected voidpublishConnectionEvent()protected voidpublishDisconnectionEvent(org.springframework.web.socket.CloseStatus closeStatus)protected voidsendFullForm()protected booleansessionIsClosed()booleansupportsPartialMessages()-
Methods inherited from class org.springframework.web.socket.handler.TextWebSocketHandler
handleBinaryMessage
-
Methods inherited from class org.springframework.web.socket.handler.AbstractWebSocketHandler
handleMessage, handlePongMessage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.dialob.questionnaire.service.api.QuestionnaireActionsService
handleAction, isAcceptableAction
-
-
-
-
Constructor Detail
-
QuestionnaireWebSocketHandler
public QuestionnaireWebSocketHandler(io.dialob.settings.DialobSettings settings, QuestionnaireEventPublisher eventPublisher, ActionProcessingService actionProcessingService, com.fasterxml.jackson.databind.ObjectMapper mapper, QuestionnaireSessionService questionnaireSessionService, org.springframework.core.task.TaskExecutor taskExecutor)
-
-
Method Detail
-
afterConnectionEstablished
public void afterConnectionEstablished(org.springframework.web.socket.WebSocketSession session) throws Exception- Specified by:
afterConnectionEstablishedin interfaceorg.springframework.web.socket.WebSocketHandler- Overrides:
afterConnectionEstablishedin classorg.springframework.web.socket.handler.AbstractWebSocketHandler- Throws:
Exception
-
isDefaultTenantPathPlaceholder
protected boolean isDefaultTenantPathPlaceholder(String tenantId)
-
sendFullForm
protected void sendFullForm()
-
publishConnectionEvent
protected void publishConnectionEvent()
-
publishDisconnectionEvent
protected void publishDisconnectionEvent(org.springframework.web.socket.CloseStatus closeStatus)
-
handleTextMessage
public void handleTextMessage(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.TextMessage message)- Overrides:
handleTextMessagein classorg.springframework.web.socket.handler.AbstractWebSocketHandler
-
handleTransportError
public void handleTransportError(org.springframework.web.socket.WebSocketSession session, Throwable exception) throws Exception- Specified by:
handleTransportErrorin interfaceorg.springframework.web.socket.WebSocketHandler- Overrides:
handleTransportErrorin classorg.springframework.web.socket.handler.AbstractWebSocketHandler- Throws:
Exception
-
afterConnectionClosed
public void afterConnectionClosed(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus closeStatus) throws Exception- Specified by:
afterConnectionClosedin interfaceorg.springframework.web.socket.WebSocketHandler- Overrides:
afterConnectionClosedin classorg.springframework.web.socket.handler.AbstractWebSocketHandler- Throws:
Exception
-
supportsPartialMessages
public boolean supportsPartialMessages()
- Specified by:
supportsPartialMessagesin interfaceorg.springframework.web.socket.WebSocketHandler- Overrides:
supportsPartialMessagesin classorg.springframework.web.socket.handler.AbstractWebSocketHandler
-
answerQuestion
@NonNull public io.dialob.api.proto.Actions answerQuestion(@NonNull String questionnaireId, String revision, @NonNull List<io.dialob.api.proto.Action> actions)- Specified by:
answerQuestionin interfaceQuestionnaireActionsService
-
onQuestionnaireActionsEvent
public void onQuestionnaireActionsEvent(QuestionnaireActionsEvent event)
-
onQuestionnaireCompletedEvent
public void onQuestionnaireCompletedEvent(QuestionnaireCompletedEvent event)
-
isForThisHandler
protected boolean isForThisHandler(QuestionnaireEvent event)
-
sessionIsClosed
protected boolean sessionIsClosed()
-
-