new Notification()
For extensibility, developers can implement a class extended from the
Notification class,
to make it more suitable to handle the notification event types according the Subscribe/Notify application.
wsc.MessageSummary provides an example of extending the Notification class.
In a default implementation of wsc.MessageAlertPackage, an object of MessageSummary
is created when a notification
message is received. This MessageSummary object will be delivered to an application
as a parameter in the event handler wsc.Subscription#event:onNotification.
If the received notification messages are not the event type message summary, a
Notification class object
is created and delivered to the application as the parameter in the event handler
wsc.Subscription#event:onNotification.
This notification object can be used to instantiate the object of the extended class,
which may have methods to parse
the corresponding type of notification messages.
Methods
-
getContent() → {JSON}
-
Gets the message content of the notification.
Returns:
message content
- Type
- JSON
-
getReceiver() → {String}
-
Gets the user identity of the notification receiver.
Returns:
receiver Identity of the notification receiver
- Type
- String
-
getSender() → {String}
-
Gets the service identity of the subscription.
Returns:
sender Identity of the notification sender.
- Type
- String