private void checkJoinRoomPreconditionRestrictedToNickname(@Nonnull final JID realAddress, @Nonnull final String nickname ) throws NotAcceptableException
    {
        boolean canJoin = true;
        String reservedNickname = null;
        final JID bareJID = realAddress.asBareJID();
        if (isLoginRestrictedToNickname()) {
            reservedNickname = members.get(bareJID);
            if (reservedNickname != null && !nickname.toLowerCase().equals(reservedNickname)) {
                canJoin = false;
            }
        }

        Log.trace( "{} Room join precondition 'restricted to nickname': User '{}' {} join room {}. Reserved nickname: '{}'.", canJoin ? "PASS" : "FAIL", realAddress, canJoin ? "can" : "cannot", this.getJID(), reservedNickname );
        if (!canJoin) {
            throw new NotAcceptableException( "This room is configured to restrict joins to reserved nicknames. The nickname that you supplied was not the nickname that you reserved for this room, which is: " + reservedNickname );
        }
    }
Checks, when joins are restricted to reserved nicknames, if the nickname that the user attempts to use is the
nickname that has been reserved by that room.

@param realAddress The address of the user that attempts to join.
@param nickname The nickname that the user is attempting to use
@throws NotAcceptableException when joining is prevented by virtue of using an incorrect nickname.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/MUCRoom.java