public interface NotificationItem extends Serializable
BasicNotificationItem
for a default implementation, or derive from this class.Modifier and Type | Method and Description |
---|---|
Agent |
getAgent()
The agent the item is to be destined for.
|
Application |
getApplication()
The application of the item.
|
OrgUnit |
getDept()
The department of the item.
|
JSONObject |
getJsonPayload()
Returns the JSON representation that is send to the smartclients.
|
String |
getTopic()
Returns the topic-suffix to use for smartclient publishing.
|
Application getApplication()
Agent getAgent()
Names.EVERYBODY
.OrgUnit getDept()
String getTopic()
Some additional consideration for the topic is required when the agent Names.EVERYBODY
is being used.
In this case, when the topic starts with "/service", each smartclient/cometd session is notified individually, irrespective,
whether the topic has been subscribed to excplicitly or not. When the prefix of the topic does not start with "/service", then
the notification takes place via a single call to all sessions which subscribed the topic.
JSONObject getJsonPayload()
It will generally be called for each client/session to be notified
(if Names.EVERYBODY
is used as agent together with a topic string not starting with
"/service", the method will get called just once per cluster node).
If it returns null, the item will not be delivered to smartclients.
Beware: JSONObjects do not implement Serializable. When using an @enterprise cluster, then at the sending node, do not create instance variables with type JSONObject in derivations of NotificationItems, but use this method to create the proper JSONObject from other instance data at the receiving nodes.
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.