public abstract class Node extends Object
| Modifier and Type | Class and Description |
|---|---|
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.
|
| Modifier and Type | Field and Description |
|---|---|
protected Connection |
con |
protected ConcurrentHashMap<NodeConfigListener,PacketListener> |
configEventToListenerMap |
protected String |
id |
protected ConcurrentHashMap<ItemDeleteListener,PacketListener> |
itemDeleteToListenerMap |
protected ConcurrentHashMap<ItemEventListener,PacketListener> |
itemEventToListenerMap |
protected String |
to |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected Connection con
protected String id
protected String to
protected ConcurrentHashMap<ItemEventListener,PacketListener> itemEventToListenerMap
protected ConcurrentHashMap<ItemDeleteListener,PacketListener> itemDeleteToListenerMap
protected ConcurrentHashMap<NodeConfigListener,PacketListener> configEventToListenerMap
public String getId()
public ConfigureForm getNodeConfiguration() throws XMPPException
sendConfigurationForm(Form).XMPPExceptionpublic void sendConfigurationForm(Form submitForm) throws XMPPException
FormsubmitForm - XMPPExceptionpublic DiscoverInfo discoverInfo() throws XMPPException
DiscoverInfo format.XMPPExceptionpublic List<Subscription> getSubscriptions() throws XMPPException
SubscriptionXMPPExceptionpublic 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.XMPPExceptionpublic 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.XMPPExceptionpublic void unsubscribe(String jid) throws XMPPException
unsubscribe(String, String).jid - The JID used to subscribe to the nodeXMPPExceptionpublic void unsubscribe(String jid, String subscriptionId) throws XMPPException
jid - The JID used to subscribe to the nodesubscriptionId - The id of the subscription being removedXMPPExceptionpublic SubscribeForm getSubscriptionOptions(String jid) throws XMPPException
sendConfigurationForm(Form).XMPPExceptionpublic SubscribeForm getSubscriptionOptions(String jid, String subscriptionId) throws XMPPException
jid - JID the subscription is registered undersubscriptionId - The subscription idXMPPExceptionpublic 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 unregisterprotected 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
XMPPExceptionprotected Packet sendPubsubPacket(IQ.Type type, NodeExtension ext, PubSubNamespace ns) throws XMPPException
XMPPExceptionCopyright © 2003-2007 Jive Software.