Diffusion .NET API  5.9.24
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events Pages
PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl Interface Reference

Represents a feature that provides a client session with the ability to manage topics. More...

Inheritance diagram for PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl:
PushTechnology.ClientInterface.Client.Features.IFeature

Public Member Functions

ITopicSpecification NewSpecification (TopicType topicType)
 Creates a new ITopicSpecification for a given topic type. More...
 
TBuilder CreateDetailsBuilder< TBuilder > ()
 Creates a new topic details builder to create ITopicDetails of a type corresponding to a given builder type. More...
 
ITopicDetails NewDetails (TopicType topicType)
 Returns new topic details of the given type set with all default settings. More...
 
void AddTopic< TContext > (string topicPath, ITopicDetails details, TContext context, ITopicControlAddContextCallback< TContext > callback)
 Sends a request to the server to add a topic. More...
 
void AddTopic< TContext > (string topicPath, ITopicDetails details, IBytes value, TContext context, ITopicControlAddContextCallback< TContext > callback)
 Sends a request to the server to add a topic. More...
 
void AddTopic (string topicPath, ITopicDetails details, ITopicControlAddCallback callback)
 Sends a request to the server to add a topic. More...
 
void AddTopic (string topicPath, ITopicDetails details, IBytes value, ITopicControlAddCallback callback)
 Sends a request to the server to add a topic. More...
 
ITopicDetails AddTopic (string topicPath, TopicType topicType, ITopicControlAddCallback callback)
 Sends a request to the server to add a topic. More...
 
ITopicDetails AddTopic (string topicPath, TopicType topicType, IBytes value, ITopicControlAddCallback callback)
 Sends a request to the server to add a topic. More...
 
ITopicDetails AddTopic< TContext > (string topicPath, TopicType topicType, TContext context, ITopicControlAddContextCallback< TContext > callback)
 Sends a request to the server to add a topic. More...
 
ITopicDetails AddTopic< TContext > (string topicPath, TopicType topicType, IBytes value, TContext context, ITopicControlAddContextCallback< TContext > callback)
 Sends a request to the server to add a topic. More...
 
void AddTopic< TContext > (string topicPath, ITopicSpecification specification, TContext context, ITopicControlAddContextCallback< TContext > callback)
 Sends a request to the server to add a topic. More...
 
void AddTopic< TContext > (string topicPath, ITopicSpecification specification, IBytes value, TContext context, ITopicControlAddContextCallback< TContext > callback)
 Sends a request to the server to add a topic. More...
 
void AddTopic (string topicPath, ITopicSpecification specification, ITopicControlAddCallback callback)
 Sends a request to the server to add a topic. More...
 
void AddTopic (string topicPath, ITopicSpecification specification, IBytes value, ITopicControlAddCallback callback)
 Sends a request to the server to add a topic, specifying its initial value. More...
 
ITopicDetails AddTopicFromValue< TValue > (string topicPath, TValue value, ITopicControlAddCallback callback)
 Sends a request to the server to add a topic where the type and initial value for the topic are derived from a provided value object. More...
 
ITopicDetails AddTopicFromValue< TValue, TContext > (string topicPath, TValue value, TContext context, ITopicControlAddContextCallback< TContext > callback)
 Sends a request to the server to add a topic where the type and initial value for the topic are derived from a provided value object. More...
 
void RemoveTopics (string topics, ITopicControlRemoveCallback callback)
 Sends a request to remove one or more topics at the server. More...
 
void RemoveTopics< TContext > (string topics, TContext context, ITopicControlRemoveContextCallback< TContext > callback)
 Sends a request to remove one or more topics at the server. More...
 
void Remove (string topicSelector, ITopicControlRemovalCallback callback)
 Sends a request to remove one or more topics at the server. More...
 
void Remove< TContext > (string topicSelector, TContext context, ITopicControlRemovalContextCallback< TContext > callback)
 Sends a request to remove one or more topics at the server. More...
 
void AddMissingTopicHandler (string topicPath, IMissingTopicHandler handler)
 Registers a IMissingTopicHandler to handle requests for a branch of the topic tree. More...
 
void AddTopicEventListener (string topicPath, ITopicControlTopicEventListener listener)
 Register a ITopicControlTopicEventListener to receive topic events for a branch of the topic tree. More...
 
