Class MqttCodecUtil

java.lang.Object
io.netty.handler.codec.mqtt.MqttCodecUtil

final class MqttCodecUtil extends Object
  • Field Details

    • TOPIC_WILDCARDS

      private static final char[] TOPIC_WILDCARDS
    • MQTT_VERSION_KEY

      static final AttributeKey<MqttVersion> MQTT_VERSION_KEY
  • Constructor Details

    • MqttCodecUtil

      private MqttCodecUtil()
  • Method Details

    • getMqttVersion

      static MqttVersion getMqttVersion(ChannelHandlerContext ctx)
    • setMqttVersion

      static void setMqttVersion(ChannelHandlerContext ctx, MqttVersion version)
    • isValidPublishTopicName

      static boolean isValidPublishTopicName(String topicName)
    • isValidMessageId

      static boolean isValidMessageId(int messageId)
    • isValidUserName

      static boolean isValidUserName(String userName)
    • isValidClientId

      static boolean isValidClientId(MqttVersion mqttVersion, int maxClientIdLength, 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.
    • validateFixedHeader

      static MqttFixedHeader validateFixedHeader(ChannelHandlerContext ctx, MqttFixedHeader mqttFixedHeader)
    • resetUnusedFields

      static MqttFixedHeader resetUnusedFields(MqttFixedHeader mqttFixedHeader)