Used on the server side, when creating and sending an event to a client or when broadcasting.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | OutboundSseEvent.Builder
A builder class used for creating |
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: event data. May returnnull, if the event does not contain any data.Get event data. |
| public Type | Returns: generic data type. May returnnull, if the event does not contain any data.Get generic data type. |
| public MediaType | |
| public Class |
| getData | back to summary |
|---|---|
| public Object getData() Get event data.
The event data, if specified, are serialized and sent as one or more SSE event
| |
| getGenericType | back to summary |
|---|---|
| public Type getGenericType() Get generic data type.
This information is used to select a proper
| |
| getMediaType | back to summary |
|---|---|
| public MediaType getMediaType() Get
This information is used to a select proper | |
| getType | back to summary |
|---|---|
| public Class Get data type.
This information is used to select a proper
| |
OutboundSseEvent instances.
| Modifier and Type | Method and Description |
|---|---|
| public OutboundSseEvent | |
| public OutboundSseEvent. | |
| public OutboundSseEvent. | |
| public OutboundSseEvent. | Returns: updated builder instance.generic type of supplied data. Must not be type, Object null.event data. Must not be data)null.Set event data and a generic java type of event data. |
| public OutboundSseEvent. | |
| public OutboundSseEvent. | |
| public OutboundSseEvent. | Returns: updated builder instance.MediaType of event data. Must not be null.Set the |
| public OutboundSseEvent. | |
| public OutboundSseEvent. | Returns: updated builder instance.reconnection delay in milliseconds. Negative values un-set the reconnection delay. milliseconds)Set reconnection delay (in milliseconds) that indicates how long the event receiver should wait before attempting to reconnect in case a connection to SSE event source is lost. |
| build | back to summary |
|---|---|
| public OutboundSseEvent build() Build There are two valid configurations:
| |
| comment | back to summary |
|---|---|
| public OutboundSseEvent. Set comment string associated with the event. The comment will be serialized with the event, before event data are serialized. If the event does not contain any data, a separate "event" that contains only the comment will be sent. This information is optional, provided the event data are set. Note that multiple invocations of this method result in a previous comment being replaced with a new one. To achieve multi-line comments, a multi-line comment string has to be used.
| |
| data | back to summary |
|---|---|
| public OutboundSseEvent. Set event data and java type of event data.
Type information will be used for Note that multiple invocations of this method result in previous even data being replaced with new one.
| |
| data | back to summary |
|---|---|
| public OutboundSseEvent. Set event data and a generic java type of event data.
Type information will be used for Note that multiple invocations of this method result in previous even data being replaced with new one.
| |
| data | back to summary |
|---|---|
| public OutboundSseEvent. Set event data and java type of event data.
This is a convenience method that derives the event data type information from the runtime type of
the event data. The supplied event data may be represented as Note that multiple invocations of this method result in previous even data being replaced with new one.
| |
| id | back to summary |
|---|---|
| public OutboundSseEvent. Set the event id.
Will be send as a value of the SSE
| |
| mediaType | back to summary |
|---|---|
| public OutboundSseEvent. Set the
This information is mandatory. The default value is
| |
| name | back to summary |
|---|---|
| public OutboundSseEvent. Set event name.
Will be send as a value of the SSE
| |
| reconnectDelay | back to summary |
|---|---|
| public OutboundSseEvent. Set reconnection delay (in milliseconds) that indicates how long the event receiver should wait before attempting to reconnect in case a connection to SSE event source is lost.
Will be send as a value of the SSE
Absence of a value of this field in an
| |