powered by Jive Software

Ideas for Extensions

There are many interesting possible extensions to Smack that wouldn’‘t really fit in the core, but would be perfect as add-ons. I thought I’'d list a few of my ideas, and ideas from anyone else are welcome.

  • XPath Packet Filter. Have a packet filter where the filtering criteria is an xpath expression. The easy way to implement this would be to call toXML() on the packet, create a new Dom4J document using the text, then use Dom4J’'s XPath support.

  • XML-RPC support. XML RPC provides a mechanism to do remote procedure calls through XML. A JEP (Jabber Enhancement Proposal) exists to add XML-RPC payloads in Jabber IQ packets. It should be relatively simple to use the Apache XML-RPC library (http://xml.apache.org/xmlrpc) to support this JEP. In fact, code from the book “Programming Jabber” should be largely applicable.

Regards,

Matt

Has there been any thought given for adding database support for registration, authentication, etc? I know its a bit tricky to have to support various databases but for enterprise type installations storing data into tables is a must.

Has there been any thought given for adding database

support for registration, authentication, etc? I know

its a bit tricky to have to support various databases

but for enterprise type installations storing data

into tables is a must.

Do you mean adding classes to help with pulling the username and password from a database? How would you envision this working? Maybe just an example program that did this being distributed with Smack would suffice?

Regards,

Matt

Do you mean adding classes to help with pulling the

username and password from a database?

Actually, I was thinking beyond just username and password and at something more like what Jabber Inc. provides with their Jabber Oracle Extension which handles the following:

  • Registration

  • Authentication

  • Roster

  • vCard

  • Offline

  • Last

So basically provide the ability to store as little as possible in flat/xml files.

How would you envision this working?

With this being an extension it would be optional during an installation/setup of a Smack based Jabber server and may not be needed if the server was only going to used by a small number of people or in situations where a database isn’'t available.

Maybe just an example program that did this being

distributed with Smack would suffice?

I really like example programs and including one with the Smack distribution would be a good idea, or alternatively including a set of JUnit tests would work just as well.

It might be possible to do implement this extension in such a way as to fulfil JEP-0043: Jabber Database Access http://www.jabber.org/jeps/jep-0043.html

Ryan,

Hmm, I think you may be confused a bit – Smack is not a Jabber server, but a library for Jabber clients. There’‘s no need to store that kind of data since it’‘s the server’‘s job. Am I misunderstanding what you’'re asking about?

Regards,

Matt

Matt,

You’‘re right, I am a bit confused. For so long I’'ve been focused on dealing with the server side of Jabber I keep forgetting that Smack is for the client.

My apologies,

Ryan

Ryan,

> You’‘re right, I am a bit confused. For so long I’'ve

> been focused on dealing with the server side of

> Jabber I keep forgetting that Smack is for the

> client.

Heh, no problem. There will be a server announcement from Jive Software in the coming weeks, but that’'s totally separate from Smack.

Regards,

Matt

Another idea:

Implement a JMS client using Smack. Basically, it would just need to translate the JMS API to Smack calls. All of the JMS message types should be relatively easy to support using Smack extended properties.

Another idea:

how about using Jabber error codes in XMPPException?

for example:

in XMPPConnection.login() in case of unregistered user XMPPException will be thrown and will contain message like “Authentication failed – 401: Unauthorized”. But there may be and something other (Error 500 for example)

in this case when need to know, what really happens, i have to parse exception message (and convers from String to int if there are eroor code).

i’'ve see there two ways:

  1. Extend XMPPException (add field ErrorCode)

  2. Add to Smack new Exception for use only when jabber server returns error message

Roman,

Thanks for the idea. I added an issue (smack-ll[/issue]) so this will be fixed for the next beta.

Regards,

Matt