|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smackx.pubsub.Node
public abstract class Node
Nested Class Summary | |
---|---|
class |
Node.ItemDeleteTranslator
This class translates low level item deletion events into api level objects for user consumption. |
class |
Node.ItemEventTranslator
This class translates low level item publication events into api level objects for user consumption. |
class |
Node.NodeConfigTranslator
This class translates low level node configuration events into api level objects for user consumption. |
Field Summary | |
---|---|
protected Connection |
con
|
protected java.util.concurrent.ConcurrentHashMap<NodeConfigListener,PacketListener> |
configEventToListenerMap
|
protected String |
id
|
protected java.util.concurrent.ConcurrentHashMap<ItemDeleteListener,PacketListener> |
itemDeleteToListenerMap
|
protected java.util.concurrent.ConcurrentHashMap<ItemEventListener,PacketListener> |
itemEventToListenerMap
|
protected String |
to
|
Method Summary | |
---|---|
void |
addConfigurationListener(NodeConfigListener listener)
Register a listener for configuration events. |
void |
addItemDeleteListener(ItemDeleteListener listener)
Register an listener for item delete events. |
void |
addItemEventListener(ItemEventListener listener)
Register a listener for item publication events. |
protected PubSub |
createPubsubPacket(IQ.Type type,
PacketExtension ext)
|
protected PubSub |
createPubsubPacket(IQ.Type type,
PacketExtension ext,
PubSubNamespace ns)
|
DiscoverInfo |
discoverInfo()
Discover node information in standard DiscoverInfo format. |
String |
getId()
Get the NodeId |
ConfigureForm |
getNodeConfiguration()
Returns a configuration form, from which you can create an answer form to be submitted via the sendConfigurationForm(Form) . |
SubscribeForm |
getSubscriptionOptions(String jid)
Returns a SubscribeForm for subscriptions, from which you can create an answer form to be submitted via the sendConfigurationForm(Form) . |
SubscribeForm |
getSubscriptionOptions(String jid,
String subscriptionId)
Get the options for configuring the specified subscription. |
List<Subscription> |
getSubscriptions()
Get the subscriptions currently associated with this node. |
void |
removeConfigurationListener(NodeConfigListener listener)
Unregister a listener for configuration events. |
void |
removeItemDeleteListener(ItemDeleteListener listener)
Unregister a listener for item delete events. |
void |
removeItemEventListener(ItemEventListener listener)
Unregister a listener for publication events. |
void |
sendConfigurationForm(Form submitForm)
Update the configuration with the contents of the new Form |
protected Packet |
sendPubsubPacket(IQ.Type type,
NodeExtension ext)
|
protected Packet |
sendPubsubPacket(IQ.Type type,
NodeExtension ext,
PubSubNamespace ns)
|
Subscription |
subscribe(String jid)
The user subscribes to the node using the supplied jid. |
Subscription |
subscribe(String jid,
SubscribeForm subForm)
The user subscribes to the node using the supplied jid and subscription options. |
String |
toString()
|
void |
unsubscribe(String jid)
Remove the subscription related to the specified JID. |
void |
unsubscribe(String jid,
String subscriptionId)
Remove the specific subscription related to the specified JID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Connection con
protected String id
protected String to
protected java.util.concurrent.ConcurrentHashMap<ItemEventListener,PacketListener> itemEventToListenerMap
protected java.util.concurrent.ConcurrentHashMap<ItemDeleteListener,PacketListener> itemDeleteToListenerMap
protected java.util.concurrent.ConcurrentHashMap<NodeConfigListener,PacketListener> configEventToListenerMap
Method Detail |
---|
public String getId()
public ConfigureForm getNodeConfiguration() throws XMPPException
sendConfigurationForm(Form)
.
XMPPException
public void sendConfigurationForm(Form submitForm) throws XMPPException
Form
submitForm
-
XMPPException
public DiscoverInfo discoverInfo() throws XMPPException
DiscoverInfo
format.
XMPPException
public List<Subscription> getSubscriptions() throws XMPPException
Subscription
XMPPException
public Subscription subscribe(String jid) throws XMPPException
Subscription.State
should be checked
on return since more actions may be required by the caller.
Subscription.State.pending
- The owner must approve the subscription
request before messages will be received.
Subscription.State.unconfigured
- If the Subscription.isConfigRequired()
is true,
the caller must configure the subscription before messages will be received. If it is false
the caller can configure it but is not required to do so.
jid
- The jid to subscribe as.
XMPPException
public Subscription subscribe(String jid, SubscribeForm subForm) throws XMPPException
Subscription.State
should be checked
on return since more actions may be required by the caller.
Subscription.State.pending
- The owner must approve the subscription
request before messages will be received.
Subscription.State.unconfigured
- If the Subscription.isConfigRequired()
is true,
the caller must configure the subscription before messages will be received. If it is false
the caller can configure it but is not required to do so.
jid
- The jid to subscribe as.
XMPPException
public void unsubscribe(String jid) throws XMPPException
unsubscribe(String, String)
.
jid
- The JID used to subscribe to the node
XMPPException
public void unsubscribe(String jid, String subscriptionId) throws XMPPException
jid
- The JID used to subscribe to the nodesubscriptionId
- The id of the subscription being removed
XMPPException
public SubscribeForm getSubscriptionOptions(String jid) throws XMPPException
sendConfigurationForm(Form)
.
XMPPException
public SubscribeForm getSubscriptionOptions(String jid, String subscriptionId) throws XMPPException
jid
- JID the subscription is registered undersubscriptionId
- The subscription id
XMPPException
public void addItemEventListener(ItemEventListener listener)
listener
- The handler for the eventpublic void removeItemEventListener(ItemEventListener listener)
listener
- The handler to unregisterpublic void addConfigurationListener(NodeConfigListener listener)
listener
- The handler for the eventpublic void removeConfigurationListener(NodeConfigListener listener)
listener
- The handler to unregisterpublic void addItemDeleteListener(ItemDeleteListener listener)
listener
- The handler for the eventpublic void removeItemDeleteListener(ItemDeleteListener listener)
listener
- The handler to unregisterpublic String toString()
toString
in class Object
protected PubSub createPubsubPacket(IQ.Type type, PacketExtension ext)
protected PubSub createPubsubPacket(IQ.Type type, PacketExtension ext, PubSubNamespace ns)
protected Packet sendPubsubPacket(IQ.Type type, NodeExtension ext) throws XMPPException
XMPPException
protected Packet sendPubsubPacket(IQ.Type type, NodeExtension ext, PubSubNamespace ns) throws XMPPException
XMPPException
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |