Improve Repository API
Right now whole repository API uses classes which are declared in
tigase-server.jar and while in normal mode it is possible to use additional classes from separate jars in OSGi mode it is impossible.
We need to improve this API to make it possible to allow registration of additional classes and ability to detect correct default implementation if we have passed only URI. This is important as we want to introduce MongoDB support which should be kept as external jar to make it easier to improve and update separatly and not to introduce additional dependecies.
Moreover we need this autodetection as repositories other than UserRepository,AuthRepository,DataRepository are existing in current codebase and we need to make them replacable with MongoDB alternatives just by having URI, so it is important to have automatic selection of implementation of Repository based on supported URI.
Issue #2173 - Improved API for RepositoryFactory, created basic interface for all Repository implementations and implemented autodetection of default repository implementation based on supplied URI
#2 Updated by Andrzej Wójcik over 4 years ago
- Due date set to 2014-08-16
- Status changed from New to In QA
- Estimated time set to 6.00 h
Right now autodetection of repository based on supported URI is implemented by addition of annotation to every Repository implementation which will contain information about supported storage URIs. I also added basic interface for every implementation of Repository so we now have one common interface for every repository, I hope that we would change implementations of repositories for MUC, PubSub, MessageArchiving and other to implement this interface as well so we could use RepositoryFactory to do autoselection of repository implementation for them.
Right now autodection might be done for every class with implements Repository interface (all classes in Tigase XMPP Server jar are found on start of server due to analysis and use of reflection, but in OSGi mode they need to be registered in ModulesManagerImpl (similar to how components and plugins are already registered, ie. in PubSub project).