bool QueueSettings::handle()

in src/qpid/broker/QueueSettings.cpp [115:248]


bool QueueSettings::handle(const std::string& key, const qpid::types::Variant& value)
{
    if (key == MAX_COUNT) {
        maxDepth.setCount(value);
        return true;
    } else if (key == MAX_SIZE) {
        maxDepth.setSize(value);
        return true;
    } else if (key == POLICY_TYPE) {
        if (value.getString() == POLICY_TYPE_RING) {
            dropMessagesAtLimit = true;
            return true;
        } else if (value.getString() == POLICY_TYPE_SELF_DESTRUCT) {
            selfDestructAtLimit = true;
            return true;
        } else if (value.getString() == POLICY_TYPE_REJECT) {
            //do nothing, thats the default
            return true;
        } else {
            QPID_LOG(warning, "Unrecognised policy option: " << value);
            return false;
        }
    } else if (key == NO_LOCAL) {
        noLocal = value;
        return true;
    } else if (key == BROWSE_ONLY) {
        isBrowseOnly = value;
        return true;
    } else if (key == TRACE_ID) {
        traceId = value.asString();
        return true;
    } else if (key == TRACE_EXCLUDES) {
        traceExcludes = value.asString();
        return true;
    } else if (key == PRIORITIES) {
        priorities = value;
        return true;
    } else if (key == FAIRSHARE) {
        defaultFairshare = value;
        return true;
    } else if (isFairshareSetting(key, value, *this)) {
        return true;
    } else if (key == MessageGroupManager::qpidMessageGroupKey) {
        groupKey = value.asString();
        return true;
    } else if (key == MessageGroupManager::qpidSharedGroup) {
        shareGroups = value;
        return true;
    } else if (key == MessageGroupManager::qpidMessageGroupTimestamp) {
        addTimestamp = value;
        return true;
    } else if (key == LVQ_KEY) {
        lvqKey = value.asString();
        return true;
    } else if (key == LVQ_LEGACY) {
        if (lvqKey.empty()) lvqKey = LVQ_LEGACY_KEY;
        return true;
    } else if (key == LVQ_LEGACY_NOBROWSE) {
        QPID_LOG(warning, "Ignoring 'no-browse' directive for LVQ; it is no longer necessary");
        if (lvqKey.empty()) lvqKey = LVQ_LEGACY_KEY;
        return true;
    } else if (key == AUTO_DELETE_TIMEOUT) {
        autoDeleteDelay = value;
        if (autoDeleteDelay) autodelete = true;
        return true;
    } else if (key == QueueFlowLimit::flowStopCountKey) {
        flowStop.setCount(value);
        return true;
    } else if (key == QueueFlowLimit::flowResumeCountKey) {
        flowResume.setCount(value);
        return true;
    } else if (key == QueueFlowLimit::flowStopSizeKey) {
        flowStop.setSize(value);
        return true;
    } else if (key == QueueFlowLimit::flowResumeSizeKey) {
        flowResume.setSize(value);
        return true;
    } else if (key == ALERT_REPEAT_GAP) {
        alertRepeatInterval = value;
        return true;
    } else if ((key == ALERT_COUNT) || (key == ALERT_COUNT_UP)) {
        alertThreshold.setCount(value);
        return true;
    } else if ((key == ALERT_SIZE) || (key == ALERT_SIZE_UP)) {
        alertThreshold.setSize(value);
        return true;
    } else if (key == ALERT_COUNT_DOWN) {
        alertThresholdDown.setCount(value);
        return true;
    } else if (key == ALERT_SIZE_DOWN) {
        alertThresholdDown.setSize(value);
        return true;
    } else if (key == MAX_FILE_COUNT && value.asUint64() > 0) {
        maxFileCount = value.asUint64();
        return false; // 'handle' here and also pass to store
    } else if (key == MAX_FILE_SIZE && value.asUint64() > 0) {
        maxFileSize = value.asUint64();
        return false; // 'handle' here and also pass to store
    } else if (key == PAGING) {
        paging = value;
        return true;
    } else if (key == MAX_PAGES) {
        maxPages = value;
        return true;
    } else if (key == PAGE_FACTOR) {
        pageFactor = value;
        return true;
    } else if (key == SEQUENCING) {
        sequenceKey = value.getString();
        sequencing = !sequenceKey.empty();
        return true;
    } else if (key == FILTER) {
        filter = value.asString();
        return true;
    } else if (key == LIFETIME_POLICY) {
        if (value.asString() == DELETE_IF_UNUSED_KEY) {
            lifetime = DELETE_IF_UNUSED;
            autodelete = true;
        } else if (value.asString() == DELETE_IF_UNUSED_AND_EMPTY_KEY) {
            lifetime = DELETE_IF_UNUSED_AND_EMPTY;
            autodelete = true;
        } else if (value.asString() == MANUAL) {
            autodelete = false;
        } else if (value.asString() == DELETE_ON_CLOSE_KEY) {
            lifetime = DELETE_ON_CLOSE;
            autodelete = true;
        } else {
            QPID_LOG(warning, "Invalid value for " << LIFETIME_POLICY << ": " << value);
        }
        return true;
    } else {
        return false;
    }
}