Top Description Fields Methods
javax.ws.rs.sse

public Interface InboundSseEvent

extends SseEvent
Imports
javax.ws.rs.core.GenericType, .MediaType

Inbound Server-sent event.

Used on the client side, when accepting incoming Server-sent events.

Author
Marek Potociar
Since
2.1

Field Summary

Inherited from javax.ws.rs.sse.SseEvent:
RECONNECT_NOT_SET

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if current instance does not contain any data, false otherwise.
isEmpty
()

Check if the event is empty (i.e. does not contain any data).

public String

Returns:

event data de-serialized into a string.
readData
()

Get the original event data as String.

public <T> T

Returns:

event data de-serialized as an instance of a given type.
readData
(Class<T>
Java type to be used for event data de-serialization.
type
)

Read event data as a given Java type.

public <T> T

Returns:

event data de-serialized as an instance of a given type.
readData
(GenericType<T>
generic type to be used for event data de-serialization.
type
)

Read event data as a given generic type.

public <T> T

Returns:

event data de-serialized as an instance of a given type.
readData
(Class<T>
Java type to be used for event data de-serialization.
messageType
,
MediaType
media type to be used for event data de-serialization.
mediaType
)

Read event data as a given Java type.

public <T> T

Returns:

event data de-serialized as an instance of a given type.
readData
(GenericType<T>
generic type to be used for event data de-serialization.
type
,
MediaType
media type to be used for event data de-serialization.
mediaType
)

Read event data as a given generic type.

Inherited from javax.ws.rs.sse.SseEvent:
getCommentgetIdgetNamegetReconnectDelayisReconnectDelaySet

Method Detail

isEmptyback to summary
public boolean isEmpty()

Check if the event is empty (i.e. does not contain any data).

Returns:boolean

true if current instance does not contain any data, false otherwise.

readDataback to summary
public String readData()

Get the original event data as String.

Returns:String

event data de-serialized into a string.

Exceptions
ProcessingException:
when provided type can't be read. The thrown exception wraps the original cause.
readDataback to summary
public <T> T readData(Class<T> type)

Read event data as a given Java type.

Parameters
type:Class<T>

Java type to be used for event data de-serialization.

Returns:T

event data de-serialized as an instance of a given type.

Exceptions
ProcessingException:
when provided type can't be read. The thrown exception wraps the original cause.
readDataback to summary
public <T> T readData(GenericType<T> type)

Read event data as a given generic type.

Parameters
type:GenericType<T>

generic type to be used for event data de-serialization.

Returns:T

event data de-serialized as an instance of a given type.

Exceptions
ProcessingException:
when provided type can't be read. The thrown exception wraps the original cause.
readDataback to summary
public <T> T readData(Class<T> messageType, MediaType mediaType)

Read event data as a given Java type.

Parameters
messageType:Class<T>

Java type to be used for event data de-serialization.

mediaType:MediaType

media type to be used for event data de-serialization.

Returns:T

event data de-serialized as an instance of a given type.

Exceptions
ProcessingException:
when provided type can't be read. The thrown exception wraps the original cause.
readDataback to summary
public <T> T readData(GenericType<T> type, MediaType mediaType)

Read event data as a given generic type.

Parameters
type:GenericType<T>

generic type to be used for event data de-serialization.

mediaType:MediaType

media type to be used for event data de-serialization.

Returns:T

event data de-serialized as an instance of a given type.

Exceptions
ProcessingException:
when provided type can't be read. The thrown exception wraps the original cause.