java.lang.Object
com.mulesoft.connectors.a2a.internal.server.agent.sse.SseClientRegistry

public class SseClientRegistry extends Object
Registry for managing SSE client connections and event routing. Handles live event delivery and buffering for disconnected clients.
  • Constructor Details

    • SseClientRegistry

      public SseClientRegistry()
  • Method Details

    • register

      public void register(String taskId, org.mule.runtime.http.api.sse.server.SseClient client)
    • getClients

      public Set<org.mule.runtime.http.api.sse.server.SseClient> getClients(String taskId)
    • removeTask

      public void removeTask(String taskId)
    • removeClient

      public void removeClient(String taskId, org.mule.runtime.http.api.sse.server.SseClient client)
    • isClientRegistered

      public boolean isClientRegistered(String taskId, org.mule.runtime.http.api.sse.server.SseClient client)
      Checks if a specific client is still registered for a taskId
      Parameters:
      taskId - the task identifier
      client - the specific client to check
      Returns:
      true if the client is still registered, false otherwise
    • closeSingleConnection

      public void closeSingleConnection(String taskId, org.mule.runtime.http.api.sse.server.SseClient client)
      Closes a single SSE connection and removes it from the registry.
      Parameters:
      taskId - the task ID
      client - the specific client to close
    • closeAllConnections

      public void closeAllConnections(String taskId)
      Closes all SSE connections for a specific task and removes the task from registry.
      Parameters:
      taskId - the task ID
    • shutdown

      public void shutdown()
      Shuts down the SSE client registry by closing all connections and clearing the registry.