public final class TopicDefinition extends Object
A Topic definition comprises:-
1) A mandatory type that defines the type of Topic Data (if any) associated
with the Topic.
2) A set of properties. Some are generic and some are dependent upon the
type. The generic properties are all optional but some type specific ones may
be mandatory.
3) A metadata definition which is mandatory for some types. The type of this
metadata is also dependent upon the type.
This class performs no validation of the settings. If a definition is used to create a topic and mandatory properties (or metadata) are not present or one or more values are invalid then topic creation would fail.
Each property has documented type (e.g. String, Integer, Long etc) and the property value may be set to an object of that type or any other object that can be parsed to that type via its toString method. For example to set an integer property you could specify an Integer (or an int) but you could also specify a String with a numeric Integer representation within it. However, if a non numeric value was assigned to an Integer property then a failure may occur when the property is used.
Constructor and Description |
---|
TopicDefinition(TopicDataType type,
Hashtable properties,
String metadata)
Creates a Topic Definition of the specified type.
|
Modifier and Type | Method and Description |
---|---|
String |
getMetadata()
Returns metadata.
|
Hashtable |
getProperties()
Returns properties.
|
TopicDataType |
getType()
Returns type.
|
String |
toString() |
public TopicDefinition(TopicDataType type, Hashtable properties, String metadata)
type
- the topic typeproperties
- an initial set of properties. Note that properties are
optional but some topic types do have mandatory properties. Additional
properties may be set after construction if required. See
TopicProperty
for full details of available properties.metadata
- topic metadata. The actual type of metadata that is
required (if any) would be determined by the topic type.public TopicDataType getType()
public String getMetadata()
public Hashtable getProperties()
Copyright © 2016 Push Technology Ltd. All Rights Reserved.