public void registerActivity(@Nonnull final JID userJid)
    {
        // Only tracking it for the local cluster node, as those are the only users for which this node will monitor activity anyway
        mutex.writeLock().lock();
        try {
            if (XMPPServer.getInstance().isLocal(userJid)) {
                final Map<JID, Set<Occupant>> localOccupants = localOccupantsByNode.get((XMPPServer.getInstance().getNodeID()));
                if (localOccupants != null) {
                    final Set<Occupant> localOccupantsForUser = localOccupants.get(userJid);
                    if (localOccupantsForUser != null) {
                        localOccupantsForUser.forEach(occupant -> occupant.setLastActive(Instant.now()));
                    }
                }
            } else {
                final Set<Occupant> federatedOccupantsForUser = federatedOccupants.get(userJid);
                if (federatedOccupantsForUser != null) {
                    federatedOccupantsForUser.forEach(occupant -> occupant.setLastActive(Instant.now()));
                }
            }
        } finally {
            mutex.writeLock().unlock();
        }
    }
Registers activity for a particular user that is assumed to be connected to the local cluster node. This records
a timestamp, that can be used to detect idle-ness.

@param userJid The address of the user for which to record activity.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/OccupantManager.java