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


Java LeafNode类代码示例

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


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

示例1: removeSpace

import org.jivesoftware.smackx.pubsub.LeafNode; //导入依赖的package包/类
/**
 * Removes a space from the list of observed spaces.
 * If the space is not in the list of observed spaces, nothing happens.
 * @param spaceId Identifier of the space to observe.
 */
@Override
public void removeSpace(String spaceId) {
	Space space = spaceHandler.getSpace(spaceId);
	if (handledSpaces.remove(space)){
		SpaceChannel channel = space.getPubSubChannel();
		Map<String, String> properties = channel.getProperties();
		datawrapper.deleteCachedDataObjectsForSpace(properties.get("node"));
		if (getMode() == Mode.ONLINE){
			try {
				LeafNode node = (LeafNode) getNode(properties.get("node"), properties.get("domain"));
				node.removeItemEventListener(this);
			} catch (UnknownEntityException e) {
				Log.d("DATAHANDLER", "An UnknownEntityException was thrown while removing a registered space.", e);
			}
		}
	}
}
 
开发者ID:MirrorIP,项目名称:msf-spaces-sdk-android,代码行数:23,代码来源:DataHandler.java

示例2: XMPPPublisher

import org.jivesoftware.smackx.pubsub.LeafNode; //导入依赖的package包/类
private void XMPPPublisher(String xmlString, String SCHEMA, String mtype, Node pubNode){
	
	SimplePayload payload = new SimplePayload(mtype,SCHEMA, xmlString);

	@SuppressWarnings({ "unchecked", "rawtypes" })
	PayloadItem payloadItem = new PayloadItem(null, payload);
	
	Log.i(appTAG, classTAG+": Message Published to:"+pubNode.getId());
	
	try {
		((LeafNode)pubNode).publish(payloadItem);
	} catch (NotConnectedException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
}
 
开发者ID:NitLab,项目名称:Android_Resource_Controller,代码行数:18,代码来源:MessagePublisher.java

示例3: getRandomPubnode

import org.jivesoftware.smackx.pubsub.LeafNode; //导入依赖的package包/类
protected LeafNode getRandomPubnode(PubSubManager pubMgr, boolean persistItems, boolean deliverPayload) throws XMPPException
{
	ConfigureForm form = new ConfigureForm(FormType.submit);
	form.setPersistentItems(persistItems);
	form.setDeliverPayloads(deliverPayload);
	form.setAccessModel(AccessModel.open);
	return (LeafNode)pubMgr.createNode("/test/Pubnode" + System.currentTimeMillis(), form);
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:9,代码来源:PubSubTestCase.java

示例4: publishAvatarData

import org.jivesoftware.smackx.pubsub.LeafNode; //导入依赖的package包/类
/**
    * Publish an avatar data.
    *
    * @param id the id of the avatar data
    * @param data the data of the avatar
    */
   private void publishAvatarData(String id, byte[] data) {
AvatarExtension avatar = new AvatarExtension(data);
PayloadItem<AvatarExtension> item = new PayloadItem<AvatarExtension>(id, avatar);
LeafNode node = mPep.getPEPNode(AVATARDATA_NODE);
node.publish(item);
   }
 
开发者ID:BoogieMAN2K,项目名称:Beem,代码行数:13,代码来源:AvatarManager.java

示例5: getAvatar

import org.jivesoftware.smackx.pubsub.LeafNode; //导入依赖的package包/类
@Override
   public byte[] getAvatar() {
try {
    LeafNode node = mPubsub.getPEPNode(AVATARDATANODE);
    List<Item> items = node.getItems(Arrays.asList(mId));
    PayloadItem<AvatarExtension> item = (PayloadItem<AvatarExtension>) items.get(0);
    AvatarExtension avatar = item.getPayload();
    return avatar.getData();
} catch (XMPPException e) {
    return null;
}
   }
 
开发者ID:BoogieMAN2K,项目名称:Beem,代码行数:13,代码来源:XmppAvatarRetriever.java

示例6: getPubnode

import org.jivesoftware.smackx.pubsub.LeafNode; //导入依赖的package包/类
protected LeafNode getPubnode(boolean persistItems, boolean deliverPayload) throws XMPPException
{
	return getRandomPubnode(getManager(), persistItems, deliverPayload);
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:5,代码来源:SingleUserTestCase.java

示例7: getPEPNode

import org.jivesoftware.smackx.pubsub.LeafNode; //导入依赖的package包/类
/**
    * Get a PepNode.
    * This node is obtain without checking its existence as PEP should auto create it.
    *
    * @param nodeName the node name
    * @return the node
    */
   public LeafNode getPEPNode(String nodeName) {
LeafNode node = new LeafNode(con, nodeName);
node.setTo(to);
return node;
   }
 
开发者ID:BoogieMAN2K,项目名称:Beem,代码行数:13,代码来源:PepSubManager.java

示例8: publishAvatarMetaData

import org.jivesoftware.smackx.pubsub.LeafNode; //导入依赖的package包/类
/**
    * Send the metadata of the avatar you want to publish.
    * By sending this metadata, you publish an avatar.
    *
    * @param id the id of the metadata item
    * @param metadata the metadata to publish
    */
   public void publishAvatarMetaData(String id, AvatarMetadataExtension metadata) {
PayloadItem<AvatarMetadataExtension> item = new PayloadItem<AvatarMetadataExtension>(id, metadata);
LeafNode node = mPep.getPEPNode(AVATARMETADATA_NODE);
node.publish(item);
   }
 
开发者ID:BoogieMAN2K,项目名称:Beem,代码行数:13,代码来源:AvatarManager.java


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