Interface OutboundSseEvent

  • All Superinterfaces:
    SseEvent

    public interface OutboundSseEvent
    extends SseEvent
    Representation of a single outbound Server-sent event.

    Used on the server side, when creating and sending an event to a client or when broadcasting.

    Since:
    2.1
    Author:
    Marek Potociar
    • Method Detail

      • getType

        Class<?> getType()
        Get data type.

        This information is used to select a proper MessageBodyWriter to be used for serializing the event data.

        Returns:
        data type. May return null, if the event does not contain any data.
      • getGenericType

        Type getGenericType()
        Get generic data type.

        This information is used to select a proper MessageBodyWriter to be used for serializing the event data.

        Returns:
        generic data type. May return null, if the event does not contain any data.
      • getData

        Object getData()
        Get 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 available MessageBodyWriter that is selected based on the event type, getGenericType() generic type} and getMediaType() media type}.

        Returns:
        event data. May return null, if the event does not contain any data.