public interface SseEvent
This interface provides basic properties of the Server Sent Event, namely ID, Name, and Comment. It also provides access to the Reconnect delay property.
SseEvent
is extended by another two interfaces, InboundSseEvent
and OutboundSseEvent
. The
main difference is in how are instances created and how the stored data can be accessed (or provided).
Modifier and Type | Field and Description |
---|---|
static long |
RECONNECT_NOT_SET
A "reconnection not set" value for the SSE reconnect delay set via SSE event
retry field. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getComment()
Get a comment string that accompanies the event.
|
java.lang.String |
getId()
Get event identifier.
|
java.lang.String |
getName()
Get event name.
|
long |
getReconnectDelay()
Get new connection retry time in milliseconds the event receiver should wait before attempting to reconnect after a
connection to the SSE event source is lost.
|
boolean |
isReconnectDelaySet()
Check if the connection retry time has been set in the event.
|
static final long RECONNECT_NOT_SET
retry
field.java.lang.String getId()
Contains value of SSE "id"
field. This field is optional. Method may return null
, if the event
identifier is not specified.
java.lang.String getName()
Contains value of SSE "event"
field. This field is optional. Method may return null
, if the event
name is not specified.
null
if not set.java.lang.String getComment()
Contains value of the comment associated with SSE event. This field is optional. Method may return null
, if
the event comment is not specified.
long getReconnectDelay()
Contains value of SSE "retry"
field. This field is optional. Method returns RECONNECT_NOT_SET
if no
value has been set.
RECONNECT_NOT_SET
if no value has been set.boolean isReconnectDelaySet()
true
if new reconnection delay has been set in the event, false
otherwise.