Class OutboundSseEventImpl
- All Implemented Interfaces:
OutboundSseEvent,SseEvent
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface jakarta.ws.rs.sse.OutboundSseEvent
OutboundSseEvent.Builder -
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.getData()Get event data.Get generic data type.getId()Get event identifier.Getmedia typeof the event data.getName()Get event name.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.Class<?>getType()Get data type.booleanisEscape()booleanbooleanCheck if the connection retry time has been set in the event.voidvoidsetMediaType(MediaType mediaType)
-
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. -
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.
-
getType
Description copied from interface:OutboundSseEventGet data type.This information is used to select a proper
MessageBodyWriterto be used for serializing theevent data.- Specified by:
getTypein interfaceOutboundSseEvent- Returns:
- data type. May return
null, if the event does not contain any data.
-
getGenericType
Description copied from interface:OutboundSseEventGet generic data type.This information is used to select a proper
MessageBodyWriterto be used for serializing theevent data.- Specified by:
getGenericTypein interfaceOutboundSseEvent- Returns:
- generic data type. May return
null, if the event does not contain any data.
-
getMediaType
Description copied from interface:OutboundSseEventGetmedia typeof the event data.This information is used to a select proper
MessageBodyWriterto be used for serializing theevent data.- Specified by:
getMediaTypein interfaceOutboundSseEvent- Returns:
- data
MediaType.
-
isMediaTypeSet
public boolean isMediaTypeSet() -
setMediaType
-
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.
-
getData
Description copied from interface:OutboundSseEventGet event data.The event data, if specified, are serialized and sent as one or more SSE event
"data"fields (depending on the line breaks in the actual serialized data content). The data are serialized using an availableMessageBodyWriterthat is selected based on the eventtype,OutboundSseEvent.getGenericType()generic type} andOutboundSseEvent.getMediaType()media type}.- Specified by:
getDatain interfaceOutboundSseEvent- Returns:
- event data. May return
null, if the event does not contain any data.
-
isEscape
public boolean isEscape() -
setEscape
-