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


Java RosterPacket.getPacketID方法代码示例

本文整理汇总了Java中org.jivesoftware.smack.packet.RosterPacket.getPacketID方法的典型用法代码示例。如果您正苦于以下问题:Java RosterPacket.getPacketID方法的具体用法?Java RosterPacket.getPacketID怎么用?Java RosterPacket.getPacketID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jivesoftware.smack.packet.RosterPacket的用法示例。


在下文中一共展示了RosterPacket.getPacketID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reload

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
/**
 * Reloads the entire roster from the server. This is an asynchronous operation,
 * which means the method will return immediately, and the roster will be
 * reloaded at a later point when the server responds to the reload request.
 * 
 * @throws IllegalStateException if connection is not logged in or logged in anonymously
 */
public void reload() {
    if (!connection.isAuthenticated()) {
        throw new IllegalStateException("Not logged in to server.");
    }
    if (connection.isAnonymous()) {
        throw new IllegalStateException("Anonymous users can't have a roster.");
    }

	RosterPacket packet = new RosterPacket();
	if(persistentStorage!=null){
		packet.setVersion(persistentStorage.getRosterVersion());
	}
	requestPacketId = packet.getPacketID();
	PacketFilter idFilter = new PacketIDFilter(requestPacketId);
	connection.addPacketListener(new RosterResultListener(), idFilter);
    connection.sendPacket(packet);
}
 
开发者ID:CJC-ivotten,项目名称:androidPN-client.,代码行数:25,代码来源:Roster.java

示例2: reload

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
/**
 * Reloads the entire roster from the server. This is an asynchronous
 * operation, which means the method will return immediately, and the roster
 * will be reloaded at a later point when the server responds to the reload
 * request.
 * 
 * @throws IllegalStateException
 *             if connection is not logged in or logged in anonymously
 */
public void reload() {
	if (!connection.isAuthenticated()) {
		throw new IllegalStateException("Not logged in to server.");
	}
	if (connection.isAnonymous()) {
		throw new IllegalStateException(
				"Anonymous users can't have a roster.");
	}

	RosterPacket packet = new RosterPacket();
	if (persistentStorage != null) {
		packet.setVersion(persistentStorage.getRosterVersion());
	}
	requestPacketId = packet.getPacketID();
	PacketFilter idFilter = new PacketIDFilter(requestPacketId);
	connection.addPacketListener(new RosterResultListener(), idFilter);
	connection.sendPacket(packet);
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:28,代码来源:Roster.java

示例3: reload

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
/**
 * Reloads the entire roster from the server. This is an asynchronous operation,
 * which means the method will return immediately, and the roster will be
 * reloaded at a later point when the server responds to the reload request.
 */
public void reload() {
	RosterPacket packet = new RosterPacket();
	if(persistentStorage!=null){
		packet.setVersion(persistentStorage.getRosterVersion());
	}
	requestPacketId = packet.getPacketID();
	PacketFilter idFilter = new PacketIDFilter(requestPacketId);
	connection.addPacketListener(new RosterResultListener(), idFilter);
    connection.sendPacket(packet);
}
 
开发者ID:samuelhehe,项目名称:androidpn_enhanced_client,代码行数:16,代码来源:Roster.java


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