public static class TopicTreeHandler.Default extends Object implements TopicTreeHandler
The methods on this handler log callbacks at debug level.
TopicTreeHandler.Default
Constructor and Description |
---|
Default() |
Modifier and Type | Method and Description |
---|---|
void |
onClose(String topicPath)
Called if the handler is closed.
|
void |
onError(String topicPath,
ErrorReason errorReason)
Notification of a contextual error related to this handler.
|
void |
onRegistered(String topicPath,
Registration registration)
Called when the handler has been successfully registered with the server.
|
public void onRegistered(String topicPath, Registration registration)
TopicTreeHandler
A session can register a single handler of each type for a given branch
of the topic tree. If there is already a handler registered for the topic
path the operation will fail, registration
will be closed,
and the session error handler will be notified. To change the handler,
first close
the previous handler.
onRegistered
in interface TopicTreeHandler
topicPath
- the path that the handler is active forregistration
- allows the handler to be closedpublic void onClose(String topicPath)
TopicTreeHandler
close
.
No further calls will be made for the handler.
onClose
in interface TopicTreeHandler
topicPath
- the branch of the topic tree for which the handler was
registeredpublic void onError(String topicPath, ErrorReason errorReason)
TopicTreeHandler
onError
is called include the session being closed before the
handler is registered, a communication timeout, or a problem with the
provided parameters. No further calls will be made to this handler.onError
in interface TopicTreeHandler
topicPath
- the branch of the topic tree for which the handler was
registerederrorReason
- a value representing the error; this can be one of
constants defined in ErrorReason
, or a feature-specific
reasonCopyright © 2020 Push Technology Ltd. All Rights Reserved.