The classic client API will be removed in a future release.
@Deprecated public interface TopicNotifyTopicHandler
This is an object which is used to send commands to a 'Topic Notify' Topic.
(see
TopicNotifyTopicData
). The handler simplifies the use of such a Topic and
avoids having to format messages to send to the Topic or parse messages
received from it.
Such a handler is created using
ServerConnection.createTopicNotifyTopicHandler(TopicMessage, TopicNotifyTopicListener)
and all notifications from the Topic will be routed through the supplied
listener.
When such a handler is in use then messages received on the Topic will not be
delivered via normal listener mechanisms but will be parsed and notified to
the TopicNotifyTopicListener
specified.
After creating the handler the required notification detail should be
specified using
setNotificationDetails(NotificationLevel, boolean, boolean)
.
After setting the notification detail required then specify the range of
topics that notifications are required for. This is done using the
select(SelectionMode, TopicSet)
method which may be used to add,
replace, remove or clear selections.
Modifier and Type | Interface and Description |
---|---|
static class |
TopicNotifyTopicHandler.NotificationLevel
Deprecated.
Specifies the level of add notification that the client wishes to
receive.
|
static class |
TopicNotifyTopicHandler.SelectionMode
Deprecated.
Specifies the mode when selecting topic ranges for notification.
|
Modifier and Type | Method and Description |
---|---|
ServerConnection |
getConnection()
Deprecated.
Returns the client connection.
|
TopicNotifyTopicHandler.NotificationLevel |
getNotificationLevel()
Deprecated.
Returns the current add notification level.
|
boolean |
isNotifyingRemoval()
Deprecated.
Indicates whether notifying topic removals.
|
boolean |
isNotifyingUpdate()
Deprecated.
Indicates whether notifying topic property updates
|
void |
select(TopicNotifyTopicHandler.SelectionMode mode,
TopicSet selections)
Deprecated.
Sends a request to the server to update the selection of topics that
topic add notifications will be received for.
|
void |
setNotificationDetails(TopicNotifyTopicHandler.NotificationLevel addLevel,
boolean notifyRemoval,
boolean notifyUpdate)
Deprecated.
This can be used to set the notification details required.
|
void |
setNotificationLevel(TopicNotifyTopicHandler.NotificationLevel level)
Deprecated.
|
ServerConnection getConnection()
@Deprecated void setNotificationLevel(TopicNotifyTopicHandler.NotificationLevel level) throws APIException
setNotificationDetails(NotificationLevel, boolean, boolean)
This will send a message to the server requesting a change in the notification level to that specified but with no deletions and no updates.
level
- the new notification levelAPIException
- if unable to set the levelvoid setNotificationDetails(TopicNotifyTopicHandler.NotificationLevel addLevel, boolean notifyRemoval, boolean notifyUpdate) throws APIException
If this is not called then the default will be
TopicNotifyTopicHandler.NotificationLevel.MINIMUM
with no deletions or updates notified.
This will send a message to the server requesting a change in the
notification level and therefore should ideally be called before any call
to select(SelectionMode, TopicSet)
otherwise the effect will be
delayed.
addLevel
- the required notification level for add notificationsnotifyRemoval
- true to request notifications of topic removalsnotifyUpdate
- true to request notifications of updates to those
topic properties that can be changed after the topic as been
created.APIException
- if unable to set the detailsTopicNotifyTopicHandler.NotificationLevel getNotificationLevel()
boolean isNotifyingRemoval()
boolean isNotifyingUpdate()
void select(TopicNotifyTopicHandler.SelectionMode mode, TopicSet selections) throws APIException
As this is an asynchronous request to the server the update may not take effect immediately.
Upon receiving the new selection set the server will check if there are any existing topics that match the selections (that did not match before) and send a separate add notification for each one. New topics that match the selections will be notified as and when they are added.
mode
- indicates the mode of the requested update which can be to
add to current selections, replace all current selections or to
remove some or all current selections.selections
- A set of topic selector patterns which specifies the
topic selections to update.APIException
- if unable to change selectionsCopyright © 2016 Push Technology Ltd. All Rights Reserved.