@Nullable
    public Instant lastActivityOnLocalNode(@Nonnull final JID userJid)
    {
        mutex.readLock().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) {
                        return localOccupantsForUser.stream()
                            .map(Occupant::getLastActive)
                            .max(java.util.Comparator.naturalOrder())
                            .orElse(null);
                    }
                }
            } else {
                final Set<Occupant> federatedOccupantsForUser = federatedOccupants.get(userJid);
                if (federatedOccupantsForUser != null) {
                    return federatedOccupantsForUser.stream()
                        .map(Occupant::getLastActive)
                        .max(java.util.Comparator.naturalOrder())
                        .orElse(null);
                }
            }
            return null;
        } finally {
            mutex.readLock().unlock();
        }
    }
Returns the most recent activity for a particular user that is assumed to be connected to the local cluster node.
This returns a timestamp, that can be used to detect idle-ness.

@param userJid The address of the user for which to return a timestamp of last activity.
@return A timestamp, or null when there currently is no occupant by that JID on the local node.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/OccupantManager.java