@Override
    public void nicknameChanged(@Nonnull final JID roomJID, @Nonnull final JID userJID, @Nonnull final String oldNickname, @Nonnull final String newNickname)
    {
        if (!isForThisService(roomJID)) {
            return;
        }

        Log.debug("Updated local occupancy in room '{}' of service '{}': entity '{}' now nickname '{}' (was: '{}')", roomJID.getNode(), serviceName, newNickname, oldNickname, userJID);
        final OccupantUpdatedTask task = new OccupantUpdatedTask(serviceName, roomJID.getNode(), oldNickname, newNickname, userJID, XMPPServer.getInstance().getNodeID());
        process(task); // On this cluster node.

        // On all other cluster nodes
        if (PROPERTY_USE_NONBLOCKING_CLUSTERTASKS.getValue()) {
            CacheFactory.doClusterTask(task);
        } else {
            CacheFactory.doSynchronousClusterTask(task, false);
        }
    }
When an XMPP entity / user that is an occupant of a room changes its nickname, this event handler will ensure that
the relevant data that is maintained in this instance of OccupantManager, as well as all instances for the same
server on every other cluster node, is updated.

@param roomJID the JID of the room where the occupant has joined.
@param userJID The 'real' JID (not room-at-service-slash-nickname) of the XMPP user that joined.
@param oldNickname nickname of the user in the room prior to the change.
@param newNickname nickname of the user in the room after the change.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/OccupantManager.java