void RemoveTopicsWithSession (string topicPath, Callbacks.ITopicTreeHandler registrationHandler)
 Registers a deferred action to remove a branch of the topic tree. More...
 

Additional Inherited Members

- Properties inherited from PushTechnology.ClientInterface.Client.Features.IFeature
ISession Session [get]
 Get the session that the service is associated with. More...
 

Detailed Description

Represents a feature that provides a client session with the ability to manage topics.

This feature provides the following capabilities:

  • Adding and removing topics.
  • Listening for requests to subscribe to (or fetch) topics that do not exist thus allowing dynamic topic creation on demand.
  • Listening for topic events, such as the number of subscribers to a topic changing from zero to greater than zero or from greater than zero to zero.
  • Flagging topics to be removed from the server when the client session closes.

Creating a topic from a value

The simplest way to add a topic is using the AddTopicFromValue{TValue}(string,TValue,ITopicControlAddCallback) method. The topic type, metadata (if applicable) and initial value are derived from a supplied value as described below:

Value Type Topic Type Metadata Initial Value
IJSON TopicType.JSON Not applicable The supplied value.
IBinary TopicType.BINARY Not applicable The supplied value.
IContent built using IRecordContentBuilder TopicType.RECORD IMContent derived from records and values in the content. Numeric values will assume type IMIntegerString. Numeric values containing a '.' will assume type IMDecimalString with a scale equal to the number of digits after the decimal point and all other values will assume IMString. This means that if you intend a field to be a string you cannot give it an initial value that can be parsed as a number. It is not possible to derive repeating records or fields from content, each record or field in the content will get a separate metadata definition. If you want to use repeating records or fields, build the details manually. The supplied content.
IContent not built using IRecordContentBuilder TopicType.SINGLE_VALUE IMString The supplied content as a string.
Integer, Long, Short, Byte TopicType.SINGLE_VALUE IMIntegerString derived from the string representation of the value supplied.
Double, Float TopicType.SINGLE_VALUE IMDecimalString Use of floating point numbers is not recommended but if supplied, the number is converted to a decimal value with half up rounding.
Other TopicType.SINGLE_VALUE IMString For all types other than those above the initial content is obtained from the object.ToString() method of the supplied object.

For example, a topic could be added as follows:

topicControl.AddTopicFromValue("MyTopic", 42, addCallback);

The above call would create a single value topic with an integer value initialized to "42".

Alternatively a single value string topic initialized to a zero length string could be added as follows:

topicControl.AddTopicFromValue("MyTopic", "", addCallback);

The actual ITopicDetails used to create the topic will be returned. These are generated by the call if required, or if there are already suitable details from a previous call, they will have been used.

Creating a simple topic type

Another easy way to add a topic is to use AddTopic(string,TopicType,ITopicControlAddCallback) specifying the type of topic to create. This will create a topic of the specified type with default properties. For example:

topicControl.AddTopic("foo", TopicType.JSON, callback);

In some cases there may be a need to specify some additional properties. This may be done using AddTopic(string,ITopicSpecification,ITopicControlAddCallback) where the specification is created using NewSpecification(TopicType). For example:

var spec = topicControl.NewSpecification(TopicType.JSON).WithProperty(TopicSpecificationProperty.PublishValuesOnly,"true");
topicControl.AddTopic("foo",spec,callback);

Variants of these methods allow an initial value to be supplied for the topic. If a topic is not given an initial value, some topic types will assume a default initial value, whereas others may simply not have an initial value.

This method does not work for all topic types as some have complex requirements which need to be specified using ITopicDetails.

Complex topic creation

Some topics cannot be created using the simple mechanism specified above. For example, TopicType.RECORD topics would need to specify metadata. For such topics it is necessary to supply topic details which fully describe the type of topic and any other properties required for its creation. These details may be created using a ITopicDetailsBuilder of the correct type. In order to create a builder of the correct type it is necessary to supply the builder type to the CreateDetailsBuilder{TBuilder} method. For example:

var builder = topicControl.CreateDetailsBuilder&lt;IRecordTopicDetailsBuilder&gt;;

After setting properties as required on the builder, it can be used to build immutable ITopicDetails which can then be used to add topics. For example:

var details = builder.Build();
topicControl.AddTopic("foo", details, callback);

If many topics are to be created with the same definition, it is recommended to use the same details instance as the feature is optimized to only transmit the details to the server once in this situation.

Creating topic tree hierarchies

