@Nonnull
    public Set<Occupant> getLocalOccupants() // Beware: confusing usage of the word 'local' here. Here, it means 'local to the cluster node' and not 'non-federated'.
    {
        mutex.readLock().lock();
        try {
            final Set<Occupant> local = localOccupantsByNode.getOrDefault(XMPPServer.getInstance().getNodeID(), Collections.emptyMap())
                .values().stream().flatMap(Collection::stream).collect(Collectors.toSet());
            final Set<Occupant> federated = federatedOccupants.values().stream().flatMap(Collection::stream).collect(Collectors.toSet());

            final Set<Occupant> result = new HashSet<>();
            result.addAll(local);
            result.addAll(federated);

            return result;
        } finally {
            mutex.readLock().unlock();
        }
    }
Returns data that is maintained for occupants of the local cluster node.

The returned occupants include occupants that are local to the XMPP domain as well as federated users.

@return all data maintained for the local cluster node.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/OccupantManager.java