V
- the value type which represents the DataType
of the
topics that the updater can be used for.public static interface TopicUpdateControl.ValueUpdater<V>
Such an updater may be obtained from an TopicUpdateControl.Updater
using the
TopicUpdateControl.Updater.valueUpdater(Class)
method.
Modifier and Type | Method and Description |
---|---|
V |
getCachedValue(String topicPath)
Returns the current cached value for a given topic path.
|
void |
removeCachedValues(String topics)
Removes values from the value cache.
|
void |
removeCachedValues(TopicSelector topics)
Removes values from the value cache.
|
<C> void |
update(String topicPath,
V value,
C context,
TopicUpdateControl.Updater.UpdateContextCallback<C> callback)
Updates a topic to a specified value.
|
void |
update(String topicPath,
V value,
TopicUpdateControl.Updater.UpdateCallback callback)
Updates a topic to a specified value.
|
void update(String topicPath, V value, TopicUpdateControl.Updater.UpdateCallback callback)
For exclusive updating, this method caches the supplied value so that subsequent calls for the same topic will be able to use the current value to calculate deltas of change to send to the server rather than having to send the whole value.
For non-exclusive updating, the complete value is always sent to the server and the value is not cached.
topicPath
- the topic pathvalue
- the new value for the topiccallback
- the callback for notifications on the update request<C> void update(String topicPath, V value, C context, TopicUpdateControl.Updater.UpdateContextCallback<C> callback)
This is the same as
update(String, Object, TopicUpdateControl.Updater.UpdateCallback)
but with optional context.
C
- the context typetopicPath
- the topic pathvalue
- the new value for the topiccontext
- the context to supply to callback notifications. May
be null.callback
- the callback for notifications on the update requestV getCachedValue(String topicPath) throws ClassCastException
topicPath
- specifies the topic to obtain the current value forClassCastException
- if there is a cached value but it is not
compatible with the type of this updatervoid removeCachedValues(String topics) throws IllegalArgumentException
If a cached value is removed, the next update for a topic will transmit the whole value to the server rather than a delta.
topics
- a selector expression or topic path indicating the
topics for which entries are to be removedIllegalArgumentException
- if topics
is not a valid
selector expressionvoid removeCachedValues(TopicSelector topics)
If a cached value is removed, the next update for a topic will transmit the whole value to the server rather than a delta.
topics
- a selector indicating the topics for which entries are
to be removedCopyright © 2020 Push Technology Ltd. All Rights Reserved.