Class SseClientRegistry
java.lang.Object
com.mulesoft.connectors.a2a.internal.server.agent.sse.SseClientRegistry
Registry for managing SSE client connections and event routing. Handles live event delivery and buffering for disconnected
clients.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseAllConnections(String taskId) Closes all SSE connections for a specific task and removes the task from registry.voidcloseSingleConnection(String taskId, org.mule.runtime.http.api.sse.server.SseClient client) Closes a single SSE connection and removes it from the registry.Set<org.mule.runtime.http.api.sse.server.SseClient>getClients(String taskId) booleanisClientRegistered(String taskId, org.mule.runtime.http.api.sse.server.SseClient client) Checks if a specific client is still registered for a taskIdvoidvoidremoveClient(String taskId, org.mule.runtime.http.api.sse.server.SseClient client) voidremoveTask(String taskId) voidshutdown()Shuts down the SSE client registry by closing all connections and clearing the registry.
-
Constructor Details
-
SseClientRegistry
public SseClientRegistry()
-
-
Method Details
-
register
-
getClients
-
removeTask
-
removeClient
-
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 identifierclient- 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 IDclient- the specific client to close
-
closeAllConnections
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.
-