Java 类io.netty.handler.codec.mqtt.MqttSubAckMessage 实例源码

项目:lannister    文件:MqttMessageFactory.java   
public static MqttSubAckMessage suback(int messageId, List<Integer> grantedQoSLevels) {
    MqttFixedHeader fixedHeader = new MqttFixedHeader(MqttMessageType.SUBACK, false, MqttQoS.AT_MOST_ONCE, false,
            2 + grantedQoSLevels.size());
    MqttMessageIdVariableHeader variableHeader = MqttMessageIdVariableHeader.from(messageId);
    MqttSubAckPayload payload = new MqttSubAckPayload(grantedQoSLevels);

    return new MqttSubAckMessage(fixedHeader, variableHeader, payload);
}
项目:activemq-artemis    文件:MQTTProtocolHandler.java   
void handleSubscribe(MqttSubscribeMessage message) throws Exception {
   MQTTSubscriptionManager subscriptionManager = session.getSubscriptionManager();
   int[] qos = subscriptionManager.addSubscriptions(message.payload().topicSubscriptions());

   MqttFixedHeader header = new MqttFixedHeader(MqttMessageType.SUBACK, false, MqttQoS.AT_MOST_ONCE, false, 0);
   MqttSubAckMessage ack = new MqttSubAckMessage(header, message.variableHeader(), new MqttSubAckPayload(qos));
   sendToClient(ack);
}
项目:iothub    文件:MqttTransportHandler.java   
private static MqttSubAckMessage createSubAckMessage(Integer msgId, List<Integer> grantedQoSList) {
  MqttFixedHeader mqttFixedHeader = new MqttFixedHeader(SUBACK, false, AT_LEAST_ONCE, false, 0);
  MqttMessageIdVariableHeader mqttMessageIdVariableHeader = MqttMessageIdVariableHeader.from(msgId);
  MqttSubAckPayload mqttSubAckPayload = new MqttSubAckPayload(grantedQoSList);
  return new MqttSubAckMessage(mqttFixedHeader, mqttMessageIdVariableHeader, mqttSubAckPayload);
}
项目:iotplatform    文件:MqttTransportHandler.java   
private static MqttSubAckMessage createSubAckMessage(Integer msgId, List<Integer> grantedQoSList) {
  MqttFixedHeader mqttFixedHeader = new MqttFixedHeader(SUBACK, false, AT_LEAST_ONCE, false, 0);
  MqttMessageIdVariableHeader mqttMessageIdVariableHeader = MqttMessageIdVariableHeader.from(msgId);
  MqttSubAckPayload mqttSubAckPayload = new MqttSubAckPayload(grantedQoSList);
  return new MqttSubAckMessage(mqttFixedHeader, mqttMessageIdVariableHeader, mqttSubAckPayload);
}
项目:moquette    文件:NettyChannelAssertions.java   
static void assertEqualsSubAck(/* byte expectedCode, */ Object subAck) {
    assertTrue(subAck instanceof MqttSubAckMessage);
    // SubAckMessage connAckMsg = (SubAckMessage) connAck;
    // assertEquals(expectedCode, connAckMsg.getReturnCode());
}