Enum Class SSEEvent
- All Implemented Interfaces:
Serializable, Comparable<SSEEvent>, Constable
Enumeration representing different types of Server-Sent Events (SSE) that can be broadcast to clients.
This enum defines the event types used in the SSE communication protocol between the server and connected clients. Each event type serves a specific purpose in the real-time communication system.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionConnected event - Used to notify a client that the SSE connection has been established.Heartbeat event - Used to keep the SSE connection alive.Log event - Used to send server log messages to connected clients.Stats event - Used to send server statistics and performance metrics to clients. -
Method Summary
-
Enum Constant Details
-
LOG
Log event - Used to send server log messages to connected clients.This event type is triggered when the server wants to broadcast log information to client dashboards or monitoring interfaces.
-
STATS
Stats event - Used to send server statistics and performance metrics to clients.This event type carries server metrics such as CPU usage, memory usage, uptime, total requests, and active connections.
-
CONNECTED
Connected event - Used to notify a client that the SSE connection has been established.This event type is typically sent immediately after a client connects to confirm the successful establishment of the SSE stream.
-
HEARTBEAT
Heartbeat event - Used to keep the SSE connection alive.This event type is sent periodically to prevent connection timeouts and to verify that the connection is still active. Clients can use this to detect disconnections.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-