本文整理汇总了Java中org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage.getMessageId方法的典型用法代码示例。如果您正苦于以下问题:Java MqttWireMessage.getMessageId方法的具体用法?Java MqttWireMessage.getMessageId怎么用?Java MqttWireMessage.getMessageId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage
的用法示例。
在下文中一共展示了MqttWireMessage.getMessageId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertInOrder
import org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage; //导入方法依赖的package包/类
/**
* Inserts a new message to the list, ensuring that list is ordered from lowest to highest in terms of the message id's.
* @param list the list to insert the message into
* @param newMsg the message to insert into the list
*/
private void insertInOrder(Vector list, MqttWireMessage newMsg) {
int newMsgId = newMsg.getMessageId();
for (int i = 0; i < list.size(); i++) {
MqttWireMessage otherMsg = (MqttWireMessage) list.elementAt(i);
int otherMsgId = otherMsg.getMessageId();
if (otherMsgId > newMsgId) {
list.insertElementAt(newMsg, i);
return;
}
}
list.addElement(newMsg);
}
示例2: getSendPersistenceKey
import org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage; //导入方法依赖的package包/类
private String getSendPersistenceKey(MqttWireMessage message) {
return PERSISTENCE_SENT_PREFIX + message.getMessageId();
}
示例3: getSendConfirmPersistenceKey
import org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage; //导入方法依赖的package包/类
private String getSendConfirmPersistenceKey(MqttWireMessage message) {
return PERSISTENCE_CONFIRMED_PREFIX + message.getMessageId();
}
示例4: getReceivedPersistenceKey
import org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage; //导入方法依赖的package包/类
private String getReceivedPersistenceKey(MqttWireMessage message) {
return PERSISTENCE_RECEIVED_PREFIX + message.getMessageId();
}
示例5: notifyReceivedMsg
import org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage; //导入方法依赖的package包/类
/**
* Called by the CommsReceiver when a message has been received.
* Handles inbound messages and other flows such as PUBREL.
*
* @param message
* @throws MqttException
*/
protected void notifyReceivedMsg(MqttWireMessage message) throws MqttException {
final String methodName = "notifyReceivedMsg";
this.lastInboundActivity = System.currentTimeMillis();
// @TRACE 651=received key={0} message={1}
log.fine(CLASS_NAME, methodName, "651", new Object[] {
new Integer(message.getMessageId()), message });
if (!quiescing) {
if (message instanceof MqttPublish) {
MqttPublish send = (MqttPublish) message;
switch (send.getMessage().getQos()) {
case 0:
case 1:
if (callback != null) {
callback.messageArrived(send);
}
break;
case 2:
persistence.put(getReceivedPersistenceKey(message),
(MqttPublish) message);
inboundQoS2.put(new Integer(send.getMessageId()), send);
this.send(new MqttPubRec(send), null);
break;
default:
//should NOT reach here
}
} else if (message instanceof MqttPubRel) {
MqttPublish sendMsg = (MqttPublish) inboundQoS2
.get(new Integer(message.getMessageId()));
if (sendMsg != null) {
if (callback != null) {
callback.messageArrived(sendMsg);
}
} else {
// Original publish has already been delivered.
MqttPubComp pubComp = new MqttPubComp(message
.getMessageId());
this.send(pubComp, null);
}
}
}
}