public interface TopicData
This represents thread-safe data that can be associated with a Topic
to represent the state of that Topic.
Different types
of data are supported and empty
instances of the data may be created using TopicDataFactory
.
Topic Data must be associated with the topic when the topic is created using
Publisher.addTopic
.
A topic load representing the current state may be obtained using
getLoadMessage()
. The load message will be sent automatically to
each client that subscribes to the topic.
Modifier and Type | Method and Description |
---|---|
TopicMessage |
getLoadMessage()
|
TopicMessage |
getLoadMessage(TopicClient client)
Deprecated.
since 6.2
The use of |
Topic |
getTopic()
Returns the topic that the data belongs to.
|
com.pushtechnology.diffusion.client.topics.details.TopicSpecification |
getTopicSpecification()
Returns the specification of the topic.
|
TopicDataType |
getType()
Deprecated.
since 6.2
TopicDataType is deprecated along with this method. Use
|
@Deprecated TopicDataType getType()
TopicDataType is deprecated along with this method. Use
getTopicSpecification()
to determined the type of
data instead. This will be removed in a future release.
There are different types of data that perform different functions.
Topic getTopic()
@Deprecated TopicMessage getLoadMessage() throws APIException
The use of messages
in the API is being
phased out. For universal
topics
prefer the use of getValue
and for slave
topics the
value can be obtained from the master topic, if there is one.
This method will be removed in a future release.
This may only be called after the data has been (optionally initialised and) associated with a topic.
The returned message will be positioned at the start of the data ready for reading.
Note that this method can not be used on routing
data
and therefore if there is any doubt whether routing data is in use,
it is always safer to use getLoadMessage(TopicClient)
.
APIException
- if the data has not been attached to a topic, the
data has no value or generation of a message fails@Deprecated TopicMessage getLoadMessage(TopicClient client) throws APIException
The use of messages
in the API is being
phased out. Prefer the use of the routing method
getTopicForClient
and then use
getValue
on the mapped
topic.
This is a variant of getLoadMessage()
which must be used for
routing data
. If in doubt, this method may
always be used as the client will be ignored if not required.
This may only be called after the data has been (optionally initialised and) associated with a topic.
The returned message will be positioned at the start of the data ready for reading.
client
- the client to return the state for. If the data does not
maintain different state per client, this would be ignored.APIException
- if the data has not been attached to a topic, the
data has no value or generation of a message failscom.pushtechnology.diffusion.client.topics.details.TopicSpecification getTopicSpecification()
Copyright © 2020 Push Technology Ltd. All Rights Reserved.