Class MqttCodecUtil


  • final class MqttCodecUtil
    extends java.lang.Object
    • Field Detail

      • TOPIC_WILDCARDS

        private static final char[] TOPIC_WILDCARDS
    • Constructor Detail

      • MqttCodecUtil

        private MqttCodecUtil()
    • Method Detail

      • isValidPublishTopicName

        static boolean isValidPublishTopicName​(java.lang.String topicName)
      • isValidMessageId

        static boolean isValidMessageId​(int messageId)
      • isValidUserName

        static boolean isValidUserName​(java.lang.String userName)
      • isValidClientId

        static boolean isValidClientId​(MqttVersion mqttVersion,
                                       int maxClientIdLength,
                                       java.lang.String clientId,
                                       boolean acceptNulBytes)
        Determine if a client identifier is valid.
        Parameters:
        mqttVersion - The MQTT version semantics to use.
        maxClientIdLength - The max client id length.
        clientId - The client id value.
        acceptNulBytes - MQTT normally does not allow NUL bytes in client identifiers. Set this to true to enable "legacy"/"lenient" mode, otherwise false for strict spec compliance.
        Returns:
        true if the client id is valid, otherwise false.