Diffusion .NET Client Library  6.1.5
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
PushTechnology.ClientInterface.Client.Content.Update.IContentUpdateFactory Interface Reference

Update factory for generic content-based updates. More...

Inheritance diagram for PushTechnology.ClientInterface.Client.Content.Update.IContentUpdateFactory:
PushTechnology.ClientInterface.Client.Content.Update.IUpdateFactory

Public Member Functions

IUpdate Update (IContent content)
 Create a new update which updates the topic to the supplied state, comparing with the previous state and sending deltas of change to subscribers if appropriate. More...
 
IUpdate Replace (IContent content)
 Create a new update which replaces the topic state and notifies all subscribers. More...
 
IUpdate Apply (IContent content)
 Create a new update which applies the patch represented by the supplied content to the current topic state and notifies all subscribers of the change as appropriate. More...
 

Detailed Description

Update factory for generic content-based updates.

This factory supports updates for a number of different topic types and it is important that the content supplied is compatible with the topic type and the topic schema (if applicable), otherwise the update will fail.

For Replace or Update the content supplied must always represent the full topic state.

For Apply the content must represent a specification of change to the topic state. This will be the patch representation acording to the topic type. This allows for the update content to only contain values for those fields/values that have actually changed rather than all values.

The server-side action is dependent upon the topic type as follows:

  1. Publishing topics with server-side state

i.e. TopicType.SINGLE_VALUE, TopicType.RECORD, TopicType.SLAVE

If Update is used, the content supplied will be compared with the current topic state and changes applied accordingly. Subscribers will be notified only of changes to the topic (as TopicUpdateType.DELTA deltas) and if there are no changes then there would be no notifications.

If Replace(IContent) is used then the current topic state is totally replaced by the supplied content and all current subscribers will be notified of the new state (as TopicUpdateType.SNAPSHOT snapshots.

If Apply is used then the content supplied will be applied as a delta update to the current topic state. Subscribers will be notified only of the TopicUpdateType.DELTA delta.

  1. Stateless topics

i.e. TopicType.STATELESS

The supplied content will simply be relayed to all subscribed clients.

If Update(IContent) or Apply is used, subscribers will be notified that the content is a TopicUpdateType.DELTA delta.

If Replace(IContent) is used then subscribers will be notified that the content is a TopicUpdateType.SNAPSHOT snapshot.

  1. Other topic types

An attempt to use this update type for any other topic type would result in an update failure at the server.

Instances of this factory can be obtained from the ITopicUpdateControl feature using ITopicUpdateControl.UpdateFactory{TF}, for example:

var updateControl = session.TopicUpdateControl; var factory = updateControl.UpdateFactory<IContentUpdateFactory>();

Member Function Documentation

IUpdate PushTechnology.ClientInterface.Client.Content.Update.IContentUpdateFactory.Apply ( IContent  content)

Create a new update which applies the patch represented by the supplied content to the current topic state and notifies all subscribers of the change as appropriate.

Parameters
contentThe content.
Returns
A new update.
IUpdate PushTechnology.ClientInterface.Client.Content.Update.IContentUpdateFactory.Replace ( IContent  content)

Create a new update which replaces the topic state and notifies all subscribers.

Parameters
contentThe content.
Returns
A new update.
IUpdate PushTechnology.ClientInterface.Client.Content.Update.IContentUpdateFactory.Update ( IContent  content)

Create a new update which updates the topic to the supplied state, comparing with the previous state and sending deltas of change to subscribers if appropriate.

Parameters
contentThe content.
Returns
A new update.

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