本文整理汇总了Java中org.jivesoftware.smackx.pubsub.packet.SyncPacketSend类的典型用法代码示例。如果您正苦于以下问题:Java SyncPacketSend类的具体用法?Java SyncPacketSend怎么用?Java SyncPacketSend使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SyncPacketSend类属于org.jivesoftware.smackx.pubsub.packet包,在下文中一共展示了SyncPacketSend类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getNode
import org.jivesoftware.smackx.pubsub.packet.SyncPacketSend; //导入依赖的package包/类
/**
* Retrieves the requested node, if it exists. It will throw an
* exception if it does not.
*
* @param id - The unique id of the node
* @return the node
* @throws XMPPException The node does not exist
*/
public Node getNode(String id)
throws XMPPException
{
Node node = nodeMap.get(id);
if (node == null)
{
DiscoverInfo info = new DiscoverInfo();
info.setTo(to);
info.setNode(id);
DiscoverInfo infoReply = (DiscoverInfo)SyncPacketSend.getReply(con, info);
if (infoReply.getIdentities().next().getType().equals(NodeType.leaf.toString()))
node = new LeafNode(con, id);
else
node = new CollectionNode(con, id);
node.setTo(to);
nodeMap.put(id, node);
}
return node;
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:31,代码来源:PubSubManager.java
示例2: getItems
import org.jivesoftware.smackx.pubsub.packet.SyncPacketSend; //导入依赖的package包/类
/**
* Get the items specified from the node. This would typically be
* used when the server does not return the payload due to size
* constraints. The user would be required to retrieve the payload
* after the items have been retrieved via {@link #getItems()} or an
* event, that did not include the payload.
*
* @param ids Item ids of the items to retrieve
*
* @return The list of {@link Item} with payload
*
* @throws XMPPException
*/
public <T extends Item> List<T> getItems(Collection<String> ids)
throws XMPPException
{
List<Item> itemList = new ArrayList<Item>(ids.size());
for (String id : ids)
{
itemList.add(new Item(id));
}
PubSub request = createPubsubPacket(Type.GET, new ItemsExtension(ItemsExtension.ItemsElementType.items, getId(), itemList));
PubSub result = (PubSub)SyncPacketSend.getReply(con, request);
ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
return (List<T>)itemsElem.getItems();
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:29,代码来源:LeafNode.java
示例3: getNode
import org.jivesoftware.smackx.pubsub.packet.SyncPacketSend; //导入依赖的package包/类
/**
* Retrieves the requested node, if it exists. It will throw an
* exception if it does not.
*
* @param id - The unique id of the node
* @return the node
* @throws XMPPException The node does not exist
*/
public <T extends Node> T getNode(String id)
throws XMPPException
{
Node node = nodeMap.get(id);
if (node == null)
{
DiscoverInfo info = new DiscoverInfo();
info.setTo(to);
info.setNode(id);
DiscoverInfo infoReply = (DiscoverInfo)SyncPacketSend.getReply(con, info);
if (infoReply.getIdentities().next().getType().equals(NodeType.leaf.toString()))
node = new LeafNode(con, id);
else
node = new CollectionNode(con, id);
node.setTo(to);
nodeMap.put(id, node);
}
return (T) node;
}
开发者ID:CJC-ivotten,项目名称:androidPN-client.,代码行数:31,代码来源:PubSubManager.java
示例4: getNode
import org.jivesoftware.smackx.pubsub.packet.SyncPacketSend; //导入依赖的package包/类
/**
* Retrieves the requested node, if it exists. It will throw an exception if
* it does not.
*
* @param id
* - The unique id of the node
* @return the node
* @throws XMPPException
* The node does not exist
*/
public Node getNode(String id) throws XMPPException {
Node node = nodeMap.get(id);
if (node == null) {
DiscoverInfo info = new DiscoverInfo();
info.setTo(to);
info.setNode(id);
DiscoverInfo infoReply = (DiscoverInfo) SyncPacketSend.getReply(
con, info);
if (infoReply.getIdentities().next().getType()
.equals(NodeType.leaf.toString()))
node = new LeafNode(con, id);
else
node = new CollectionNode(con, id);
node.setTo(to);
nodeMap.put(id, node);
}
return node;
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:32,代码来源:PubSubManager.java
示例5: getItems
import org.jivesoftware.smackx.pubsub.packet.SyncPacketSend; //导入依赖的package包/类
/**
* Get the items specified from the node. This would typically be used when
* the server does not return the payload due to size constraints. The user
* would be required to retrieve the payload after the items have been
* retrieved via {@link #getItems()} or an event, that did not include the
* payload.
*
* @param ids
* Item ids of the items to retrieve
*
* @return The list of {@link Item} with payload
*
* @throws XMPPException
*/
public <T extends Item> List<T> getItems(Collection<String> ids)
throws XMPPException {
List<Item> itemList = new ArrayList<Item>(ids.size());
for (String id : ids) {
itemList.add(new Item(id));
}
PubSub request = createPubsubPacket(Type.GET, new ItemsExtension(
ItemsExtension.ItemsElementType.items, getId(), itemList));
PubSub result = (PubSub) SyncPacketSend.getReply(con, request);
ItemsExtension itemsElem = (ItemsExtension) result
.getExtension(PubSubElementType.ITEMS);
return (List<T>) itemsElem.getItems();
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:30,代码来源:LeafNode.java
示例6: discoverItems
import org.jivesoftware.smackx.pubsub.packet.SyncPacketSend; //导入依赖的package包/类
/**
* Get information on the items in the node in standard
* {@link DiscoverItems} format.
*
* @return The item details in {@link DiscoverItems} format
*
* @throws XMPPException
*/
public DiscoverItems discoverItems()
throws XMPPException
{
DiscoverItems items = new DiscoverItems();
items.setTo(to);
items.setNode(getId());
return (DiscoverItems)SyncPacketSend.getReply(con, items);
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:17,代码来源:LeafNode.java
示例7: deleteItem
import org.jivesoftware.smackx.pubsub.packet.SyncPacketSend; //导入依赖的package包/类
/**
* Delete the items with the specified id's from the node.
*
* @param itemIds The list of id's of items to delete
*
* @throws XMPPException
*/
public void deleteItem(Collection<String> itemIds)
throws XMPPException
{
List<Item> items = new ArrayList<Item>(itemIds.size());
for (String id : itemIds)
{
items.add(new Item(id));
}
PubSub request = createPubsubPacket(Type.SET, new ItemsExtension(ItemsExtension.ItemsElementType.retract, getId(), items));
SyncPacketSend.getReply(con, request);
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:20,代码来源:LeafNode.java
示例8: sendConfigurationForm
import org.jivesoftware.smackx.pubsub.packet.SyncPacketSend; //导入依赖的package包/类
/**
* Update the configuration with the contents of the new {@link Form}
*
* @param submitForm
*/
public void sendConfigurationForm(Form submitForm)
throws XMPPException
{
PubSub packet = createPubsubPacket(Type.SET, new FormNode(FormNodeType.CONFIGURE_OWNER, getId(), submitForm), PubSubNamespace.OWNER);
SyncPacketSend.getReply(con, packet);
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:12,代码来源:Node.java
示例9: discoverInfo
import org.jivesoftware.smackx.pubsub.packet.SyncPacketSend; //导入依赖的package包/类
/**
* Discover node information in standard {@link DiscoverInfo} format.
*
* @return The discovery information about the node.
*
* @throws XMPPException
*/
public DiscoverInfo discoverInfo()
throws XMPPException
{
DiscoverInfo info = new DiscoverInfo();
info.setTo(to);
info.setNode(getId());
return (DiscoverInfo)SyncPacketSend.getReply(con, info);
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:16,代码来源:Node.java
示例10: deleteItem
import org.jivesoftware.smackx.pubsub.packet.SyncPacketSend; //导入依赖的package包/类
/**
* Delete the items with the specified id's from the node.
*
* @param itemIds
* The list of id's of items to delete
*
* @throws XMPPException
*/
public void deleteItem(Collection<String> itemIds) throws XMPPException {
List<Item> items = new ArrayList<Item>(itemIds.size());
for (String id : itemIds) {
items.add(new Item(id));
}
PubSub request = createPubsubPacket(Type.SET, new ItemsExtension(
ItemsExtension.ItemsElementType.retract, getId(), items));
SyncPacketSend.getReply(con, request);
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:19,代码来源:LeafNode.java
示例11: sendConfigurationForm
import org.jivesoftware.smackx.pubsub.packet.SyncPacketSend; //导入依赖的package包/类
/**
* Update the configuration with the contents of the new {@link Form}
*
* @param submitForm
*/
public void sendConfigurationForm(Form submitForm) throws XMPPException {
PubSub packet = createPubsubPacket(Type.SET, new FormNode(
FormNodeType.CONFIGURE_OWNER, getId(), submitForm),
PubSubNamespace.OWNER);
SyncPacketSend.getReply(con, packet);
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:12,代码来源:Node.java
注:本文中的org.jivesoftware.smackx.pubsub.packet.SyncPacketSend类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论