I want to use Openfire’s storage mechanism to store an extra attribute per registered user. I want to do some custom processing in my plugin using the value of this attribute. Till now the best solution I have been able to come up with is to have my own data structures but that leads to more complexity.
Is there a built in mechanism in Openfire, e.g., an API in the User class, that allows me to insert arbitrary data (String, etc) using something like setProperty() method just like the existing setName(), setEMail() methods in the User class.
The class User has a method: private void insertProperty(String propName, String propValue) This method stores a key-value pair (which is perfect for me) in the class data member called properties which is of type Map<String,String>. However, this is a private function and I cannot insert my own property at will from somewhere else (e.g., my plugin).
The User class also has a method: public Map<String,String> getProperties() The documentation for this method says that it returns ‘the extended properties’. But how do u set these extended properties, I couldn’t find anywhere how to set an extended property although the documentation does talk of extended properties in addition to username, email, etc.
Any ideas how this can be done?