Package com.oorian
Interface SseConnection
- All Known Implementing Classes:
OorianSseConnection
public interface SseConnection
Abstracts a Server-Sent Events (SSE) connection for pushing updates to the client.
This interface decouples the framework from the specific SSE implementation, allowing the common library to send SSE messages without referencing servlet-specific types.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this SSE connection.booleanisOpen()Returns whether this SSE connection is currently open.voidsendJsonResponse(String jsonResponse) Sends a JSON response to the client via the SSE connection.
-
Method Details
-
sendJsonResponse
Sends a JSON response to the client via the SSE connection.- Parameters:
jsonResponse- The JSON-encoded response string.
-
isOpen
boolean isOpen()Returns whether this SSE connection is currently open.- Returns:
trueif the connection is open,falseotherwise.
-
close
void close()Closes this SSE connection.
-