Package com.onec.ui

Class UiEventPublisher

java.lang.Object
com.onec.ui.UiEventPublisher

public class UiEventPublisher extends Object
Pushes entity-change notifications to browser SseEmitters for live UI updates. It is one listener of the framework's EntityChangedEvent — the single funnel both write paths (the generic controllers and repository.save) publish to (issues #28, #29) — so the live stream reflects programmatic saves too, not just back-office edits.
  • Constructor Details

    • UiEventPublisher

      public UiEventPublisher()
  • Method Details

    • subscribe

      public org.springframework.web.servlet.mvc.method.annotation.SseEmitter subscribe()
    • onEntityChanged

      @EventListener public void onEntityChanged(EntityChangedEvent event)
      Fans an EntityChangedEvent out to every open SSE stream. Registered as a Spring @EventListener, so anything that publishes the event (both write paths) reaches the browser — no direct coupling to the controllers.
    • publish

      public void publish(String type, String entityType, String entityName, Object id)
    • publish

      public void publish(String type, String entityType, String entityName, Object id, String naturalKey)