powered by Jive Software

Why User is not an interface?

Hi there,

Wildfire allows to implement a custom UserProvider which is great for integration with complex systems. Looking at the code (which is quite clean and pretty ) I see that UserProvider interface methods deal with User class object. I think having User as an interface may give a flexibility of implementing custom User objects. For example, loading user properties at once from existing database tables would significantly help in integration with existing DB. More than this, user properties not always come from a database but can be loaded dynamically from an app server.

Perhaps I’‘m going in totally wrong direction but I didn’'t find any other way of integrating Wildfire and existing users without very complex replication of a user profile data to the Wildfire DB. Please correct me if I wrong.




there is also a JDBCUserProvider which may be used to query remote databases.

For LDAP there’'s a LdapVCardProvider available.

Are you looking for a JDBCVCardProvider?


Hi LG,

I saw JDBCUserProvider. It is limited to only username, name and email fields to be loaded from a custom database. If, for example, you have properties specific to your environment you have to insert it to jiveUserProp table in the WildFire database. This is normal approach for out of the box system setup. But if you want to expand functionality of the server to accommodate custom logic for User and Group objects you cannot do that without code modifications. But there is no need for this if the entire server objects will interact with an interface implementing all required methods and properties for abstract User object. And then would be possible to develop plugins that rely on your implementation of a User.

I don’'t think that JDBCVCardProvider would 100% address complex integration task problems because not all properties are always stored in a database.



I’‘ve amended current User related classes to work with User interface. It allowed me easily implement my own User object that implements this interface. I would be very happy to hear OpenFire developers on what they think on the subject. I’'d love to contribute this code if it can be valuable.