Class InboundSseEventImpl
java.lang.Object
org.jboss.resteasy.plugins.providers.sse.InboundSseEventImpl
- All Implemented Interfaces:
InboundSseEvent,SseEvent
-
Field Summary
Fields inherited from interface jakarta.ws.rs.sse.SseEvent
RECONNECT_NOT_SET -
Method Summary
Modifier and TypeMethodDescriptionGet a comment string that accompanies the event.getId()Get event identifier.getName()Get event name.byte[]longGet 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.booleanisEmpty()Check if the event is empty (i.e. does not contain any data).booleanCheck if the connection retry time has been set in the event.readData()Get the original event data asString.<T> TreadData(GenericType<T> type) Read event data as a given generic type.<T> TreadData(GenericType<T> type, MediaType mediaType) Read event data as a given generic type.<T> TRead event data as a given Java type.<T> TRead event data as a given Java type.toString()
-
Method Details
-
getName
Description copied from interface:SseEventGet event name.Contains value of SSE
"event"field. This field is optional. Method may returnnull, if the event name is not specified. -
getId
Description copied from interface:SseEventGet event identifier.Contains value of SSE
"id"field. This field is optional. Method may returnnull, if the event identifier is not specified. -
getComment
Description copied from interface:SseEventGet 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.- Specified by:
getCommentin interfaceSseEvent- Returns:
- comment associated with the event.
-
getReconnectDelay
public long getReconnectDelay()Description copied from interface:SseEventGet 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 returnsSseEvent.RECONNECT_NOT_SETif no value has been set.- Specified by:
getReconnectDelayin interfaceSseEvent- Returns:
- reconnection delay in milliseconds or
SseEvent.RECONNECT_NOT_SETif no value has been set.
-
isReconnectDelaySet
public boolean isReconnectDelaySet()Description copied from interface:SseEventCheck if the connection retry time has been set in the event.- Specified by:
isReconnectDelaySetin interfaceSseEvent- Returns:
trueif new reconnection delay has been set in the event,falseotherwise.
-
isEmpty
public boolean isEmpty()Description copied from interface:InboundSseEventCheck if the event is empty (i.e. does not contain any data).- Specified by:
isEmptyin interfaceInboundSseEvent- Returns:
trueif current instance does not contain any data,falseotherwise.
-
readData
Description copied from interface:InboundSseEventGet the original event data asString.- Specified by:
readDatain interfaceInboundSseEvent- Returns:
- event data de-serialized into a string.
-
readData
Description copied from interface:InboundSseEventRead event data as a given Java type.- Specified by:
readDatain interfaceInboundSseEvent- Type Parameters:
T- generic event data type- Parameters:
type- Java type to be used for event data de-serialization.- Returns:
- event data de-serialized as an instance of a given type.
-
readData
Description copied from interface:InboundSseEventRead event data as a given generic type.- Specified by:
readDatain interfaceInboundSseEvent- Type Parameters:
T- generic event data type- Parameters:
type- generic type to be used for event data de-serialization.- Returns:
- event data de-serialized as an instance of a given type.
-
readData
Description copied from interface:InboundSseEventRead event data as a given Java type.- Specified by:
readDatain interfaceInboundSseEvent- Type Parameters:
T- generic event data type- Parameters:
messageType- Java type to be used for event data de-serialization.mediaType-media typeto be used for event data de-serialization.- Returns:
- event data de-serialized as an instance of a given type.
-
readData
Description copied from interface:InboundSseEventRead event data as a given generic type.- Specified by:
readDatain interfaceInboundSseEvent- Type Parameters:
T- generic event data type- Parameters:
type- generic type to be used for event data de-serialization.mediaType-media typeto be used for event data de-serialization.- Returns:
- event data de-serialized as an instance of a given type.
-
getRawData
public byte[] getRawData() -
toString
-
getMediaType
-