Class DefaultTopicTreeHandler
The default ITopicTreeHandler implementation.
Inheritance
Implements
Namespace: PushTechnology.ClientInterface.Client.Callbacks
Assembly: Diffusion.Client.dll
Syntax
public class DefaultTopicTreeHandler : object, ITopicTreeHandler
Remarks
This simply logs OnRegistered(String, IRegistration) and OnClose(String) calls at 'debug' level and OnError(String, ErrorReason) calls at 'warn' level. This can be overridden to perform some more specific action.
Methods
OnClose(String)
Called if the handler is closed.
Declaration
public virtual void OnClose(string topicPath)
Parameters
Type | Name | Description |
---|---|---|
String | topicPath | The branch of the topic tree for which the handler was registered. |
Remarks
The handler will be closed if the session is closed after the handler has been registered, or if the handler is unregistered using CloseAsync().
No further calls will be made for the handler.
OnError(String, ErrorReason)
Notification of a contextual error related to this handler.
Declaration
public virtual void OnError(string topicPath, ErrorReason errorReason)
Parameters
Type | Name | Description |
---|---|---|
String | topicPath | The branch of the topic tree for which the handler was registered. |
ErrorReason | errorReason | The reason for the error. |
Remarks
Situations in which this method 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.
OnRegistered(String, IRegistration)
Called when the handler has been successfully registered with the server.
Declaration
public virtual void OnRegistered(string topicPath, IRegistration registration)
Parameters
Type | Name | Description |
---|---|---|
String | topicPath | The path that the handler is active for. |
IRegistration | registration | The registration that is able to close the handler. |
Remarks
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 using the CloseAsync().