powered by Jive Software

Openfire management API

Hi,

Does openfire provide managment API so that external program can communicate/command the openfire server like create MUC chat room with specific parameters etc? If openfire can provide some JMX API, it will be much better. I am not sure whether it does have this feature or not.

Best Regards

Peter

Openfire is good. As a suggestion, i would suggest the developers should refer to what asterisk.org does.

Asterisk is a good open source project and very popular. The most important reason is that it defines very good API for external developers to manage/extend the functions by adding application logic.

regards

peter

Hi peter,

As you may have already known Openfire is an opensource project, and it provides devs with an excellent framework for extensions using plugins. Devs can use Openfire API to virtually access/control Openfire execution from within plugins. I find out that using plugins suits my requirements most of the time that I don’t need JMX API. Controlling MUC room creation is just one of the things that can already be done using plugins.

Alternatively, if you’re looking for some kind of control via XMPP, Openfire already supports XEP-0050: Ad-Hoc Commands and some of the things in XEP-0133: Service Administration.

thanks for your information.

Plugin is a good way to go. But normally, third party developers have their own framework. It is not easy to integrate openfire and their framework through plugins.

Anyway, i already got solution to solve my own problem - to add constrains on MUC creation.

In our case, only some specific users are allowed to create room. The logic of whether a user is allowed to create a room or not is runing in our own framework, which itself is a big system.

There are two ways to solve the problem.

First, as you said, add plugin for MUC creation, this plugin will check with our framework before create the MUC room.

Second, external system will check whether the user is allowed to create a room, and then it connect to the openfire and create a room, modify the owner, configure the room (like persistent room, max users etc) by XEP-0045 protocol.

I already tested that the second way, it works.

regards

peter

Because my target is to make sure only some specific users are allowed to create a room. By checking the code of MultiUserChatServerImpl.java, the best place is to put logic in (See | XXXXXXXXXXXXXXXXXXXXXXXX PUT MY LOGIC HERER below).

But i do not want to change the code this way. Any better way ?

public MUCRoom getChatRoom(String roomName, JID userjid) throws NotAllowedException {

// The room does not exist so check for creation permissions

// Room creation is always allowed for sysadmin

if (isRoomCreationRestricted() &&

!sysadmins.contains(userjid.toBareJID())) {

// The room creation is only allowed for certain JIDs

if (!allowedToCreate.contains(userjid.toBareJID()) || XXXXXXXXXXXXXXXXXXXXXXXX PUT MY LOGIC HERER) {

// The user is not in the list of allowed JIDs to create a room so raise

// an exception

throw new NotAllowedException();

}

Regards

peter

PacketInterceptor.interceptPacket() is called before the content of packets is known. That also means before any part of Openfire code knows that the destination is an MUC component. You might be worried of the overhead created by the method. However, as long as you keep the intercepting process short this could be acceptable. The Gateway plugin uses this method to do user verifications much like you intend to use it in your case. I haven’t seen any performance issue raised in that context when using Gateway plugin.