Package io.netty.handler.codec.mqtt
Class MqttCodecUtil
- java.lang.Object
-
- io.netty.handler.codec.mqtt.MqttCodecUtil
-
final class MqttCodecUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static AttributeKey<MqttVersion>MQTT_VERSION_KEYprivate static char[]TOPIC_WILDCARDS
-
Constructor Summary
Constructors Modifier Constructor Description privateMqttCodecUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static MqttVersiongetMqttVersion(ChannelHandlerContext ctx)(package private) static booleanisValidClientId(MqttVersion mqttVersion, int maxClientIdLength, java.lang.String clientId, boolean acceptNulBytes)Determine if a client identifier is valid.(package private) static booleanisValidMessageId(int messageId)(package private) static booleanisValidPublishTopicName(java.lang.String topicName)(package private) static booleanisValidUserName(java.lang.String userName)(package private) static MqttFixedHeaderresetUnusedFields(MqttFixedHeader mqttFixedHeader)(package private) static voidsetMqttVersion(ChannelHandlerContext ctx, MqttVersion version)(package private) static MqttFixedHeadervalidateFixedHeader(ChannelHandlerContext ctx, MqttFixedHeader mqttFixedHeader)
-
-
-
Field Detail
-
TOPIC_WILDCARDS
private static final char[] TOPIC_WILDCARDS
-
MQTT_VERSION_KEY
static final AttributeKey<MqttVersion> MQTT_VERSION_KEY
-
-
Method Detail
-
getMqttVersion
static MqttVersion getMqttVersion(ChannelHandlerContext ctx)
-
setMqttVersion
static void setMqttVersion(ChannelHandlerContext ctx, MqttVersion version)
-
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 totrueto enable "legacy"/"lenient" mode, otherwisefalsefor strict spec compliance.- Returns:
trueif the client id is valid, otherwisefalse.
-
validateFixedHeader
static MqttFixedHeader validateFixedHeader(ChannelHandlerContext ctx, MqttFixedHeader mqttFixedHeader)
-
resetUnusedFields
static MqttFixedHeader resetUnusedFields(MqttFixedHeader mqttFixedHeader)
-
-