public class NotificationSuite extends Object
Modifier and Type | Method and Description |
---|---|
static NotificationEvent |
createEvent(NotificationItem ni,
short type,
Agent a)
Create a NotificationEvent from a NotificationItem.
|
static void |
disableNotification()
Disables sending of notification for this transaction
Default is enabled.
|
static void |
enableNotification()
Enables sending of notification for this transaction.
|
static boolean |
isNotificationEnabled()
Determine if Notifications are enabled for this transaction.
|
static void |
notifySession(HttpSession session,
String topic,
Map<String,?> payload)
Send a message to smartclients.
|
static void |
notifyUser(User user,
String messageTopic,
Map<String,?> payload)
Send a message to smartclients.
|
static void |
publish(NotificationEvent e)
Publish an event.
|
static void |
publish(NotificationItem ni,
short type)
Publish a NotificationItem.
|
static void |
publish(NotificationItem ni,
short type,
Agent a)
Publish a NotificationItem.
|
static void |
publishImmediate(NotificationEvent e)
Publish an event immediately.
|
static void |
publishImmediate(NotificationItem ni,
short type)
Publish a NotificationItem immediately.
|
static void |
publishImmediate(NotificationItem ni,
short type,
Agent a)
Publish a NotificationItem immediately.
|
static void |
setAvoidAutoNotification(boolean avoidAutoNotification)
Avoid sending of notifications to originating session.
|
static void |
setMeToo(boolean meToo)
Send notifications also to originating session.
|
public static void disableNotification()
public static void enableNotification()
public static boolean isNotificationEnabled()
public static NotificationEvent createEvent(NotificationItem ni, short type, Agent a)
ni
- the item to be contained in the event objecttype
- the event type Names
a
- the agent for which the event is destinedpublic static void publish(NotificationItem ni, short type)
NotificationItem.getAgent()
ni
- the item to publishtype
- the event type Names
public static void publish(NotificationItem ni, short type, Agent a)
ni
- the item to publishtype
- the event type Names
a
- the agent to sent the event to.public static void publish(NotificationEvent e)
e
- public static void publishImmediate(NotificationEvent e) throws Exception
e
- Exception
public static void publishImmediate(NotificationItem ni, short type) throws Exception
NotificationItem.getAgent()
public static void publishImmediate(NotificationItem ni, short type, Agent a) throws Exception
public static void setMeToo(boolean meToo)
This behavior can be changed (for all events in the current transaction), by setting meToo to true.
N.B.:
meToo
is ignored, when avoidAutoNotification
is set.
meToo
is automatically set to true if the changing function has not been called from the main window.
meToo
- true when notifications should also be send to the originating session.public static void setAvoidAutoNotification(boolean avoidAutoNotification)
This behavior can be avoided (for all events in the current transaction), by setting avoidAutoNotification to true. Then,
N.B.: avoidAutoNotification
is stronger than meToo
.
avoidAutoNotification
- true when sending to current session should be avoided.public static void notifyUser(User user, String messageTopic, Map<String,?> payload) throws Exception
user
- the user to notifymessageTopic
- the topic of the messagepayload
- a map that will be used to create the JSONObject. Elements must be Serializable.Exception
public static void notifySession(HttpSession session, String topic, Map<String,?> payload) throws Exception
session
- the session (on this node)topic
- the topic of the messagepayload
- a map that will be used to create the JSONObject. Elements must be Serializable.Exception
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.