当前位置: 首页>>代码示例>>Java>>正文


Java MqttWireMessage.getMessageId方法代码示例

本文整理汇总了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);
}
 
开发者ID:gulliverrr,项目名称:hestia-engine-dev,代码行数:18,代码来源:ClientState.java

示例2: getSendPersistenceKey

import org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage; //导入方法依赖的package包/类
private String getSendPersistenceKey(MqttWireMessage message) {
	return PERSISTENCE_SENT_PREFIX + message.getMessageId();
}
 
开发者ID:gulliverrr,项目名称:hestia-engine-dev,代码行数:4,代码来源:ClientState.java

示例3: getSendConfirmPersistenceKey

import org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage; //导入方法依赖的package包/类
private String getSendConfirmPersistenceKey(MqttWireMessage message) {
	return PERSISTENCE_CONFIRMED_PREFIX + message.getMessageId();
}
 
开发者ID:gulliverrr,项目名称:hestia-engine-dev,代码行数:4,代码来源:ClientState.java

示例4: getReceivedPersistenceKey

import org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage; //导入方法依赖的package包/类
private String getReceivedPersistenceKey(MqttWireMessage message) {
	return PERSISTENCE_RECEIVED_PREFIX + message.getMessageId();
}
 
开发者ID:gulliverrr,项目名称:hestia-engine-dev,代码行数:4,代码来源:ClientState.java

示例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);
			}
		}
	}
}
 
开发者ID:gulliverrr,项目名称:hestia-engine-dev,代码行数:52,代码来源:ClientState.java


注:本文中的org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage.getMessageId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。