本文整理了Java中org.fusesource.mqtt.client.QoS.values
方法的一些代码示例,展示了QoS.values
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QoS.values
方法的具体详情如下:
包路径:org.fusesource.mqtt.client.QoS
类名称:QoS
方法名:values
暂无
代码示例来源:origin: fusesource/mqtt-client
protected QoS qos() {
return QoS.values()[((header & 0x06) >>> 1)];
}
protected HeaderBase qos(QoS qos) {
代码示例来源:origin: fusesource/mqtt-client
public QoS willQos() {
return QoS.values()[willQos];
}
代码示例来源:origin: fusesource/mqtt-client
public SUBSCRIBE decode(MQTTFrame frame) throws ProtocolException {
assert(frame.buffers.length == 1);
header(frame.header());
DataByteArrayInputStream is = new DataByteArrayInputStream(frame.buffers[0]);
QoS qos = qos();
if(qos != QoS.AT_MOST_ONCE) {
messageId = is.readShort();
}
ArrayList<Topic> list = new ArrayList<Topic>();
while(is.available() > 0) {
Topic topic = new Topic(MessageSupport.readUTF(is), QoS.values()[is.readByte()]);
list.add(topic);
}
topics = list.toArray(new Topic[list.size()]);
return this;
}
代码示例来源:origin: fusesource/mqtt-client
} else if ("--will-qos".equals(arg)) {
int v = Integer.parseInt(shift(argl));
if( v > QoS.values().length ) {
stderr("Invalid qos value : " + v);
displayHelpAndExit(1);
main.mqtt.setWillQos(QoS.values()[v]);
} else if ("--will-retain".equals(arg)) {
main.mqtt.setWillRetain(true);
} else if ("-q".equals(arg)) {
int v = Integer.parseInt(shift(argl));
if( v > QoS.values().length ) {
stderr("Invalid qos value : " + v);
displayHelpAndExit(1);
qos = QoS.values()[v];
} else if ("-t".equals(arg)) {
main.topics.add(new Topic(shift(argl), qos));
代码示例来源:origin: fusesource/mqtt-client
} else if ("--will-qos".equals(arg)) {
int v = Integer.parseInt(shift(argl));
if( v > QoS.values().length ) {
stderr("Invalid qos value : " + v);
displayHelpAndExit(1);
main.mqtt.setWillQos(QoS.values()[v]);
} else if ("--will-retain".equals(arg)) {
main.mqtt.setWillRetain(true);
} else if ("-q".equals(arg)) {
int v = Integer.parseInt(shift(argl));
if( v > QoS.values().length ) {
stderr("Invalid qos value : " + v);
displayHelpAndExit(1);
main.qos = QoS.values()[v];
} else if ("-r".equals(arg)) {
main.retain = true;
代码示例来源:origin: org.fusesource.mqtt-client/mqtt-client
protected QoS qos() {
return QoS.values()[((header & 0x06) >>> 1)];
}
protected HeaderBase qos(QoS qos) {
代码示例来源:origin: org.fusesource.mqtt-client/mqtt-client
public QoS willQos() {
return QoS.values()[willQos];
}
代码示例来源:origin: apache/activemq-artemis
@Override
public void publish(String topic, byte[] payload, int qos, boolean retained) throws Exception {
connection.publish(topic, payload, QoS.values()[qos], retained);
}
代码示例来源:origin: org.fusesource.mqtt-client/mqtt-client
public SUBSCRIBE decode(MQTTFrame frame) throws ProtocolException {
assert(frame.buffers.length == 1);
header(frame.header());
DataByteArrayInputStream is = new DataByteArrayInputStream(frame.buffers[0]);
QoS qos = qos();
if(qos != QoS.AT_MOST_ONCE) {
messageId = is.readShort();
}
ArrayList<Topic> list = new ArrayList<Topic>();
while(is.available() > 0) {
Topic topic = new Topic(MessageSupport.readUTF(is), QoS.values()[is.readByte()]);
list.add(topic);
}
topics = list.toArray(new Topic[list.size()]);
return this;
}
代码示例来源:origin: org.fusesource.mqtt-client/mqtt-client
} else if ("--will-qos".equals(arg)) {
int v = Integer.parseInt(shift(argl));
if( v > QoS.values().length ) {
stderr("Invalid qos value : " + v);
displayHelpAndExit(1);
main.mqtt.setWillQos(QoS.values()[v]);
} else if ("--will-retain".equals(arg)) {
main.mqtt.setWillRetain(true);
} else if ("-q".equals(arg)) {
int v = Integer.parseInt(shift(argl));
if( v > QoS.values().length ) {
stderr("Invalid qos value : " + v);
displayHelpAndExit(1);
main.qos = QoS.values()[v];
} else if ("-r".equals(arg)) {
main.retain = true;
代码示例来源:origin: org.fusesource.mqtt-client/mqtt-client
} else if ("--will-qos".equals(arg)) {
int v = Integer.parseInt(shift(argl));
if( v > QoS.values().length ) {
stderr("Invalid qos value : " + v);
displayHelpAndExit(1);
main.mqtt.setWillQos(QoS.values()[v]);
} else if ("--will-retain".equals(arg)) {
main.mqtt.setWillRetain(true);
} else if ("-q".equals(arg)) {
int v = Integer.parseInt(shift(argl));
if( v > QoS.values().length ) {
stderr("Invalid qos value : " + v);
displayHelpAndExit(1);
qos = QoS.values()[v];
} else if ("-t".equals(arg)) {
main.topics.add(new Topic(shift(argl), qos));
代码示例来源:origin: apache/activemq-artemis
@Override
public void subscribe(String topic, int qos) throws Exception {
Topic[] topics = {new Topic(utf8(topic), QoS.values()[qos])};
connection.subscribe(topics);
}
代码示例来源:origin: org.apache.activemq/activemq-all
if (message.propertyExists(QOS_PROPERTY_NAME)) {
int ordinal = message.getIntProperty(QOS_PROPERTY_NAME);
qoS = QoS.values()[ordinal];
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
if (message.propertyExists(QOS_PROPERTY_NAME)) {
int ordinal = message.getIntProperty(QOS_PROPERTY_NAME);
qoS = QoS.values()[ordinal];
代码示例来源:origin: io.fabric8.ipaas.apps/fabric8mq
if (message.propertyExists(QOS_PROPERTY_NAME)) {
int ordinal = message.getIntProperty(QOS_PROPERTY_NAME);
qoS = QoS.values()[ordinal];
代码示例来源:origin: org.apache.activemq/activemq-osgi
if (message.propertyExists(QOS_PROPERTY_NAME)) {
int ordinal = message.getIntProperty(QOS_PROPERTY_NAME);
qoS = QoS.values()[ordinal];
代码示例来源:origin: org.apache.activemq/activemq-mqtt
if (message.propertyExists(QOS_PROPERTY_NAME)) {
int ordinal = message.getIntProperty(QOS_PROPERTY_NAME);
qoS = QoS.values()[ordinal];
内容来源于网络,如有侵权,请联系作者删除!