Support for Google Protocol Buffers topics will be removed in a
future release as binary
topics can be
used to distribute protocol buffer messages.
@Deprecated public interface ProtocolBufferTopicDetails extends TopicDetails
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, no delta would be required.
The way in which content provided for update is interpreted depends upon the
update mode
. 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, deletions of optional fields are notified to the
clients using a deletion value (see ProtocolBufferTopicDetails.Builder.deletionValue(String)
).
When operating in partial mode, 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, 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:
1) All fields should be 'optional' as 'required' fields cannot be excluded
from deltas.
2) All optional fields should be of type 'string' as other types will not
support the notification of deletions.
3) 'repeated' fields or messages should not be used as all occurrences must
always be set in deltas.
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
TopicControl
feature as follows:
TopicControl control = session.feature(TopicControl.class);
ProtocolBufferTopicDetails.Builder builder = control.newDetailsBuilder(ProtocolBufferTopicDetails.Builder.class);
The minimum that must be provided to the builder is the message details made
up of a protocol buffers class and a message name.Modifier and Type | Interface and Description |
---|---|
static interface |
ProtocolBufferTopicDetails.Attributes
Deprecated.
Protocol Buffer topic details attributes.
|
static interface |
ProtocolBufferTopicDetails.Builder
Deprecated.
Builder for Google Protocol Buffer topic details.
|
static interface |
ProtocolBufferTopicDetails.Schema
Deprecated.
Protocol Buffer topic details schema.
|
TopicDetails.Level
Modifier and Type | Method and Description |
---|---|
ProtocolBufferTopicDetails.Builder |
newBuilder()
Deprecated.
Returns a new builder initialized with the values from these details.
|
getAttributes, getLevel, getSchema, getType
ProtocolBufferTopicDetails.Builder newBuilder()
Copyright © 2016 Push Technology Ltd. All Rights Reserved.