When adding topics, intermediate nodes that do not already exist are automatically created as TopicType.STATELESS topics. So, in the following example, if A and B did not exist, they would automatically be created as stateless, with only "foo" being JSON:

topicControl.AddTopic("A/B/foo", TopicType.JSON, callback);

Access control

To add and remove topic the client session needs TopicPermission.MODIFY_TOPIC permission to the branch of the topic tree being updated. If a session removes a topic (requiring TopicPermission.MODIFY_TOPIC permission for the topic path), descendant topics will also be removed regardless of the permissions at lower levels of the topic tree.

To register a missing topic handler the client needs GlobalPermission.REGISTER_HANDLER permissions.

Accessing the feature

This feature may be obtained from a session as follows:

var topicControl = session.GetTopicControlFeature();



Since 5.0

Member Function Documentation

void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddMissingTopicHandler ( string  topicPath,
IMissingTopicHandler  handler 
)

Registers a IMissingTopicHandler to handle requests for a branch of the topic tree.

The provided handler is called when a client subscribes or fetches using a topic selector that matches no existing topics. This allows a control client to intercede when another session requests a topic that does not exist. The control client may use any of the AddTopic(*) methods to create the topic, take some other action, or do nothing, before allowing the client operation to proceed by calling IMissingTopicNotification.Proceed(). Alternatively, the control client can call IMissingTopicNotification.Cancel() to discard the request.

A control client can register multiple handlers, but may only register a single handler for a given topic path. See ITopicTreeHandler.OnActive. A handler will only be called for topic selectors with a ITopicSelector.PathPrefix that starts with or is equal to the given topic path. If the path prefix matches multiple handlers, the one registered for the most specific (longest) topic path will be called.

Parameters
topicPathThe topic path.
handlerThe handler for the specified branch (unless overridden by a handler registered against a more specific branch).
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopic ( string  topicPath,
ITopicDetails  details,
ITopicControlAddCallback  callback 
)

Sends a request to the server to add a topic.

Parameters
topicPathThe full path of the topic to be created.
detailsThe details of the topic to be created.
callbackThe callback that is invoked with the result.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopic ( string  topicPath,
ITopicDetails  details,
IBytes  value,
ITopicControlAddCallback  callback 
)

Sends a request to the server to add a topic.

The topic will be initialized with the given value during creation and therefore the value must be compatible with the TopicType otherwise an TopicAddFailReason.INITIALISE_ERROR will be returned.

Parameters
topicPathThe full path of the topic to be created.
detailsThe details of the topic to be created.
valueThe initial value. If this is specified as null, the effect is the same as calling AddTopic{TContext}(string,ITopicDetails,TContext,ITopicControlAddContextCallback{TContext}). A value may only be supplied for a topic that is stateful. An instance of IContent may be supplied as value.
callbackThe callback that is invoked with the result.
ITopicDetails PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopic ( string  topicPath,
TopicType  topicType,
ITopicControlAddCallback  callback 
)

Sends a request to the server to add a topic.

This is a convenience method which is equivalent to a call to AddTopic(string,ITopicDetails,ITopicControlAddCallback) with the details generated from NewDetails(TopicType) allowing a topic to be added with default details.

The details generated are returned and may be used to pass to other calls of AddTopic(*).

Parameters
topicPathThe full path of the topic to be created.
topicTypeThe type of the topic to be created.
callbackThe callback that is invoked with the result.
Returns
The details used to add the topic. These may need to be cast to the correct type in order to obtain information within the details.
ITopicDetails PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopic ( string  topicPath,
TopicType  topicType,
IBytes  value,
ITopicControlAddCallback  callback 
)

Sends a request to the server to add a topic.

This is a convenience method which is equivalent to a call to AddTopic(string,ITopicDetails,IBytes,ITopicControlAddCallback) with the details generated from NewDetails(TopicType) allowing a topic to be added with default details.

If using this mechanism, it is important to understand what the default details for the topic type would be. The documentation of the relevant ITopicDetailsBuilder subtype should be consulted.

The details generated are returned and may be used to pass to other calls of AddTopic(*).

