public class LeafNode extends Node
Node.ItemDeleteTranslator, Node.ItemEventTranslator, Node.NodeConfigTranslator
configEventToListenerMap, id, itemDeleteToListenerMap, itemEventToListenerMap, pubSubManager
Modifier and Type | Method and Description |
---|---|
void |
deleteAllItems()
Purges the node of all items.
|
void |
deleteItem(java.util.Collection<java.lang.String> itemIds)
Delete the items with the specified id's from the node.
|
void |
deleteItem(java.lang.String itemId)
Delete the item with the specified id from the node.
|
DiscoverItems |
discoverItems()
Get information on the items in the node in standard
DiscoverItems format. |
<T extends Item> |
getItems()
Get the current items stored in the node.
|
<T extends Item> |
getItems(java.util.Collection<java.lang.String> ids)
Get the items specified from the node.
|
<T extends Item> |
getItems(int maxItems)
Get items persisted on the node, limited to the specified number.
|
<T extends Item> |
getItems(int maxItems,
java.lang.String subscriptionId)
Get items persisted on the node, limited to the specified number
based on the subscription associated with the provided subscriptionId.
|
<T extends Item> |
getItems(java.util.List<org.jivesoftware.smack.packet.ExtensionElement> additionalExtensions,
java.util.List<org.jivesoftware.smack.packet.ExtensionElement> returnedExtensions)
Get items persisted on the node.
|
<T extends Item> |
getItems(java.lang.String subscriptionId)
Get the current items stored in the node based
on the subscription associated with the provided
subscription id.
|
void |
publish()
Publishes an event to the node.
|
<T extends Item> |
publish(java.util.Collection<T> items)
Publishes multiple events to the node.
|
<T extends Item> |
publish(T item)
Publishes an event to the node.
|
void |
send()
Deprecated.
use
publish() instead. |
<T extends Item> |
send(java.util.Collection<T> items)
Deprecated.
use
publish(Collection) instead. |
<T extends Item> |
send(T item)
Deprecated.
use
publish(Item) instead. |
addConfigurationListener, addItemDeleteListener, addItemEventListener, createPubsubPacket, createPubsubPacket, discoverInfo, getAffiliations, getAffiliations, getAffiliationsAsOwner, getAffiliationsAsOwner, getId, getNodeConfiguration, getSubscriptionOptions, getSubscriptionOptions, getSubscriptions, getSubscriptions, getSubscriptionsAsOwner, getSubscriptionsAsOwner, modifyAffiliationAsOwner, removeConfigurationListener, removeItemDeleteListener, removeItemEventListener, sendConfigurationForm, sendPubsubPacket, subscribe, subscribe, toString, unsubscribe, unsubscribe
public DiscoverItems discoverItems() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
DiscoverItems
format.DiscoverItems
formatorg.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
public <T extends Item> java.util.List<T> getItems() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
T
- type of the items.Item
in the nodeorg.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
public <T extends Item> java.util.List<T> getItems(java.lang.String subscriptionId) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
T
- type of the items.subscriptionId
- - The subscription id for the
associated subscription.Item
in the nodeorg.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
public <T extends Item> java.util.List<T> getItems(java.util.Collection<java.lang.String> ids) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
getItems()
or an
event, that did not include the payload.T
- type of the items.ids
- Item ids of the items to retrieveItem
with payloadorg.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
public <T extends Item> java.util.List<T> getItems(int maxItems) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
T
- type of the items.maxItems
- Maximum number of items to returnItem
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
public <T extends Item> java.util.List<T> getItems(int maxItems, java.lang.String subscriptionId) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
T
- type of the items.maxItems
- Maximum number of items to returnsubscriptionId
- The subscription which the retrieval is based
on.Item
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
public <T extends Item> java.util.List<T> getItems(java.util.List<org.jivesoftware.smack.packet.ExtensionElement> additionalExtensions, java.util.List<org.jivesoftware.smack.packet.ExtensionElement> returnedExtensions) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
additionalExtensions
can be used e.g. to add a "Result Set Management" extension.
returnedExtensions
will be filled with the stanza extensions found in the answer.
T
- type of the items.additionalExtensions
- additional PacketExtensions
to be added to the request.
This is an optional argument, if provided as null no extensions will be added.returnedExtensions
- a collection that will be filled with the returned packet
extensions. This is an optional argument, if provided as null it won't be populated.Item
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
@Deprecated public void send() throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException
publish()
instead.ConfigureForm.isPersistItems()
=false
and ConfigureForm.isDeliverPayloads()
=false.org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
@Deprecated public <T extends Item> void send(T item) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException
publish(Item)
instead.send()
, which
publishes an event with NO item.T
- type of the items.item
- - The item being sentorg.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
@Deprecated public <T extends Item> void send(java.util.Collection<T> items) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException
publish(Collection)
instead.publish(Item)
.
In addition, if ConfigureForm.isPersistItems()
=false, only the last item in the input
list will get stored on the node, assuming it stores the last sent item.T
- type of the items.items
- - The collection of items being sentorg.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
public void publish() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
ConfigureForm.isPersistItems()
=false
and ConfigureForm.isDeliverPayloads()
=false.org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
public <T extends Item> void publish(T item) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
send()
, which
publishes an event with NO item.T
- type of the items.item
- - The item being sentorg.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
public <T extends Item> void publish(java.util.Collection<T> items) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
send(Item)
.
In addition, if ConfigureForm.isPersistItems()
=false, only the last item in the input
list will get stored on the node, assuming it stores the last sent item.T
- type of the items.items
- - The collection of Item
objects being sentorg.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
public void deleteAllItems() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Note: Some implementations may keep the last item sent.
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
public void deleteItem(java.lang.String itemId) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
itemId
- The id of the itemorg.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
public void deleteItem(java.util.Collection<java.lang.String> itemIds) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
itemIds
- The list of id's of items to deleteorg.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException