@Override
    public boolean canDiscoverRoom(final MUCRoom room, final JID entity) {
        // Check if locked rooms may be discovered
        if (!allowToDiscoverLockedRooms && room.isLocked()) {
            return false;
        }
        if (!room.isPublicRoom()) {
            if (!allowToDiscoverMembersOnlyRooms && room.isMembersOnly()) {
                return false;
            }
            final Affiliation affiliation = room.getAffiliation(entity.asBareJID());
            return affiliation == Affiliation.owner
                || affiliation == Affiliation.admin
                || affiliation == Affiliation.member;
        }
        return true;
    }
Gets the MUC event delegate handler for this service.
@return Handler for MUC events (delegate)
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/MultiUserChatServiceImpl.java