Class MQTTUtil


  • public class MQTTUtil
    extends Object
    A Utility Class for creating Server Side objects and converting MQTT concepts to/from Artemis.
    • Field Detail

      • SESSION_AUTO_COMMIT_SENDS

        public static final boolean SESSION_AUTO_COMMIT_SENDS
        See Also:
        Constant Field Values
      • SESSION_AUTO_COMMIT_ACKS

        public static final boolean SESSION_AUTO_COMMIT_ACKS
        See Also:
        Constant Field Values
      • SESSION_PREACKNOWLEDGE

        public static final boolean SESSION_PREACKNOWLEDGE
        See Also:
        Constant Field Values
      • SESSION_AUTO_CREATE_QUEUE

        public static final boolean SESSION_AUTO_CREATE_QUEUE
        See Also:
        Constant Field Values
      • MQTT_QOS_LEVEL_KEY

        public static final SimpleString MQTT_QOS_LEVEL_KEY
      • MQTT_MESSAGE_ID_KEY

        public static final SimpleString MQTT_MESSAGE_ID_KEY
      • MQTT_MESSAGE_TYPE_KEY

        public static final SimpleString MQTT_MESSAGE_TYPE_KEY
      • MQTT_MESSAGE_RETAIN_KEY

        public static final SimpleString MQTT_MESSAGE_RETAIN_KEY
      • MQTT_MESSAGE_RETAIN_INITIAL_DISTRIBUTION_KEY

        public static final SimpleString MQTT_MESSAGE_RETAIN_INITIAL_DISTRIBUTION_KEY
      • MQTT_PAYLOAD_FORMAT_INDICATOR_KEY

        public static final SimpleString MQTT_PAYLOAD_FORMAT_INDICATOR_KEY
      • MQTT_RESPONSE_TOPIC_KEY

        public static final SimpleString MQTT_RESPONSE_TOPIC_KEY
      • MQTT_CORRELATION_DATA_KEY

        public static final SimpleString MQTT_CORRELATION_DATA_KEY
      • MQTT_USER_PROPERTY_KEY_PREFIX_SIMPLE

        public static final SimpleString MQTT_USER_PROPERTY_KEY_PREFIX_SIMPLE
      • MQTT_CONTENT_TYPE_KEY

        public static final SimpleString MQTT_CONTENT_TYPE_KEY
      • FOUR_BYTE_INT_MAX

        public static final long FOUR_BYTE_INT_MAX
      • TWO_BYTE_INT_MAX

        public static final int TWO_BYTE_INT_MAX
      • DEFAULT_SERVER_KEEP_ALIVE

        public static final int DEFAULT_SERVER_KEEP_ALIVE
        See Also:
        Constant Field Values
      • DEFAULT_TOPIC_ALIAS_MAX

        public static final int DEFAULT_TOPIC_ALIAS_MAX
      • DEFAULT_RECEIVE_MAXIMUM

        public static final int DEFAULT_RECEIVE_MAXIMUM
      • DEFAULT_MAXIMUM_PACKET_SIZE

        public static final int DEFAULT_MAXIMUM_PACKET_SIZE
        See Also:
        Constant Field Values
    • Constructor Detail

      • MQTTUtil

        public MQTTUtil()
    • Method Detail

      • createServerMessageFromByteBuf

        public static Message createServerMessageFromByteBuf​(MQTTSession session,
                                                             SimpleString address,
                                                             io.netty.handler.codec.mqtt.MqttPublishMessage mqttPublishMessage)
      • logMessage

        public static void logMessage​(MQTTSessionState state,
                                      io.netty.handler.codec.mqtt.MqttMessage message,
                                      boolean inbound,
                                      MQTTVersion version)
      • calculateRemainingLength

        public static int calculateRemainingLength​(String topicName,
                                                   io.netty.handler.codec.mqtt.MqttProperties properties,
                                                   io.netty.buffer.ByteBuf payload)
      • calculateMessageSize

        public static int calculateMessageSize​(io.netty.handler.codec.mqtt.MqttPublishMessage message)
      • getProperty

        public static <T> T getProperty​(Class<T> type,
                                        io.netty.handler.codec.mqtt.MqttProperties properties,
                                        io.netty.handler.codec.mqtt.MqttProperties.MqttPropertyType propertyName)
      • getProperty

        public static <T> T getProperty​(Class<T> type,
                                        io.netty.handler.codec.mqtt.MqttProperties properties,
                                        io.netty.handler.codec.mqtt.MqttProperties.MqttPropertyType propertyName,
                                        T defaultReturnValue)