public class PEPManager extends Object
PEPManager pepManager = new PEPManager(smackConnection); pepManager.addPEPListener(new PEPListener() { public void eventReceived(String inFrom, PEPEvent inEvent) { LOGGER.debug("Event received: " + inEvent); } }); PEPProvider pepProvider = new PEPProvider(); pepProvider.registerPEPParserExtension("http://jabber.org/protocol/tune", new TuneProvider()); ProviderManager.getInstance().addExtensionProvider("event", "http://jabber.org/protocol/pubsub#event", pepProvider); Tune tune = new Tune("jeff", "1", "CD", "My Title", "My Track"); pepManager.publish(tune);
Constructor and Description |
---|
PEPManager(XMPPConnection connection)
Creates a new PEP exchange manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addPEPListener(PEPListener pepListener)
Adds a listener to PEPs.
|
void |
destroy() |
protected void |
finalize() |
void |
publish(PEPItem item)
Publish an event.
|
void |
removePEPListener(PEPListener pepListener)
Removes a listener from PEP events.
|
public PEPManager(XMPPConnection connection)
connection
- a XMPPConnection which is used to send and receive messages.public void addPEPListener(PEPListener pepListener)
pepListener
- a roster exchange listener.public void removePEPListener(PEPListener pepListener)
pepListener
- a roster exchange listener.public void publish(PEPItem item) throws SmackException.NotConnectedException
item
- the item to publish.SmackException.NotConnectedException
public void destroy()