Class SseBroadcaster<I>

java.lang.Object
org.openhab.core.io.rest.SseBroadcaster<I>
Type Parameters:
I - the type of the SSE event sink specific information
All Implemented Interfaces:
Closeable, AutoCloseable

@NonNullByDefault public class SseBroadcaster<@NonNull I> extends Object implements Closeable
We do not use the SseBroadcaster as it seems registered SseEventSinks are not removed if the peer terminates the connection.
Author:
Markus Rathgeb - Initial contribution
  • Constructor Details

    • SseBroadcaster

      public SseBroadcaster()
  • Method Details

    • addListener

      public void addListener(SseBroadcaster.Listener<@NonNull I> listener)
    • removeListener

      public void removeListener(SseBroadcaster.Listener<@NonNull I> listener)
    • add

      public @Nullable I add(javax.ws.rs.sse.SseEventSink sink, @NonNull I info)
    • remove

      public @Nullable I remove(javax.ws.rs.sse.SseEventSink sink)
    • getInfo

      public @Nullable I getInfo(javax.ws.rs.sse.SseEventSink sink)
    • getInfoIf

      public Stream<I> getInfoIf(Predicate<@NonNull I> predicate)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • send

      public void send(javax.ws.rs.sse.OutboundSseEvent event)
    • sendIf

      public void sendIf(javax.ws.rs.sse.OutboundSseEvent event, Predicate<@NonNull I> predicate)
    • closeAndRemoveIf

      public void closeAndRemoveIf(Predicate<@NonNull I> predicate)