Top Description Fields Methods
javax.ws.rs.sse

public Interface SseEvent

Known Direct Subinterfaces
javax.ws.rs.sse.InboundSseEvent, javax.ws.rs.sse.OutboundSseEvent

Base Server Sent Event definition.

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).

Author
Marek Potociar
Since
2.1

Field Summary

Modifier and TypeField and Description
public static final long
RECONNECT_NOT_SET

A "reconnection not set" value for the SSE reconnect delay set via SSE event retry field.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

comment associated with the event.
getComment
()

Get a comment string that accompanies the event.

public String

Returns:

event id.
getId
()

Get event identifier.

public String

Returns:

event name, or null if not set.
getName
()

Get event name.

public long

Returns:

reconnection delay in milliseconds or RECONNECT_NOT_SET if no value has been set.
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.

public boolean

Returns:

true if new reconnection delay has been set in the event, false otherwise.
isReconnectDelaySet
()

Check if the connection retry time has been set in the event.

Field Detail

RECONNECT_NOT_SETback to summary
public static final long RECONNECT_NOT_SET

A "reconnection not set" value for the SSE reconnect delay set via SSE event retry field.

Method Detail

getCommentback to summary
public String getComment()

Get a comment string that accompanies the event.

Contains value of the comment associated with SSE event. This field is optional. Method may return null, if the event comment is not specified.

Returns:String

comment associated with the event.

getIdback to summary
public String getId()

Get event identifier.

Contains value of SSE "id" field. This field is optional. Method may return null, if the event identifier is not specified.

Returns:String

event id.

getNameback to summary
public String getName()

Get event name.

Contains value of SSE "event" field. This field is optional. Method may return null, if the event name is not specified.

Returns:String

event name, or null if not set.

getReconnectDelayback to summary
public 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.

Contains value of SSE "retry" field. This field is optional. Method returns RECONNECT_NOT_SET if no value has been set.

Returns:long

reconnection delay in milliseconds or RECONNECT_NOT_SET if no value has been set.

isReconnectDelaySetback to summary
public boolean isReconnectDelaySet()

Check if the connection retry time has been set in the event.

Returns:boolean

true if new reconnection delay has been set in the event, false otherwise.