Example #1
0
void AgentImpl::setAttribute(const std::string& k, const qpid::types::Variant& v)
{
    attributes[k] = v;
    if (k == "qmf.agent_capability")
        try {
            capability = v.asUint32();
        } catch (std::exception&) {}
    if (k == "_direct_subject")
        try {
            directSubject = v.asString();
            sender = session.topicSender;
        } catch (std::exception&) {}
}
Example #2
0
void DataBuilder::handle(const qpid::types::Variant& v)
{
    switch (nested.top()->getType()) {
      case qpid::types::VAR_MAP:
        nested.push(&nested.top()->asMap()[v.asString()]);
        break;
      case qpid::types::VAR_LIST:
        nested.top()->asList().push_back(v);
        break;
      default:
        *(nested.top()) = v;
        nested.pop();
        break;
    }
}
void ConnectionOptions::set(const std::string& name, const qpid::types::Variant& value)
{
    if (name == "reconnect") {
        reconnect = value;
    } else if (name == "reconnect-timeout" || name == "reconnect_timeout") {
        timeout = timeValue(value);
    } else if (name == "reconnect-limit" || name == "reconnect_limit") {
        limit = value;
    } else if (name == "reconnect-interval" || name == "reconnect_interval") {
        maxReconnectInterval = minReconnectInterval = timeValue(value);
    } else if (name == "reconnect-interval-min" || name == "reconnect_interval_min") {
        minReconnectInterval = timeValue(value);
    } else if (name == "reconnect-interval-max" || name == "reconnect_interval_max") {
        maxReconnectInterval = timeValue(value);
    } else if (name == "reconnect-urls-replace" || name == "reconnect_urls_replace") {
        replaceUrls = value.asBool();
    } else if (name == "reconnect-urls" || name == "reconnect_urls") {
        if (replaceUrls) urls.clear();
        if (value.getType() == qpid::types::VAR_LIST) {
            merge(value.asList(), urls);
        } else {
            merge(value.asString(), urls);
        }
    } else if (name == "username") {
        username = value.asString();
    } else if (name == "password") {
        password = value.asString();
    } else if (name == "sasl-mechanism" || name == "sasl_mechanism" ||
               name == "sasl-mechanisms" || name == "sasl_mechanisms") {
        mechanism = value.asString();
    } else if (name == "sasl-service" || name == "sasl_service") {
        service = value.asString();
    } else if (name == "sasl-min-ssf" || name == "sasl_min_ssf") {
        minSsf = value;
    } else if (name == "sasl-max-ssf" || name == "sasl_max_ssf") {
        maxSsf = value;
    } else if (name == "heartbeat") {
        heartbeat = value;
    } else if (name == "tcp-nodelay" || name == "tcp_nodelay") {
        tcpNoDelay = value;
    } else if (name == "locale") {
        locale = value.asString();
    } else if (name == "max-channels" || name == "max_channels") {
        maxChannels = value;
    } else if (name == "max-frame-size" || name == "max_frame_size") {
        maxFrameSize = value;
    } else if (name == "bounds") {
        bounds = value;
    } else if (name == "transport") {
        protocol = value.asString();
    } else if (name == "ssl-cert-name" || name == "ssl_cert_name") {
        sslCertName = value.asString();
    } else if (name == "ssl-ignore-hostname-verification-failure" || name == "ssl_ignore_hostname_verification_failure") {
        sslIgnoreHostnameVerificationFailure = value;
    } else if (name == "x-reconnect-on-limit-exceeded" || name == "x_reconnect_on_limit_exceeded") {
        reconnectOnLimitExceeded = value;
    } else if (name == "container-id" || name == "container_id") {
        identifier = value.asString();
    } else if (name == "nest-annotations" || name == "nest_annotations") {
        nestAnnotations = value;
    } else if (name == "set-to-on-send" || name == "set_to_on_send") {
        setToOnSend = value;
    } else if (name == "properties" || name == "client-properties" || name == "client_properties") {
        properties = value.asMap();
    } else {
        throw qpid::messaging::MessagingException(QPID_MSG("Invalid option: " << name << " not recognised"));
    }
}