powered by Jive Software

Openfire plugin simulating client

hey guys,

i want to develop a OF pugin that can receive messages. i thought about simulating a client using a client library (like smack) and connect it to the server. is this the correct way or is there an easier way to do this?

thanx

You can create your own virtual XMPP connection by extending the VirtualConnection class to recieve/send the XMPP packets from your custom source and destination. See the Websocket plugin for more details

Could you please be a little bit more specific or give a small example? I’ve looked at the Websocket plugin and I don’t see how to do this…

Thanx

That is the simplest example I know, Put some effort into understanding the code and you will not regret it. Otherwise just use Smack as originally planned.

The alternative is to look at Openfire Meetings. It has an implementation of the Smack XMPPConnection class that uses the same Openfire VirtualConnection class to pass xmpp messages internally instead of externally over port 5222.

Thats how I use Smack server side.

If you want your plugin to be an addressable entity, you can implement the Component interface.

Pretty easy. I’ve tried it and it seems to work fine.

Thanx :wink:

1 Like

Implementing the Component interface seems a lot easier to me