Class SseEmitterService

java.lang.Object
org.qubership.atp.mia.service.SseEmitterService

@Service public class SseEmitterService extends Object
  • 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 id
      token - token
      Returns:
      configured sse emitter with connection event
    • getEmitter

      public org.springframework.web.servlet.mvc.method.annotation.SseEmitter getEmitter(UUID sseId)
      Checks that emitter exists and returns emitter.
      Parameters:
      sseId - sse id
    • sendError

      public void sendError(UUID sseId, MiaException e)
      Completes emitter with error.
      Parameters:
      sseId - sse ID
      e - 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

      public void sendEventWithExecutionResult(ExecutionResponse response)
      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 update
      sseId - sse ID
      isFinal - is final message into emitter
      order - order message