Package su.onno.cluster
Record Class ClusterEvent.Notification
java.lang.Object
java.lang.Record
su.onno.cluster.ClusterEvent.Notification
- Record Components:
originNodeId- the publishing node's id, ornullbefore a bus stamps it.recipientId- the target user's identity record id (or username for an unlinked login).notificationId- the stored notification's id, so a receiver can de-duplicate against a refetch.type- the notification type tag (mention/assignment/…), ornull.title- the short headline, ornullwhen trimmed to fit the payload cap.body- the longer text, ornullwhen absent or trimmed.link- thekind/name/idroute the notification opens, ornull.actorName- who triggered it, for display, ornull.
- All Implemented Interfaces:
ClusterEvent
- Enclosing interface:
ClusterEvent
public static record ClusterEvent.Notification(String originNodeId, String recipientId, String notificationId, String type, String title, String body, String link, String actorName)
extends Record
implements ClusterEvent
A per-user notification raised on one node whose recipient may be connected to another. Unlike
ClusterEvent.EntityChanged/ClusterEvent.Presence, the durable copy already lives in the shared
onno_notifications table, so the cross-node event exists only to wake the recipient's
live streams on peer nodes: a receiver pushes it to any local SSE stream owned by
recipientId. The richer fields ride along so a peer can paint the row without a refetch; if
they were dropped to fit the payload cap only recipientId survives and the browser refetches.-
Nested Class Summary
Nested classes/interfaces inherited from interface su.onno.cluster.ClusterEvent
ClusterEvent.EntityChanged, ClusterEvent.Notification, ClusterEvent.Presence, ClusterEvent.ProcessTasksChanged -
Field Summary
Fields inherited from interface su.onno.cluster.ClusterEvent
KIND_ENTITY_CHANGED, KIND_NOTIFICATION, KIND_PRESENCE, KIND_PROCESS_TASKS_CHANGED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theactorNamerecord component.body()Returns the value of thebodyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.kind()The payload-shape tag identifying which permitted variant this event is.link()Returns the value of thelinkrecord component.Returns the value of thenotificationIdrecord component.Returns the value of theoriginNodeIdrecord component.Returns the value of therecipientIdrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.withOrigin(String originNodeId) A copy of this event withClusterEvent.originNodeId()set — used by a bus to stamp its identity on send.
-
Constructor Details
-
Notification
public Notification(String originNodeId, String recipientId, String notificationId, String type, String title, String body, String link, String actorName) Creates an instance of aNotificationrecord class.- Parameters:
originNodeId- the value for theoriginNodeIdrecord componentrecipientId- the value for therecipientIdrecord componentnotificationId- the value for thenotificationIdrecord componenttype- the value for thetyperecord componenttitle- the value for thetitlerecord componentbody- the value for thebodyrecord componentlink- the value for thelinkrecord componentactorName- the value for theactorNamerecord component
-
-
Method Details
-
kind
Description copied from interface:ClusterEventThe payload-shape tag identifying which permitted variant this event is.- Specified by:
kindin interfaceClusterEvent
-
withOrigin
Description copied from interface:ClusterEventA copy of this event withClusterEvent.originNodeId()set — used by a bus to stamp its identity on send.- Specified by:
withOriginin interfaceClusterEvent
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
originNodeId
Returns the value of theoriginNodeIdrecord component.- Specified by:
originNodeIdin interfaceClusterEvent- Returns:
- the value of the
originNodeIdrecord component
-
recipientId
Returns the value of therecipientIdrecord component.- Returns:
- the value of the
recipientIdrecord component
-
notificationId
Returns the value of thenotificationIdrecord component.- Returns:
- the value of the
notificationIdrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
link
Returns the value of thelinkrecord component.- Returns:
- the value of the
linkrecord component
-
actorName
Returns the value of theactorNamerecord component.- Returns:
- the value of the
actorNamerecord component
-