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


Java DiscoverItems.addItem方法代码示例

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


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

示例1: publishCommands

import org.jivesoftware.smackx.packet.DiscoverItems; //导入方法依赖的package包/类
/**
 * Publish the commands to an specific JID.
 *
 * @param jid the full JID to publish the commands to.
 * @throws XMPPException if the operation failed for some reason.
 */
public void publishCommands(String jid) throws XMPPException {
    ServiceDiscoveryManager serviceDiscoveryManager = ServiceDiscoveryManager
            .getInstanceFor(connection);

    // Collects the commands to publish as items
    DiscoverItems discoverItems = new DiscoverItems();
    Collection<AdHocCommandInfo> xCommandsList = getRegisteredCommands();

    for (AdHocCommandInfo info : xCommandsList) {
        DiscoverItems.Item item = new DiscoverItems.Item(info.getOwnerJID());
        item.setName(info.getName());
        item.setNode(info.getNode());
        discoverItems.addItem(item);
    }

    serviceDiscoveryManager.publishItems(jid, discoNode, discoverItems);
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:24,代码来源:AdHocCommandManager.java

示例2: publishCommands

import org.jivesoftware.smackx.packet.DiscoverItems; //导入方法依赖的package包/类
/**
 * Publish the commands to an specific JID.
 * 
 * @param jid
 *            the full JID to publish the commands to.
 * @throws XMPPException
 *             if the operation failed for some reason.
 */
public void publishCommands(String jid) throws XMPPException {
	ServiceDiscoveryManager serviceDiscoveryManager = ServiceDiscoveryManager
			.getInstanceFor(connection);

	// Collects the commands to publish as items
	DiscoverItems discoverItems = new DiscoverItems();
	Collection<AdHocCommandInfo> xCommandsList = getRegisteredCommands();

	for (AdHocCommandInfo info : xCommandsList) {
		DiscoverItems.Item item = new DiscoverItems.Item(info.getOwnerJID());
		item.setName(info.getName());
		item.setNode(info.getNode());
		discoverItems.addItem(item);
	}

	serviceDiscoveryManager.publishItems(jid, discoNode, discoverItems);
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:26,代码来源:AdHocCommandManager.java

示例3: publishCommands

import org.jivesoftware.smackx.packet.DiscoverItems; //导入方法依赖的package包/类
/**
 * Publish the commands to an specific JID.
 *
 * @param jid the full JID to publish the commands to.
 * @throws XMPPException if the operation failed for some reason.
 */
public void publishCommands(String jid) throws XMPPException {
    // Collects the commands to publish as items
    DiscoverItems discoverItems = new DiscoverItems();
    Collection<AdHocCommandInfo> xCommandsList = getRegisteredCommands();

    for (AdHocCommandInfo info : xCommandsList) {
        DiscoverItems.Item item = new DiscoverItems.Item(info.getOwnerJID());
        item.setName(info.getName());
        item.setNode(info.getNode());
        discoverItems.addItem(item);
    }

    serviceDiscoveryManager.publishItems(jid, discoNode, discoverItems);
}
 
开发者ID:CJC-ivotten,项目名称:androidPN-client.,代码行数:21,代码来源:AdHocCommandManager.java


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