Interface ClusterEvent
- All Known Implementing Classes:
ClusterEvent.EntityChanged,ClusterEvent.Notification,ClusterEvent.Presence,ClusterEvent.ProcessTasksChanged
ClusterEventBus.
It is a sealed family discriminated by kind(): each permitted variant
is a distinct payload shape that shares the one bus channel without a wire break. ClusterEvent.EntityChanged
mirrors su.onno.events.EntityChangedEvent; future kinds add a sibling record and a new
KIND_* tag, and receivers switch on the type.
The variants are kept as plain strings with no Jackson annotations so the core module stays free of
spring-context and Jackson — the ClusterEventBus implementation owns the JSON encoding,
writing the kind() tag explicitly so a receiver can pick the right variant (see
PostgresClusterEventBus).
originNodeId() is the id of the node that published the event. A bus delivers an event back
to its own subscribers (Postgres NOTIFY echoes to the publisher's LISTEN), so receivers
drop events whose origin equals their own node id: the originating node already fanned the change out to
its local SSE clients synchronously.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordAn entity create/update/delete/post notice mirroring the fields ofsu.onno.events.EntityChangedEvent.static final recordA per-user notification raised on one node whose recipient may be connected to another.static final recordA user-presence notice for record-level collaboration markers: one user has entered, refreshed, or left the live view of a specific record.static final recordA process mutation changed which task rows are visible to one or more users or roles. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringkind()tag for aClusterEvent.Notificationnotice — a per-user notification to wake on a peer node.static final Stringkind()tag for aClusterEvent.Presencenotice — a user entering/leaving a record's live view.static final Stringkind()tag for an audience-scoped process-task inbox invalidation. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClusterEvent.EntityChangedentityChanged(String changeType, String entityType, String entityName, String id, String naturalKey) Build anClusterEvent.EntityChangedevent with nooriginNodeId()set — the publishingClusterEventBusstamps that duringClusterEventBus.publish(su.onno.cluster.ClusterEvent).kind()The payload-shape tag identifying which permitted variant this event is.static ClusterEvent.Notificationnotification(String recipientId, String notificationId, String type, String title, String body, String link, String actorName) Build aClusterEvent.Notificationevent with nooriginNodeId()set — the publishingClusterEventBusstamps that duringClusterEventBus.publish(su.onno.cluster.ClusterEvent).The publishing node's id, used by receivers to filter out their own echoes.static ClusterEvent.Presencepresence(String action, String entityType, String entityName, String id, String userId, String displayName, String avatarUrl) Build aClusterEvent.Presenceevent with nooriginNodeId()set — the publishingClusterEventBusstamps that duringClusterEventBus.publish(su.onno.cluster.ClusterEvent).Build an audience-scoped process-task inbox invalidation.withOrigin(String originNodeId) A copy of this event withoriginNodeId()set — used by a bus to stamp its identity on send.
-
Field Details
-
KIND_ENTITY_CHANGED
- See Also:
-
KIND_PRESENCE
kind()tag for aClusterEvent.Presencenotice — a user entering/leaving a record's live view.- See Also:
-
KIND_NOTIFICATION
kind()tag for aClusterEvent.Notificationnotice — a per-user notification to wake on a peer node.- See Also:
-
KIND_PROCESS_TASKS_CHANGED
kind()tag for an audience-scoped process-task inbox invalidation.- See Also:
-
-
Method Details
-
kind
String kind()The payload-shape tag identifying which permitted variant this event is. -
originNodeId
String originNodeId()The publishing node's id, used by receivers to filter out their own echoes.nulluntil the publishingClusterEventBusstamps it viawithOrigin(String)onpublish. -
withOrigin
A copy of this event withoriginNodeId()set — used by a bus to stamp its identity on send. -
entityChanged
static ClusterEvent.EntityChanged entityChanged(String changeType, String entityType, String entityName, String id, String naturalKey) Build anClusterEvent.EntityChangedevent with nooriginNodeId()set — the publishingClusterEventBusstamps that duringClusterEventBus.publish(su.onno.cluster.ClusterEvent). This is the form the change-relay constructs, so it never needs to know the local node id. -
presence
static ClusterEvent.Presence presence(String action, String entityType, String entityName, String id, String userId, String displayName, String avatarUrl) Build aClusterEvent.Presenceevent with nooriginNodeId()set — the publishingClusterEventBusstamps that duringClusterEventBus.publish(su.onno.cluster.ClusterEvent). -
notification
static ClusterEvent.Notification notification(String recipientId, String notificationId, String type, String title, String body, String link, String actorName) Build aClusterEvent.Notificationevent with nooriginNodeId()set — the publishingClusterEventBusstamps that duringClusterEventBus.publish(su.onno.cluster.ClusterEvent). Carries enough to paint the notification on the recipient's other-node browsers without a refetch; a receiver that gets onlyrecipientId(its richer fields dropped to fit the payload cap) refetches instead. -
processTasksChanged
static ClusterEvent.ProcessTasksChanged processTasksChanged(String instanceId, Set<String> audienceUsers, Set<String> audienceRoles) Build an audience-scoped process-task inbox invalidation. It carries no task data: eligible browsers re-read their own authenticated inbox from the shared durable store.
-