summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
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;