Class StreamController
java.lang.Object
ai.mindconnect.adminui.controller.StreamController
Generic API over the
ActiveStreams registry. Three endpoints,
channel-id-keyed, JSON-only — no SSE-specific semantics. Any feature
that registers a stream in the registry shows up here automatically.
GET /admin/api/streams— list all currently live streams.GET /admin/api/streams/{channelId}— single-stream lookup, 404 if not running.DELETE /admin/api/streams/{channelId}— cooperatively cancel the named stream.
The chat-page renderer uses the single-stream lookup to decide between rendering the Send and Stop button. UIs that show a global "what's running?" indicator would use the list endpoint.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void> Cooperatively cancels the named stream. 204 if a cancel was dispatched (the stream was running and accepted the signal), 404 if no such stream is registered.list()org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.SseEmitter> Reconnect endpoint.
-
Constructor Details
-
StreamController
-
-
Method Details
-
list
-
get
-
cancel
@DeleteMapping("/{channelId}") public org.springframework.http.ResponseEntity<Void> cancel(@PathVariable String channelId) Cooperatively cancels the named stream. 204 if a cancel was dispatched (the stream was running and accepted the signal), 404 if no such stream is registered. -
resume
@GetMapping(value="/{channelId}/sse", produces="text/event-stream") public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.SseEmitter> resume(@PathVariable String channelId, @RequestParam(name="lastSeq",defaultValue="0") long lastSeq) Reconnect endpoint. The client opens a fresh SSE GET on this URL withlastSeqset to the seq of the last event it processed (or 0 for a clean attach). The server replays every event in the channel's ring buffer withseq > lastSeqand then subscribes the emitter to the live feed.Use cases:
- The user pressed F5 or closed/reopened a tab — their original reader is gone, but the server-side run is still going.
- A second tab observing the same session wants to see the turn live.
404 when the stream is no longer registered (already finished).
-