Class OutboundSseEventBodyWriter

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyWriter<javax.ws.rs.sse.OutboundSseEvent>

    @Provider
    public class OutboundSseEventBodyWriter
    extends Object
    implements javax.ws.rs.ext.MessageBodyWriter<javax.ws.rs.sse.OutboundSseEvent>
    • Field Detail

      • SERVER_SENT_EVENTS_TYPE

        public static final javax.ws.rs.core.MediaType SERVER_SENT_EVENTS_TYPE
    • Constructor Detail

      • OutboundSseEventBodyWriter

        protected OutboundSseEventBodyWriter()
    • Method Detail

      • isWriteable

        public boolean isWriteable​(Class<?> cls,
                                   Type type,
                                   Annotation[] anns,
                                   javax.ws.rs.core.MediaType mt)
        Specified by:
        isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<javax.ws.rs.sse.OutboundSseEvent>
      • writeTo

        public void writeTo​(javax.ws.rs.sse.OutboundSseEvent p,
                            Class<?> cls,
                            Type t,
                            Annotation[] anns,
                            javax.ws.rs.core.MediaType mt,
                            javax.ws.rs.core.MultivaluedMap<String,​Object> headers,
                            OutputStream os)
                     throws IOException,
                            javax.ws.rs.WebApplicationException
        Specified by:
        writeTo in interface javax.ws.rs.ext.MessageBodyWriter<javax.ws.rs.sse.OutboundSseEvent>
        Throws:
        IOException
        javax.ws.rs.WebApplicationException
      • getSize

        public long getSize​(javax.ws.rs.sse.OutboundSseEvent t,
                            Class<?> type,
                            Type genericType,
                            Annotation[] annotations,
                            javax.ws.rs.core.MediaType mediaType)
        Specified by:
        getSize in interface javax.ws.rs.ext.MessageBodyWriter<javax.ws.rs.sse.OutboundSseEvent>