Parameters
topicPathThe full path of the topic to be created.
topicTypeThe type of the topic to be created.
valueThe initial value. If this is specified as null, the effect is the same as calling AddTopic(string,TopicType,ITopicControlAddCallback). A value may only be supplied for a topic that is stateful. An instance of IContent may be supplied as value.
callbackThe callback that is invoked with the result.
Returns
The details used to add the topic. These may need to be cast to the correct type in order to obtain information within the details.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopic ( string  topicPath,
ITopicSpecification  specification,
ITopicControlAddCallback  callback 
)

Sends a request to the server to add a topic.



Since 5.8

Parameters
topicPathThe full path of the topic to be created.
specificationThe topic specifications of the topic to be created. A specification can be created using NewSpecification(TopicType).
callbackThe callback that is invoked with the result.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopic ( string  topicPath,
ITopicSpecification  specification,
IBytes  value,
ITopicControlAddCallback  callback 
)

Sends a request to the server to add a topic, specifying its initial value.

The topic will be initialized with the given value during creation and therefore the value must be compatible with the TopicType. Otherwise, an TopicAddFailReason.INITIALISE_ERROR will be returned.



Since 5.8

Parameters
topicPathThe full path of the topic to be created.
specificationThe topic specifications of the topic to be created. A specification can be created using NewSpecification(TopicType).
valueThe initial value. If this is specified as null, the effect is the same as calling AddTopic(string,ITopicSpecification,ITopicControlAddCallback). A value may only be supplied for a topic that is stateful. An instance of IContent may be supplied as value.
callbackThe callback that is invoked with the result.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopic< TContext > ( string  topicPath,
ITopicDetails  details,
TContext  context,
ITopicControlAddContextCallback< TContext >  callback 
)

Sends a request to the server to add a topic.

Template Parameters
TContextThe context type.
Parameters
topicPathThe full path of the topic to be created.
detailsThe details of the topic to be created.
contextThe context object passed to the callback with the reply to allow requests and replies to be correlated. The caller may use any convenient object reference, including null.
callbackThe callback that is invoked with the result.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopic< TContext > ( string  topicPath,
ITopicDetails  details,
IBytes  value,
TContext  context,
ITopicControlAddContextCallback< TContext >  callback 
)

Sends a request to the server to add a topic.

Template Parameters
TContextThe context type.
Parameters
topicPathThe full path of the topic to be created.
detailsThe details of the topic to be created.
valueThe initial value. If this is specified as null, the effect is the same as calling AddTopic{TContext}(string,ITopicDetails,TContext,ITopicControlAddContextCallback{TContext}). A value may only be supplied for a topic that is stateful. An instance of IContent may be supplied as value.
contextThe context object passed to the callback with the reply to allow requests and replies to be correlated. The caller may use any convenient object reference, including null.
callbackThe callback that is invoked with the result.
ITopicDetails PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopic< TContext > ( string  topicPath,
TopicType  topicType,
TContext  context,
ITopicControlAddContextCallback< TContext >  callback 
)

Sends a request to the server to add a topic.

Template Parameters
TContextThe context type.
Parameters
topicPathThe full path of the topic to be created.
topicTypeThe type of the topic to be created.
contextThe context object passed to the callback with the reply to allow requests and replies to be correlated. The caller may use any convenient object reference, including null.
callbackThe callback that is invoked with the result.
Returns
The details used to add the topic. These may need to be cast to the correct type in order to obtain information within the details.
ITopicDetails PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopic< TContext > ( string  topicPath,
TopicType  topicType,
IBytes  value,
TContext  context,
ITopicControlAddContextCallback< TContext >  callback 
)

Sends a request to the server to add a topic.

Template Parameters
TContextThe context type.
Parameters
topicPathThe full path of the topic to be created.
topicTypeThe type of the topic to be created.
valueThe initial value. If this is specified as null, the effect is the same as calling AddTopic{TContext}(string,TopicType,TContext,ITopicControlAddContextCallback{TContext}). A value may only be supplied for a topic that is stateful. An instance of IContent may be supplied as value.
contextThe context object passed to the callback with the reply to allow requests and replies to be correlated. The caller may use any convenient object reference, including null.
callbackThe callback that is invoked with the result.
Returns
The details used to add the topic. These may need to be cast to the correct type in order to obtain information within the details.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopic< TContext > ( string  topicPath,
ITopicSpecification  specification,
TContext  context,
ITopicControlAddContextCallback< TContext >  callback 
)

Sends a request to the server to add a topic.



Since 5.8

