public class InboundSseEventImpl extends Object implements InboundSseEvent
RECONNECT_NOT_SET
Modifier and Type | Method and Description |
---|---|
String |
getComment()
Get a comment string that accompanies the event.
|
String |
getId()
Get event identifier.
|
MediaType |
getMediaType() |
String |
getName()
Get event name.
|
byte[] |
getRawData() |
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 |
isEmpty()
Check if the event is empty (i.e.
|
boolean |
isReconnectDelaySet()
Check if the connection retry time has been set in the event.
|
String |
readData()
Get the original event data as
String . |
<T> T |
readData(Class<T> type)
Read event data as a given Java type.
|
<T> T |
readData(Class<T> messageType,
MediaType mediaType)
Read event data as a given Java type.
|
<T> T |
readData(GenericType<T> type)
Read event data as a given generic type.
|
<T> T |
readData(GenericType<T> type,
MediaType mediaType)
Read event data as a given generic type.
|
String |
toString() |
public String getName()
SseEvent
Contains value of SSE "event"
field. This field is optional. Method may return null
, if the event
name is not specified.
public String getId()
SseEvent
Contains value of SSE "id"
field. This field is optional. Method may return null
, if the event
identifier is not specified.
public String getComment()
SseEvent
Contains value of the comment associated with SSE event. This field is optional. Method may return null
,
if the event comment is not specified.
getComment
in interface SseEvent
public long getReconnectDelay()
SseEvent
Contains value of SSE "retry"
field. This field is optional. Method returns SseEvent.RECONNECT_NOT_SET
if no value has been set.
getReconnectDelay
in interface SseEvent
SseEvent.RECONNECT_NOT_SET
if no value has been set.public boolean isReconnectDelaySet()
SseEvent
isReconnectDelaySet
in interface SseEvent
true
if new reconnection delay has been set in the event, false
otherwise.public boolean isEmpty()
InboundSseEvent
isEmpty
in interface InboundSseEvent
true
if current instance does not contain any data, false
otherwise.public String readData()
InboundSseEvent
String
.readData
in interface InboundSseEvent
public <T> T readData(Class<T> type)
InboundSseEvent
readData
in interface InboundSseEvent
type
- Java type to be used for event data de-serialization.public <T> T readData(GenericType<T> type)
InboundSseEvent
readData
in interface InboundSseEvent
type
- generic type to be used for event data de-serialization.public <T> T readData(Class<T> messageType, MediaType mediaType)
InboundSseEvent
readData
in interface InboundSseEvent
messageType
- Java type to be used for event data de-serialization.mediaType
- media type
to be used for event data de-serialization.public <T> T readData(GenericType<T> type, MediaType mediaType)
InboundSseEvent
readData
in interface InboundSseEvent
type
- generic type to be used for event data de-serialization.mediaType
- media type
to be used for event data de-serialization.public byte[] getRawData()
public MediaType getMediaType()
Copyright © 2021 JBoss by Red Hat. All rights reserved.