@Override
    public void writeExternal(ObjectOutput out) throws IOException
    {
        final ExternalizableUtil externalizableUtil = ExternalizableUtil.getInstance();
        externalizableUtil.writeSafeUTF(out, subdomain);
        externalizableUtil.writeLong(out, occupants.size());
        for (final OccupantManager.Occupant occupant : occupants) {
            externalizableUtil.writeSafeUTF(out, occupant.getRoomName());
            externalizableUtil.writeSafeUTF(out, occupant.getNickname());
            externalizableUtil.writeSerializable(out, occupant.getRealJID());
            // We should not send the lastActive field, as that's used only by the cluster node that the occupant is local to.
        }
        externalizableUtil.writeSerializable(out, originator);
    }
Task that is used by a cluster node to inform other cluster nodes of its local occupants. This is intended to be used
by a node that is joining a cluster (to send its local occupants to all other nodes), and by nodes in an existing
cluster that detect a new node joining (to send their local occupants to the joining node).

@author Guus der Kinderen
xmppserver/src/main/java/org/jivesoftware/openfire/muc/cluster/SyncLocalOccupantsAndSendJoinPresenceTask.java