Class OutboundSseEventImpl
- java.lang.Object
-
- org.jboss.resteasy.plugins.providers.sse.OutboundSseEventImpl
-
- All Implemented Interfaces:
OutboundSseEvent,SseEvent
public class OutboundSseEventImpl extends Object implements OutboundSseEvent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOutboundSseEventImpl.BuilderImpl-
Nested 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetComment()Get a comment string that accompanies the event.ObjectgetData()Get event data.TypegetGenericType()Get generic data type.StringgetId()Get event identifier.MediaTypegetMediaType()Getmedia typeof the event data.StringgetName()Get event name.longgetReconnectDelay()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.Class<?>getType()Get data type.booleanisEscape()booleanisMediaTypeSet()booleanisReconnectDelaySet()Check if the connection retry time has been set in the event.voidsetEscape(Boolean escape)voidsetMediaType(MediaType mediaType)
-
-
-
Method Detail
-
getName
public String 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
public String 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
public Class<?> 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
public Type 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
public MediaType 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
public void setMediaType(MediaType mediaType)
-
getComment
public String 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
public Object 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
public void setEscape(Boolean escape)
-
-