void QueueSettings::validate()

in src/qpid/broker/QueueSettings.cpp [250:295]


void QueueSettings::validate() const
{
    if (lvqKey.size() && priorities > 0)
        throw qpid::framing::InvalidArgumentException(QPID_MSG("Cannot specify " << LVQ_KEY << " and " << PRIORITIES << " for the same queue"));
    if ((fairshare.size() || defaultFairshare) && priorities == 0)
        throw qpid::framing::InvalidArgumentException(QPID_MSG("Cannot specify fairshare settings when queue is not enabled for priorities"));
    if (fairshare.size() > priorities)
        throw qpid::framing::InvalidArgumentException(QPID_MSG("Cannot have fairshare set for priority levels greater than " << priorities));
    if (groupKey.size() && lvqKey.size())
        throw qpid::framing::InvalidArgumentException(QPID_MSG("Cannot specify " << LVQ_KEY << " and " << MessageGroupManager::qpidMessageGroupKey << " for the same queue"));
    if (groupKey.size() && priorities)
        throw qpid::framing::InvalidArgumentException(QPID_MSG("Cannot specify " << PRIORITIES << " and " << MessageGroupManager::qpidMessageGroupKey << " for the same queue"));
    if (shareGroups && groupKey.empty()) {
        throw qpid::framing::InvalidArgumentException(QPID_MSG("Can only specify " << MessageGroupManager::qpidSharedGroup
                                                               << " if " << MessageGroupManager::qpidMessageGroupKey << " is set"));
    }
    if (addTimestamp && groupKey.empty()) {
        throw qpid::framing::InvalidArgumentException(QPID_MSG("Can only specify " << MessageGroupManager::qpidMessageGroupTimestamp
                                                               << " if " << MessageGroupManager::qpidMessageGroupKey << " is set"));
    }

    // @todo: remove once "sticky" consumers are supported - see QPID-3347
    if (!shareGroups && groupKey.size()) {
        throw qpid::framing::InvalidArgumentException(QPID_MSG("Only shared groups are supported at present; " << MessageGroupManager::qpidSharedGroup
                                                               << " is required if " << MessageGroupManager::qpidMessageGroupKey << " is set"));
    }

    if (paging) {
        if(lvqKey.size()) {
            throw qpid::framing::InvalidArgumentException(QPID_MSG("Cannot specify " << LVQ_KEY << " and " << PAGING << " for the same queue"));
        }
        if(priorities) {
            throw qpid::framing::InvalidArgumentException(QPID_MSG("Cannot specify " << PRIORITIES << " and " << PAGING << " for the same queue"));
        }
        if(groupKey.size()) {
            throw qpid::framing::InvalidArgumentException(QPID_MSG("Cannot specify " << MessageGroupManager::qpidMessageGroupKey << " and " << PAGING << " for the same queue"));
        }
    } else {
        if (maxPages) {
            throw qpid::framing::InvalidArgumentException(QPID_MSG("Can only specify " << MAX_PAGES << " if " << PAGING << " is set"));
        }
        if (pageFactor) {
            throw qpid::framing::InvalidArgumentException(QPID_MSG("Can only specify " << PAGE_FACTOR << " if " << PAGING << " is set"));
        }
    }
}