Template Parameters
TContextThe context type.
Parameters
topicPathThe full path of the topic to be created.
specificationThe topic specifications of the topic to be created. A specification can be created using NewSpecification(TopicType).
contextThe context object passed to the callback with the reply to allow requests and replies to be correlated. The caller may use any convenient object reference, including null.
callbackThe callback that is invoked with the result.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopic< TContext > ( string  topicPath,
ITopicSpecification  specification,
IBytes  value,
TContext  context,
ITopicControlAddContextCallback< TContext >  callback 
)

Sends a request to the server to add a topic.



Since 5.8

Template Parameters
TContextThe context type.
Parameters
topicPathThe full path of the topic to be created.
specificationThe topic specifications of the topic to be created. A specification can be created using NewSpecification(TopicType).
valueThe initial value. If this is specified as null, the effect is the same as calling AddTopic{TContext}(string,ITopicSpecification,TContext,ITopicControlAddContextCallback{TContext}). A value may only be supplied for a topic that is stateful. An instance of IContent may be supplied as value.
contextThe context object passed to the callback with the reply to allow requests and replies to be correlated. The caller may use any convenient object reference, including null.
callbackThe callback that is invoked with the result.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopicEventListener ( string  topicPath,
ITopicControlTopicEventListener  listener 
)

Register a ITopicControlTopicEventListener to receive topic events for a branch of the topic tree.

This allows a client to receive different events for topics. These events are emitted when a topic is subscribed to by one or more sessions after previously having no subscribers, or when a topic is no longer subscribed to by any session. These events are averaged over a small window of time to prevent rapid dispatch of events that ultimately return a topic to its previous state.

Each control session may register a single handler for a branch. See Callbacks.ITopicTreeHandler.OnRegistered.

Parameters
topicPathThe topic path.
listenerThe listener for the specified branch (unless overriden by a listener registered against a more specific branch).
ITopicDetails PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopicFromValue< TValue > ( string  topicPath,
TValue  value,
ITopicControlAddCallback  callback 
)

Sends a request to the server to add a topic where the type and initial value for the topic are derived from a provided value object.

See ITopicControl documentation for full details of how this method may be used.



Since 5.3

Template Parameters
TValueThe value type.
Parameters
topicPathThe full path of the topic to be created.
valueThe value from which the topic type, metadata and initial value are to be derived.
callbackThe callback that is invoked with the result.
Returns
The details used to add the topic. These may need to be cast to the correct type in order to obtain information within the details.
ITopicDetails PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.AddTopicFromValue< TValue, TContext > ( string  topicPath,
TValue  value,
TContext  context,
ITopicControlAddContextCallback< TContext >  callback 
)

Sends a request to the server to add a topic where the type and initial value for the topic are derived from a provided value object.

See ITopicControl documentation for full details of how this method may be used.



Since 5.3

Template Parameters
TValueThe value type.
TContextThe context type.
Parameters
topicPathThe full path of the topic to be created.
valueThe value from which the topic type, metadata and initial value are to be derived.
contextThe context object passed to the callback with the reply to allow requests and replies to be correlated. The caller may use any convenient object reference, including null.
callbackThe callback that is invoked with the result.
Returns
The details used to add the topic. These may need to be cast to the correct type in order to obtain information within the details.
TBuilder PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.CreateDetailsBuilder< TBuilder > ( )

Creates a new topic details builder to create ITopicDetails of a type corresponding to a given builder type.

Template Parameters
TBuilderThe builder type.
Returns
The new builder that can be used to build topic details of the type indicated by the given builder type.
Type Constraints
TBuilder :class 
TBuilder :ITopicDetailsBuilder<ITopicDetails> 
ITopicDetails PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.NewDetails ( TopicType  topicType)

Returns new topic details of the given type set with all default settings.

This provides a simpler mechanism than creating a builder where all of the builder's default values are suitable and there are no mandatory properties.

If using this mechanism, it is important to understand what the default details for the topic type would be. The documentation of the relevant ITopicDetailsBuilder subtype should be consulted.

Parameters
topicTypeThe topic type.
Returns
The new topic details of the type indicated by the given topic type.
ITopicSpecification PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.NewSpecification ( TopicType  topicType)

Creates a new ITopicSpecification for a given topic type.



Since 5.8

Parameters
topicTypeThe topic type.
Returns
The new immutable specification with no properties set. New specifications with properties set may be produced using the ITopicSpecification.WithProperty(string,string) or ITopicSpecification.WithProperties methods of the provided specification.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.Remove ( string  topicSelector,
ITopicControlRemovalCallback  callback 
)

