summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorKenneth Anthony Giusti <kgiusti@apache.org>2010-07-02 14:46:30 +0000
committerKenneth Anthony Giusti <kgiusti@apache.org>2010-07-02 14:46:30 +0000
commitd160ed03991cba45336a6a31818fdbfc831dca73 (patch)
tree7cc5a72bbb08526732ec1e8e75c29f8cd22fbbf3 /cpp
parent625d038df59892bfa08b92bc7ca3b099c2334845 (diff)
downloadqpid-python-d160ed03991cba45336a6a31818fdbfc831dca73.tar.gz
QPID-2716: QMF bugfix - set agent name in object id
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@960012 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/qpid/agent/ManagementAgent.h1
-rw-r--r--cpp/src/qpid/agent/ManagementAgentImpl.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/cpp/include/qpid/agent/ManagementAgent.h b/cpp/include/qpid/agent/ManagementAgent.h
index d534416da2..aa0a974c35 100644
--- a/cpp/include/qpid/agent/ManagementAgent.h
+++ b/cpp/include/qpid/agent/ManagementAgent.h
@@ -69,6 +69,7 @@ class ManagementAgent
// product - Product name (i.e. "qpid")
// instance - A unique identifier for this instance of the agent.
// If empty, the agent will create a GUID for the instance.
+ // Note: the ":" character is reserved - do no use it in the vendor or product name.
//
virtual void setName(const std::string& vendor,
const std::string& product,
diff --git a/cpp/src/qpid/agent/ManagementAgentImpl.cpp b/cpp/src/qpid/agent/ManagementAgentImpl.cpp
index e2a595cd85..bc841ca3ee 100644
--- a/cpp/src/qpid/agent/ManagementAgentImpl.cpp
+++ b/cpp/src/qpid/agent/ManagementAgentImpl.cpp
@@ -125,6 +125,12 @@ ManagementAgentImpl::~ManagementAgentImpl()
void ManagementAgentImpl::setName(const string& vendor, const string& product, const string& instance)
{
+ if (vendor.find(':') != vendor.npos) {
+ throw Exception("vendor string cannot contain a ':' character.");
+ }
+ if (product.find(':') != product.npos) {
+ throw Exception("product string cannot contain a ':' character.");
+ }
attrMap["_vendor"] = vendor;
attrMap["_product"] = product;
string inst;
@@ -249,6 +255,7 @@ ObjectId ManagementAgentImpl::addObject(ManagementObject* object,
objectId.setV2Key(*object); // let object generate the key
else
objectId.setV2Key(key);
+ objectId.setAgentName(name_address);
object->setObjectId(objectId);
newManagementObjects[objectId] = object;