OF-1707: Should not send disco#info to already available components.
Openfire allows more than one instance of a component to operate behind a JID. This is mainly used for load-distribution.
When a new Component connects, a service discovery request is sent to it. Its response is used to trigger event listeners.
If the subdomain of the component is already active (if another than the first component connects for a domain), then doing service discovery is not needed. The response triggers unwanted events in registered ComponentEventListener instances.
OF-1729: Clean up user-specific cache entries upon user deletion.
When a user is deleted, cached data for that user should be deleted. This was generally already the case, but some issues were found with regards to "offline presence", "last activity" and "entity capabilities" which is fixed in this commit.
Additionally, the EntityCapabilitiesManager has been turned into a proper Module (which allows for teardown, needed to properly deregister as a user event listener).
OF-1700: Cluster teardown should be reflected in RoutingTableImpl's serversCache state.
This fixes an issue that is similar to the one described in OF-1700. When a cluster node leaves the cluster, the state as managed in org.jivesoftware.openfire.spi.RoutingTableImpl should be updated to reflect this.
Unlike classes that got similar changes in other commits, RoutingTableImpl already cleaned up state when one node left the cluster (but not when
the local node left the cluster). This commit replaces that code with the more concise constructs now used in other places.
As far as I can tell, there have not been reports of issues related to the invalid state of RoutingTable (unlike OF-1700, that caused External Components to remain visible while they were not). Nevertheless, maintaining proper state should help prevent issues.
OF-1700: When stopping the manager, cleanly shut down its components.
When a manager of components is stopped, its managed components should also be gracefully stopped.
My assumption is that this didn't occur, as ordinarily, stopping a manager indicates a shutdown of Openfire, in which all components are stopped anyways.
In a clustered setup, it is desirable to have components shut down gracefully. An important effect of this is that other cluster nodes are notified of the shutdown.