Class MqttTopic
java.lang.Object
com.codename1.io.mqtt.MqttTopic
Topic names and topic filters: validation and the
+ / # matching rules of
MQTT 3.1.1 section 4.7.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanTells whether a topic name matches a topic filter.static voidvalidateFilter(String filter) Checks a topic filter, the thing a subscription is made with.static voidvalidateName(String topic) Checks a topic name, the thing a message is published to.
-
Method Details
-
validateName
Checks a topic name, the thing a message is published to.
Parameters
topic: the name
Throws
IllegalArgumentExceptionwhen it is empty, contains a wildcard, a NUL character, or is longer than 65535 UTF-8 bytes -
validateFilter
Checks a topic filter, the thing a subscription is made with.
Parameters
filter: the filter
Throws
IllegalArgumentExceptionwhen it is empty, has a+that is not a whole level, a#that is not the whole last level, or a NUL character -
matches
Tells whether a topic name matches a topic filter. A filter that starts with a wildcard does not match a name that starts with
$.Parameters
-
filter: a valid topic filter -
topic: a valid topic name
Returns
true when the name is covered by the filter
-
-