Class: TopicNotificationListener

TopicNotificationListener

new TopicNotificationListener()

Listener for topic notifications.

Methods

onClose()

Called when the listener is closed. The listener will be closed if the session is closed, or if the listener is closed by the TopicNotificationRegistration

Once closed, no further calls will be made to the listener.

onDescendantNotification(topicPath, type)

Notification for an immediate descendant of a selected topic path. This notifies the presence or absence of a descendant topic that may subsequently be explicitly selected.
Parameters:
Name Type Description
topicPath String the path of the selected immediate descendant
type Session.notifications.TopicNotificationType the type of notification

onError(error)

Notification of a contextual error related to this listener. This is analogous to an Error being thrown. Situations in which onError is called include the session being closed before the listener is registered, a communication timeout, or a problem with the provided parameters. No further calls will be made to this listener.
Parameters:
Name Type Description
error Object The error

onTopicNotification(topicPath, specification, type)

A notification for a selected topic.
Parameters:
Name Type Description
topicPath String the path of the selected topic
specification diffusion.topics.TopicSpecification the specification of the topic that this notification is for
type Session.notifications.TopicNotificationType the type of notification