Sends a request to remove one or more topics at the server.

The topics to remove will depend upon the nature of the topic selector specified. If the selector does not have descendant pattern qualifiers (i.e. / or //), only those topics that exist at paths indicated by the selector will be removed and not their descendants. If a single / qualifier is specified, all descendants of the matching topic paths will be removed. If // is specified, all branches of the topic tree that match the selector (i.e topics at the selected paths and all descendants of the selected paths) will be removed.


This method will not work over the deprecated DPT transport protocol.



Since 5.9.

Parameters
topicSelectorThe topic selector expression specifying the topics to remove.
callbackThe callback that is invoked with the result.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.Remove< TContext > ( string  topicSelector,
TContext  context,
ITopicControlRemovalContextCallback< TContext >  callback 
)

Sends a request to remove one or more topics at the server.

The topics to remove will depend upon the nature of the topic selector specified. If the selector does not have descendant pattern qualifiers (i.e. / or //), only those topics that exist at paths indicated by the selector will be removed and not their descendants. If a single / qualifier is specified, all descendants of the matching topic paths will be removed. If // is specified, all branches of the topic tree that match the selector (i.e topics at the selected paths and all descendants of the selected paths) will be removed.


This method will not work over the deprecated DPT transport protocol.



Since 5.9.

Template Parameters
TContextThe context type.
Parameters
topicSelectorThe topic selector expression specifying the topics to remove.
contextThe context object passed to the callback with the reply to allow requests and replies to be correlated. The caller may use any convenient object reference, including null.
callbackThe callback that is invoked with the result.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.RemoveTopics ( string  topics,
ITopicControlRemoveCallback  callback 
)

Sends a request to remove one or more topics at the server.

Any descendants of the matched topics will also be removed.

Parameters
topicsThe topic selector expression specifying one or more topics to remove.
callbackThe callback that is invoked with the result.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.RemoveTopics< TContext > ( string  topics,
TContext  context,
ITopicControlRemoveContextCallback< TContext >  callback 
)

Sends a request to remove one or more topics at the server.

Any descendants of the matched topics will also be removed.

Template Parameters
TContextThe context type.
Parameters
topicsThe topic selector expression specifying one or more topics to remove.
contextThe context object passed to the callback with the reply to allow requests and replies to be correlated. The caller may use any convenient object reference, including null.
callbackThe callback that is invoked with the result.
void PushTechnology.ClientInterface.Client.Features.Control.Topics.ITopicControl.RemoveTopicsWithSession ( string  topicPath,
Callbacks.ITopicTreeHandler  registrationHandler 
)

Registers a deferred action to remove a branch of the topic tree.

The server will remove the topics if this session is closed. If several client sessions request removal of the same branch, the topics will not be removed until the last session is closed.

For example, suppose two client sessions both call

topicControl.RemoveTopicsWithSession("a/b", registrationHandler)

. When both sessions are closed, either explicitly using ISession.Close() or by the server, the topic a/b and all of its descendants will be removed. This method is typically used by a client that has added one or more topics to tidy up and remove the topics if it is ever disconnected from the server or otherwise fails.

The server can reject a RemoveTopicsWithSession call if the given topic path conflicts with existing registrations. Different sessions may call this method for the same topic path, but not for topic paths above or below existing registrations on the same branch of the topic tree.

The following callbacks will be delivered to the provided registration handler:

  • If registration succeeds, Callbacks.ITopicTreeHandler.OnRegistered will be called as notification that the deferred action is active. A IRegistration is provided that allows the deferred action to be de-registered.
  • If deregistration is successful, Callbacks.ITopicTreeHandler.OnClose will be called as notification that the deferred action is no longer active. No further calls will be made to the registration handler.
  • If the registration or deregistration fails, Callbacks.ITopicTreeHandler.OnClose will be called and no further calls will be made to the registration handler. In general, this is non-recoverable; the deferred action may or may not be active and the application can do little more than report the condition. In the specific case that OnError() is passed ErrorReason.TOPIC_TREE_REGISTRATION_CONFLICT, registration has failed due to a pre-existing registration on the same branch of the topic tree as the given topic path.



Since 5.1

Parameters
topicPathThe topic path.
registrationHandler

The documentation for this interface was generated from the following file: