I’'m trying to write a Java application that can process incoming and send outgoing
XMPP messages with custom extensions. The extensions look something like this:
I assumed that PacketExtension was the correct way of dealing with this, so I wrote
a class that looks something like this:
public class CustomExtension implements PacketExtension
private String val;
public void SetVal(String newVal)
public String getNamespace()
public String getElementName()
public String toXML()
Now to send it I use the following code:
XMPPConnection connection = new XMPPConnection(“my.own.server”);
Message testPack=new Message();
CustomExtension q=new CustomExtension();
This works, which I can verify with a normal Jabber that allows viewing/editing of XML
messages (like PSI for example).
Now I want to be able to receive these messages in my application aswell.
That is, I want my application to get the message, and be able to somehow parse the
custom XML code to get my values.
As far as I understand it, I should be using a PacketExtensionProvider and
ProviderManager somehow, but I’'m not quite getting how.
Any example code/tutorial would be helpful.