Package org.openhab.core.io.rest
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
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
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable I
void
addListener
(SseBroadcaster.Listener<@NonNull I> listener) void
close()
void
closeAndRemoveIf
(Predicate<@NonNull I> predicate) @Nullable I
getInfo
(javax.ws.rs.sse.SseEventSink sink) @Nullable I
remove
(javax.ws.rs.sse.SseEventSink sink) void
removeListener
(SseBroadcaster.Listener<@NonNull I> listener) void
send
(javax.ws.rs.sse.OutboundSseEvent event) void
-
Constructor Details
-
SseBroadcaster
public SseBroadcaster()
-
-
Method Details
-
addListener
-
removeListener
-
add
-
remove
-
getInfo
-
getInfoIf
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
send
public void send(javax.ws.rs.sse.OutboundSseEvent event) -
sendIf
-
closeAndRemoveIf
-