com.feingto.iot.client.service.IMqttMessage Maven / Gradle / Ivy
package com.feingto.iot.client.service;
import com.feingto.iot.common.model.mqtt.MqttConnectOptions;
import io.netty.channel.Channel;
import io.netty.handler.codec.mqtt.MqttConnAckMessage;
import io.netty.handler.codec.mqtt.MqttMessage;
import io.netty.handler.codec.mqtt.MqttSubAckMessage;
/**
* 消息接口
*
* @author longfei
*/
public interface IMqttMessage {
/**
* 连接
*/
void connect(Channel channel, MqttConnectOptions options);
/**
* 连接响应
*/
void connack(MqttConnAckMessage msg);
/**
* 推送消息
*/
void publish(Channel channel, MqttMessage msg);
/**
* QoS level = 1的消息响应
*/
void puback(Channel channel, MqttMessage msg);
/**
* Qos level = 2的协议流的第二个消息,确认已经收到
*/
void pubrec(Channel channel, MqttMessage msg);
/**
* Qos level = 2的协议流的第三个消息
*/
void pubrel(Channel channel, MqttMessage msg);
/**
* Qos level = 2的协议流的第三个消息响应
*/
void pubcomp(Channel channel, MqttMessage msg);
/**
* 订阅响应
*/
void suback(Channel channel, MqttSubAckMessage msg);
/**
* 取消订阅响应
*/
void unsubBack(Channel channel, MqttMessage msg);
/**
* PING请求
*/
void pingreq(Channel channel);
/**
* 断开连接消息
*/
void disconnect(Channel channel);
/**
* 异常处理
*/
void exceptionCaught(Throwable cause);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy