P2p chat

Hi, I want to know if it is possible to use openfire + smack to create the following system.

  • Users can freely connect to the p2p chat, no need to use a password

  • If some users disconnects, the others will continue to chat to each other

  • There cannot be a central server

  • The 2nd user connects to the 1st user who initiated the chat room, the following users connects to whatever users are already connected

  • Users can see and talk (public or privately) to each other, similar to a IRC server

  • If the 1s user disconnects, the other users are not affected, the continue talking to each other

I named it a p2p (peer to peer), as there cannot be a central server. The people who need to use this p2p chat are connected into the same network (corporate network)

I understand that openfire was designed to be a daemon and connect to the database (to persist data), but I thought to customize the openfire program to act like this:

  • 1st user starts the chat application (and starts the server in the background, into the same jvm instance)

  • 2st user starts the chat application (and starts the server in the background, into the same jvm instance)

  • 2nd user connects to the 1st user by the hostname/port combination, no password needed

  • Each user who connects to an already connected user, receives

---- List of users already connected

---- List of servers, sorted by initiation time

  • If a user (client) disconnects from the server AND it is the server who everybody is connected, it announces to the next available server (connected user) to be the primary server, then every client continues to talk to each other.

So, I ask, is it possible to make openfire + other products, work as described above ?

Thanks

Claudio