diff options
author | Ted Ross <tross@apache.org> | 2011-01-06 23:04:34 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2011-01-06 23:04:34 +0000 |
commit | bda33c5b69189bf645ff818d8315bb8fc3288b7a (patch) | |
tree | ac85765f94b91423f9aafc728ebbdd7b9ea6a32d /cpp/src | |
parent | 4316e7c77f880b7d7a29e56a8ae9afe7c3f4974d (diff) | |
download | qpid-python-bda33c5b69189bf645ff818d8315bb8fc3288b7a.tar.gz |
Changes to QMFv2 formats to make the agents and consoles consistent:
1) Events in _data_indication messages are carried as lists of events (consistent with object data)
2) Built-in attributes for agents (in _heartbeaet_indication) all start with '_' to
differentiate them from user-defined attributes.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1056112 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/agent/ManagementAgentImpl.cpp | 14 | ||||
-rw-r--r-- | cpp/src/qpid/management/ManagementAgent.cpp | 18 |
2 files changed, 18 insertions, 14 deletions
diff --git a/cpp/src/qpid/agent/ManagementAgentImpl.cpp b/cpp/src/qpid/agent/ManagementAgentImpl.cpp index 0a1c07a232..35011db38e 100644 --- a/cpp/src/qpid/agent/ManagementAgentImpl.cpp +++ b/cpp/src/qpid/agent/ManagementAgentImpl.cpp @@ -339,8 +339,10 @@ void ManagementAgentImpl::raiseEvent(const ManagementEvent& event, severity_t se headers["qmf.content"] = "_event"; headers["qmf.agent"] = name_address; - MapCodec::encode(map_, content); - connThreadBody.sendBuffer(content, "", headers, topicExchange, key.str()); + Variant::List list; + list.push_back(map_); + ListCodec::encode(list, content); + connThreadBody.sendBuffer(content, "", headers, topicExchange, key.str(), "amqp/list"); } uint32_t ManagementAgentImpl::pollCallbacks(uint32_t callLimit) @@ -1165,10 +1167,10 @@ void ManagementAgentImpl::periodicProcessing() void ManagementAgentImpl::getHeartbeatContent(qpid::types::Variant::Map& map) { map["_values"] = attrMap; - map["_values"].asMap()["timestamp"] = uint64_t(Duration(EPOCH, now())); - map["_values"].asMap()["heartbeat_interval"] = interval; - map["_values"].asMap()["epoch"] = bootSequence; - map["_values"].asMap()["schema_timestamp"] = uint64_t(schemaTimestamp); + map["_values"].asMap()["_timestamp"] = uint64_t(Duration(EPOCH, now())); + map["_values"].asMap()["_heartbeat_interval"] = interval; + map["_values"].asMap()["_epoch"] = bootSequence; + map["_values"].asMap()["_schema_updated"] = uint64_t(schemaTimestamp); } void ManagementAgentImpl::ConnectionThread::run() diff --git a/cpp/src/qpid/management/ManagementAgent.cpp b/cpp/src/qpid/management/ManagementAgent.cpp index 4bacb95c7b..07751f57ef 100644 --- a/cpp/src/qpid/management/ManagementAgent.cpp +++ b/cpp/src/qpid/management/ManagementAgent.cpp @@ -404,8 +404,10 @@ void ManagementAgent::raiseEvent(const ManagementEvent& event, severity_t severi string content; - MapCodec::encode(map_, content); - sendBufferLH(content, "", headers, "amqp/map", v2Topic, key.str()); + Variant::List list_; + list_.push_back(map_); + ListCodec::encode(list_, content); + sendBufferLH(content, "", headers, "amqp/list", v2Topic, key.str()); QPID_LOG(trace, "SEND raiseEvent (v2) class=" << event.getPackageName() << "." << event.getEventName()); } @@ -1000,9 +1002,9 @@ void ManagementAgent::periodicProcessing (void) headers["qmf.agent"] = name_address; map["_values"] = attrMap; - map["_values"].asMap()["timestamp"] = uint64_t(sys::Duration(sys::EPOCH, sys::now())); - map["_values"].asMap()["heartbeat_interval"] = interval; - map["_values"].asMap()["epoch"] = bootSequence; + map["_values"].asMap()["_timestamp"] = uint64_t(sys::Duration(sys::EPOCH, sys::now())); + map["_values"].asMap()["_heartbeat_interval"] = interval; + map["_values"].asMap()["_epoch"] = bootSequence; string content; MapCodec::encode(map, content); @@ -2017,9 +2019,9 @@ void ManagementAgent::handleLocateRequestLH(const string&, const string& replyTo headers["qmf.agent"] = name_address; map["_values"] = attrMap; - map["_values"].asMap()["timestamp"] = uint64_t(sys::Duration(sys::EPOCH, sys::now())); - map["_values"].asMap()["heartbeat_interval"] = interval; - map["_values"].asMap()["epoch"] = bootSequence; + map["_values"].asMap()["_timestamp"] = uint64_t(sys::Duration(sys::EPOCH, sys::now())); + map["_values"].asMap()["_heartbeat_interval"] = interval; + map["_values"].asMap()["_epoch"] = bootSequence; string content; MapCodec::encode(map, content); |