Class InboundSseEventImpl

java.lang.Object
org.jboss.resteasy.plugins.providers.sse.InboundSseEventImpl
All Implemented Interfaces:
InboundSseEvent, SseEvent

public class InboundSseEventImpl extends Object implements InboundSseEvent
  • Method Details

    • getName

      public String getName()
      Description copied from interface: SseEvent
      Get event name.

      Contains value of SSE "event" field. This field is optional. Method may return null, if the event name is not specified.

      Specified by:
      getName in interface SseEvent
      Returns:
      event name, or null if not set.
    • getId

      public String getId()
      Description copied from interface: SseEvent
      Get event identifier.

      Contains value of SSE "id" field. This field is optional. Method may return null, if the event identifier is not specified.

      Specified by:
      getId in interface SseEvent
      Returns:
      event id.
    • getComment

      public String getComment()
      Description copied from interface: SseEvent
      Get 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:
      getComment in interface SseEvent
      Returns:
      comment associated with the event.
    • getReconnectDelay

      public long getReconnectDelay()
      Description copied from interface: SseEvent
      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.

      Contains value of SSE "retry" field. This field is optional. Method returns SseEvent.RECONNECT_NOT_SET if no value has been set.

      Specified by:
      getReconnectDelay in interface SseEvent
      Returns:
      reconnection delay in milliseconds or SseEvent.RECONNECT_NOT_SET if no value has been set.
    • isReconnectDelaySet

      public boolean isReconnectDelaySet()
      Description copied from interface: SseEvent
      Check if the connection retry time has been set in the event.
      Specified by:
      isReconnectDelaySet in interface SseEvent
      Returns:
      true if new reconnection delay has been set in the event, false otherwise.
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: InboundSseEvent
      Check if the event is empty (i.e. does not contain any data).
      Specified by:
      isEmpty in interface InboundSseEvent
      Returns:
      true if current instance does not contain any data, false otherwise.
    • readData

      public String readData()
      Description copied from interface: InboundSseEvent
      Get the original event data as String.
      Specified by:
      readData in interface InboundSseEvent
      Returns:
      event data de-serialized into a string.
    • readData

      public <T> T readData(Class<T> type)
      Description copied from interface: InboundSseEvent
      Read event data as a given Java type.
      Specified by:
      readData in interface InboundSseEvent
      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

      public <T> T readData(GenericType<T> type)
      Description copied from interface: InboundSseEvent
      Read event data as a given generic type.
      Specified by:
      readData in interface InboundSseEvent
      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

      public <T> T readData(Class<T> messageType, MediaType mediaType)
      Description copied from interface: InboundSseEvent
      Read event data as a given Java type.
      Specified by:
      readData in interface InboundSseEvent
      Type Parameters:
      T - generic event data type
      Parameters:
      messageType - Java type to be used for event data de-serialization.
      mediaType - media type to be used for event data de-serialization.
      Returns:
      event data de-serialized as an instance of a given type.
    • readData

      public <T> T readData(GenericType<T> type, MediaType mediaType)
      Description copied from interface: InboundSseEvent
      Read event data as a given generic type.
      Specified by:
      readData in interface InboundSseEvent
      Type Parameters:
      T - generic event data type
      Parameters:
      type - generic type to be used for event data de-serialization.
      mediaType - media type to be used for event data de-serialization.
      Returns:
      event data de-serialized as an instance of a given type.
    • getRawData

      public byte[] getRawData()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getMediaType

      public MediaType getMediaType()