public interface TopicSpecification
A topic is specified in terms of its type
and a map of
optional property settings which can alter the default behavior of the topic.
Possible properties are:
PUBLISH_VALUES_ONLY
VALIDATE_VALUES
Modifier and Type | Field and Description |
---|---|
static String |
PUBLISH_VALUES_ONLY
Key of topic property indicating whether a topic should publish only
values.
|
static String |
VALIDATE_VALUES
Key of the topic property indicating whether a topic should validate
inbound values.
|
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getProperties()
Returns the topic properties.
|
TopicType |
getType()
Returns the topic type.
|
TopicSpecification |
withProperties(Map<String,String> properties)
Creates a new specification with the specified properties.
|
TopicSpecification |
withProperty(String key,
String value)
Creates a new specification with the specified property value set.
|
static final String PUBLISH_VALUES_ONLY
By default, topics with a topic DataType
that supports deltas
will publish a delta when doing so is more efficient than publishing the
value. Setting this property to 'true' disables this behavior so that
deltas are never published. This would result in more data being
transmitted, but would allow the client to only have to process values
and not deltas.
If this property is not set (or set to something other than 'true') and a
topic publishes deltas, clients would need to use value streams
to process the topics. If a client uses
topic streams
, it would need to process the deltas
manually.
If the client is using value streams
to process the
topics, it is not recommended to set this property as it will only lead
to higher bandwidth usage.
For topic DataType
s that do not have delta support this value is
irrelevant as only values would ever be published anyway."
static final String VALIDATE_VALUES
By default, the server does not validate received values before sending them on to clients. Invalid or corrupt values will be stored in the topic and passed on to clients. If this property is set to 'true', the server will perform additional validation on values to check that it is a valid instance of the data type, and if it is not then it will return an error to the updater and not update the topic.
If this value is not set (or set to something other than 'true'), no
server validation of inbound values is performed. This is the recommended
setting as there is a performance overhead to validation and a client
using a value updater
could not send invalid values
anyway.
TopicType getType()
Map<String,String> getProperties()
TopicSpecification withProperty(String key, String value) throws IllegalArgumentException
key
- the property keyvalue
- the property valueIllegalArgumentException
- if either parameter is null or invalidTopicSpecification withProperties(Map<String,String> properties) throws IllegalArgumentException
properties
- map of propertiesIllegalArgumentException
- if properties
is null or any of
the supplied properties are invalidCopyright © 2016 Push Technology Ltd. All Rights Reserved.