Package org.qubership.atp.mia.service
Class SseEmitterService
java.lang.Object
org.qubership.atp.mia.service.SseEmitterService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.servlet.mvc.method.annotation.SseEmittergenerateAndConfigureEmitter(UUID sseId, String token) Generates and configures emitter for sseId.org.springframework.web.servlet.mvc.method.annotation.SseEmittergetEmitter(UUID sseId) Checks that emitter exists and returns emitter.voidsendError(UUID sseId, MiaException e) Completes emitter with error.voidSends event about execution finish.voidsendEventWithExecutionResult(org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter, ExecutionResponse executionResponse) Sends event about execution finish.voidupdateResponseAndSendToEmitter(ExecutionResponse response, UUID sseId, boolean isFinal, int order) Update response and send into emitter.
-
Constructor Details
-
SseEmitterService
public SseEmitterService()
-
-
Method Details
-
generateAndConfigureEmitter
public org.springframework.web.servlet.mvc.method.annotation.SseEmitter generateAndConfigureEmitter(UUID sseId, String token) Generates and configures emitter for sseId.- Parameters:
sseId- sse idtoken- token- Returns:
- configured sse emitter with connection event
-
getEmitter
Checks that emitter exists and returns emitter.- Parameters:
sseId- sse id
-
sendError
Completes emitter with error.- Parameters:
sseId- sse IDe- Exception
-
sendEventWithExecutionResult
public void sendEventWithExecutionResult(org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter, ExecutionResponse executionResponse) Sends event about execution finish.- Parameters:
executionResponse- request execution response
-
sendEventWithExecutionResult
Sends event about execution finish.- Parameters:
response- request execution response
-
updateResponseAndSendToEmitter
public void updateResponseAndSendToEmitter(ExecutionResponse response, UUID sseId, boolean isFinal, int order) Update response and send into emitter.- Parameters:
response- ExecutionResponse to be updatesseId- sse IDisFinal- is final message into emitterorder- order message
-