diff options
author | Ted Ross <tross@apache.org> | 2008-10-24 00:45:11 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2008-10-24 00:45:11 +0000 |
commit | 55c976dbede7ada5dbcc581945f7d5b1a038344c (patch) | |
tree | ade284127ba75103b85d5b431bed78c500896af8 /cpp/src/qpid/broker/Link.cpp | |
parent | bd0c16218e3ccc75ce997ba9f0806c27e6468085 (diff) | |
download | qpid-python-55c976dbede7ada5dbcc581945f7d5b1a038344c.tar.gz |
QPID-1348 - Dynamic binding for federation. Parameterized exchange names for CPP examples
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@707515 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Link.cpp')
-rw-r--r-- | cpp/src/qpid/broker/Link.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/Link.cpp b/cpp/src/qpid/broker/Link.cpp index 7a06d7e0b9..a814c12eed 100644 --- a/cpp/src/qpid/broker/Link.cpp +++ b/cpp/src/qpid/broker/Link.cpp @@ -336,7 +336,7 @@ ManagementObject* Link::GetManagementObject (void) const return (ManagementObject*) mgmtObject; } -Manageable::status_t Link::ManagementMethod (uint32_t op, management::Args& args, string&) +Manageable::status_t Link::ManagementMethod (uint32_t op, management::Args& args, string& text) { switch (op) { @@ -350,8 +350,22 @@ Manageable::status_t Link::ManagementMethod (uint32_t op, management::Args& args _qmf::ArgsLinkBridge& iargs = (_qmf::ArgsLinkBridge&) args; // Durable bridges are only valid on durable links - if (iargs.i_durable && !durable) - return Manageable::STATUS_INVALID_PARAMETER; + if (iargs.i_durable && !durable) { + text = "Can't create a durable route on a non-durable link"; + return Manageable::STATUS_USER; + } + + if (iargs.i_dynamic) { + Exchange::shared_ptr exchange = getBroker()->getExchanges().get(iargs.i_src); + if (exchange.get() == 0) { + text = "Exchange not found"; + return Manageable::STATUS_USER; + } + if (!exchange->supportsDynamicBinding()) { + text = "Exchange type does not support dynamic routing"; + return Manageable::STATUS_USER; + } + } std::pair<Bridge::shared_ptr, bool> result = links->declare (host, port, iargs.i_durable, iargs.i_src, |