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


Java ItemPublishEvent类代码示例

本文整理汇总了Java中org.jivesoftware.smackx.pubsub.ItemPublishEvent的典型用法代码示例。如果您正苦于以下问题:Java ItemPublishEvent类的具体用法?Java ItemPublishEvent怎么用?Java ItemPublishEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: handlePublishedItems

import org.jivesoftware.smackx.pubsub.ItemPublishEvent; //导入依赖的package包/类
/**
 * Item handler of this data handler implementation. Checks if received items are already cached,
 * if not, it caches them. Ultimately it sends the items to the subscribed listeners.
 */
@Override
public void handlePublishedItems(ItemPublishEvent<PayloadItem<SimplePayload>> items){
	String spaceId = getSpaceId(items.getNodeId());
	if (spaceId == null) return;
	List<String> toRequest = new ArrayList<String>();
	for (PayloadItem<SimplePayload> item:items.getItems()){
       	if (item.getPayload() == null && !pendingPayloadRequests.containsKey(item.getId())){
       		toRequest.add(item.getId());
       		continue;
       	}
       	DataObject obj = parseItemToDataObject(item);
       	if (dataObjectFilter == null || dataObjectFilter.isDataObjectValid(obj)) {
			if (!datawrapper.isDataObjectAlreadyCached(item.getId())){
				datawrapper.saveDataObject(items.getNodeId(), obj, item.getId());
			}
			for (DataObjectListener listener:listeners){
				listener.handleDataObject(obj, spaceId);
			}
		}
	}
	if (!toRequest.isEmpty()){
		for (String id:toRequest){
			try {
				retrievePayload(items.getNodeId(), id);
			} catch (Exception e) {
				//Ignore
				continue;
			}
		}
	}
}
 
开发者ID:MirrorIP,项目名称:msf-spaces-sdk-android,代码行数:36,代码来源:DataHandler.java

示例2: handlePublishedItems

import org.jivesoftware.smackx.pubsub.ItemPublishEvent; //导入依赖的package包/类
/**
 * Called whenever an item is published to the node the listener
 * is registered with.
 * 
 * @param items The publishing details.
 */
void handlePublishedItems(ItemPublishEvent<T> items);
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:8,代码来源:ItemEventListener.java

示例3: handlePublishedItems

import org.jivesoftware.smackx.pubsub.ItemPublishEvent; //导入依赖的package包/类
/**
 * Called whenever an item is published to the node the listener is
 * registered with.
 * 
 * @param items
 *            The publishing details.
 */
void handlePublishedItems(ItemPublishEvent<T> items);
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:9,代码来源:ItemEventListener.java


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