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 |
---|---|
String |
getComment()
Get a comment string that accompanies the event.
|
String |
getId()
Get event identifier.
|
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.String getId()
Contains value of SSE "id"
field. This field is optional. Method may return null
, if the event
identifier is not specified.
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.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.Copyright © 2019 Eclipse Foundation.
Use is subject to license terms.