You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
955 B
Java

package com.ruoyi.mqtt.event;
import com.ruoyi.mqtt.config.MqttProperties;
import lombok.Getter;
import org.springframework.context.ApplicationEvent;
import java.util.List;
/**
* 发送的
*/
public class MqttSendTopicEvent extends ApplicationEvent {
@Getter
private String configName;
@Getter
private String topic;
@Getter
private byte[] payload;
@Getter
private int qos;
@Getter
private boolean retained;
public MqttSendTopicEvent(String configName, String topic, byte[] payload, int qos, boolean retained) {
super(configName);
this.configName = configName;
this.topic = topic;
this.payload = payload;
this.qos = qos;
this.retained = retained;
}
public MqttSendTopicEvent(String topic, byte[] payload, int qos, boolean retained) {
this(MqttProperties.DEFAULT, topic, payload, qos, retained);
}
@Override
public String getSource() {
return (String) super.getSource();
}
}