Diffusion .NET API
5.9.24
|
Details of a Google Protocol Buffer topic. More...
Public Member Functions | |
IProtocolBufferTopicDetailsBuilder | CreateBuilder () |
Creates a new protocol buffer topic details builder. More... | |
Additional Inherited Members | |
Properties inherited from PushTechnology.ClientInterface.Client.Topics.ITopicDetails | |
TopicDetailsLevel | Level [get] |
Returns the level of detail available. More... | |
TopicType | Type [get] |
Returns the topic type. More... | |
ITopicDetailsSchema | Schema [get] |
Returns the topic schema. More... | |
ITopicDetailsAttributes | Attributes [get] |
Returns the topic attributes. More... | |
Details of a Google Protocol Buffer topic.
The format of the data is described by a single Google Protocol Buffers message description which is specified when the topic is created.
Updates to such a topic will be from content that contains a Google Protocol Buffer message which will be parsed using the description known to the topic.
The data that is input on an update is checked against the current data state and a delta protocol buffer with only those fields that are different will be generated. If there are no differences then no delta would be required.
The way in which content provided for update is interpreted depends upon the UpdateMode. In partial mode the content is assumed to contain only those optional fields that are being changed, whereas in full mode the content is assumed to contain the full topic state.
When operating in full mode then deletions of optional fields are notified to the clients using a deletion value (see IProtocolBufferTopicDetailsBuilder.DeletionValue(string)).
When operating in partial mode then deletions of optional fields can only be supported using deletion values. The deletion value can be used in update messages to explicitly specify a deletion and then such deletions will be notified to clients using the value.
Deletion of optional fields is only supported for fields of type 'string'. For any other types field deletion is not supported.
It should be noted that 'required' fields will always be sent in deltas and therefore to minimise message size their use is discouraged. Also, if an entry of a 'repeated' field or message is changed then all of the occurrences will be retransmitted in the delta.
Because of the limitations this type of topic will work best if the following recommendations regarding buffer definitions are observed:-
When a topic of this type is created it is necessary to provide the full class name of a compiled Protocol Buffers class that is present at the server and also the name of a message defined within that class that represents the topic content.
To create an instance of such details use a builder obtained from the ITopicControl feature as follows:
var control = session.GetTopicControlFeature(); var builder = control.CreateDetailsBuilder<IProtocolBufferTopicDetailsBuilder>();
The minimum that must be provided to the builder is the message details made up of a protocol buffers class and a message name.
IProtocolBufferTopicDetailsBuilder PushTechnology.ClientInterface.Client.Topics.IProtocolBufferTopicDetails.CreateBuilder | ( | ) |
Creates a new protocol buffer topic details builder.