# Class LiveWebSocketHandler

java.lang.Object
org.springframework.web.socket.handler.AbstractWebSocketHandler
org.springframework.web.socket.handler.TextWebSocketHandler
com.google.adk.web.websocket.LiveWebSocketHandler

All Implemented Interfaces:
  `org.springframework.web.socket.WebSocketHandler`

@Component public class LiveWebSocketHandler extends org.springframework.web.socket.handler.TextWebSocketHandler
WebSocket Handler for the /run_live endpoint.

Manages bidirectional communication for live agent interactions. Assumes the com.google.adk.runner.Runner class has a method: `public Flowable<Event> runLive(Session session, Flowable<LiveRequest> liveRequests, List<String> modalities)`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LiveWebSocketHandler(com.fasterxml.jackson.databind.ObjectMapper objectMapper, BaseSessionService sessionService, RunnerService runnerService)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `afterConnectionClosed(org.springframework.web.socket.WebSocketSession wsSession, org.springframework.web.socket.CloseStatus status)`
  `void`
  `afterConnectionEstablished(org.springframework.web.socket.WebSocketSession wsSession)`
  `protected void`
  `handleTextMessage(org.springframework.web.socket.WebSocketSession wsSession, org.springframework.web.socket.TextMessage message)`
  `void`
  `handleTransportError(org.springframework.web.socket.WebSocketSession wsSession, Throwable exception)`

  ### Methods inherited from class org.springframework.web.socket.handler.TextWebSocketHandler

  `handleBinaryMessage`

  ### Methods inherited from class org.springframework.web.socket.handler.AbstractWebSocketHandler

  `handleMessage, handlePongMessage, supportsPartialMessages`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### LiveWebSocketHandler

    @Autowired public LiveWebSocketHandler(com.fasterxml.jackson.databind.ObjectMapper objectMapper, BaseSessionService sessionService, RunnerService runnerService)

- ## Method Details

  - ### afterConnectionEstablished

    public void afterConnectionEstablished(org.springframework.web.socket.WebSocketSession wsSession) throws Exception
    Specified by:
      `afterConnectionEstablished` in interface `org.springframework.web.socket.WebSocketHandler`
    Overrides:
      `afterConnectionEstablished` in class `org.springframework.web.socket.handler.AbstractWebSocketHandler`
    Throws:
      `Exception`

  - ### handleTextMessage

    protected void handleTextMessage(org.springframework.web.socket.WebSocketSession wsSession, org.springframework.web.socket.TextMessage message) throws Exception
    Overrides:
      `handleTextMessage` in class `org.springframework.web.socket.handler.AbstractWebSocketHandler`
    Throws:
      `Exception`

  - ### handleTransportError

    public void handleTransportError(org.springframework.web.socket.WebSocketSession wsSession, Throwable exception) throws Exception
    Specified by:
      `handleTransportError` in interface `org.springframework.web.socket.WebSocketHandler`
    Overrides:
      `handleTransportError` in class `org.springframework.web.socket.handler.AbstractWebSocketHandler`
    Throws:
      `Exception`

  - ### afterConnectionClosed

    public void afterConnectionClosed(org.springframework.web.socket.WebSocketSession wsSession, org.springframework.web.socket.CloseStatus status) throws Exception
    Specified by:
      `afterConnectionClosed` in interface `org.springframework.web.socket.WebSocketHandler`
    Overrides:
      `afterConnectionClosed` in class `org.springframework.web.socket.handler.AbstractWebSocketHandler`
    Throws:
      `Exception`