Ensure that caches are updated every time a item from the cache is modified locally
The old/existing architecture requires each cluster node to maintain its own copy of the state of the entire MUC subsystem. We’re looking to replace this (see description of parent issue OF-2219) with usage of a shared data structure (a clustered cache).
Implementation-wise, this means that we’re swapping out some Java Map implementations with Cache implementations, and probably do some refactoring.
Instances that are in these structures occasionally get updated (eg: the presence information of an occupant of a room, represented by a MUCRole can change over time). This is not much of a problem in the old implementation, as the data in these data structures are accessed by reference: a change is immediately reflected in the data structure. That’s not the case with Cache ‘s though. There, every time an instance that’s stored in the cache is changed, it explicitly needs to be updated (or re-added) in the cache for that change to be recorded.