Package io.netty.handler.codec.mqtt
Class MqttCodecUtil
java.lang.Object
io.netty.handler.codec.mqtt.MqttCodecUtil
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final AttributeKey<MqttVersion> private static final char[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static MqttVersion(package private) static booleanisValidClientId(MqttVersion mqttVersion, int maxClientIdLength, String clientId, boolean acceptNulBytes) Determine if a client identifier is valid.(package private) static booleanisValidMessageId(int messageId) (package private) static booleanisValidPublishTopicName(String topicName) (package private) static booleanisValidUserName(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 Details
-
TOPIC_WILDCARDS
private static final char[] TOPIC_WILDCARDS -
MQTT_VERSION_KEY
-
-
Constructor Details
-
MqttCodecUtil
private MqttCodecUtil()
-
-
Method Details
-
getMqttVersion
-
setMqttVersion
-
isValidPublishTopicName
-
isValidMessageId
static boolean isValidMessageId(int messageId) -
isValidUserName
-
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 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
-