Class PresenceController

java.lang.Object
su.onno.ui.presence.PresenceController

@RestController @RequestMapping("/api/presence") public class PresenceController extends Object
Route-level presence: tracks which signed-in users are currently on each route — a record, an entity list, or any other page (dashboards, custom pages) — so the UI can show collaboration markers ("Ada and Babbage are also here") on the open tab, list rows, and the sidebar nav.

The client posts the pane's route path; the server derives the presence identity from it. A catalogs/documents route is gated on the owning entity's read access (so you only register on, and learn about, records/lists you may read), while any other route is a page visible to any signed-in user. Identity is stamped from the authenticated principal via CurrentUserResolver, so the client never asserts who it is. The client posts enter on open, heartbeat periodically, and leave on close; the response returns the route's current viewers plus you, the caller's own id, so the client can omit itself.

  • Constructor Details

  • Method Details

    • ping

      @PostMapping public Map<String,Object> ping(@RequestBody(required=false) PresenceController.PresenceRequest request, Principal principal)
    • snapshot

      @GetMapping public Map<String,Object> snapshot(Principal principal)
      The ambient-presence snapshot: every route currently being viewed, as {kind, name, id, viewers}, plus the caller's own id (you). The client loads this once, then keeps it current from the live presence SSE deltas. Entity routes are filtered to those the caller may read (you never learn that someone is viewing a record/list in an entity you can't open); page routes are visible to any signed-in user.