diff options
| author | Gordon Sim <gsim@apache.org> | 2007-01-19 09:37:56 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2007-01-19 09:37:56 +0000 |
| commit | 380e5b0d75fa8b4a663e39cfed69f81a10ec5980 (patch) | |
| tree | 6dde5076bc62dd3f611ff1c1aed0b41a556cbd59 /cpp/lib/broker/BrokerAdapter.cpp | |
| parent | e4410bd1c78aca7e05894e8822306b152ee70f78 (diff) | |
| download | qpid-python-380e5b0d75fa8b4a663e39cfed69f81a10ec5980.tar.gz | |
* tests/FramingTest.cpp - added test for validation of content data type
* lib/broker/BrokerAdapter.cpp - initial unbind implementation
* lib/common/framing/FramingContent.cpp - minor code cleanup
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@497755 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/broker/BrokerAdapter.cpp')
| -rw-r--r-- | cpp/lib/broker/BrokerAdapter.cpp | 57 |
1 files changed, 22 insertions, 35 deletions
diff --git a/cpp/lib/broker/BrokerAdapter.cpp b/cpp/lib/broker/BrokerAdapter.cpp index 41a66b6727..0d34868710 100644 --- a/cpp/lib/broker/BrokerAdapter.cpp +++ b/cpp/lib/broker/BrokerAdapter.cpp @@ -115,10 +115,6 @@ class BrokerAdapter::ServerOps : public AMQP_ServerOperations const qpid::framing::FieldTable& arguments); void delete_(const MethodContext& context, u_int16_t ticket, const std::string& exchange, bool ifUnused, bool nowait); - void unbind(const MethodContext& context, - u_int16_t ticket, const std::string& queue, - const std::string& exchange, const std::string& routingKey, - const qpid::framing::FieldTable& arguments ); }; class QueueHandlerImpl : private CoreRefs, public QueueHandler{ @@ -265,20 +261,6 @@ void BrokerAdapter::ServerOps::ExchangeHandlerImpl::declare(const MethodContext& connection.client->getExchange().declareOk(channel.getId()); } } - - -void BrokerAdapter::ServerOps::ExchangeHandlerImpl::unbind( - const MethodContext&, - u_int16_t /*ticket*/, - const string& /*queue*/, - const string& /*exchange*/, - const string& /*routingKey*/, - const qpid::framing::FieldTable& /*arguments*/ ) -{ - assert(0); // FIXME aconway 2007-01-04: 0-9 feature -} - - void BrokerAdapter::ServerOps::ExchangeHandlerImpl::delete_(const MethodContext&, u_int16_t /*ticket*/, const string& exchange, bool /*ifUnused*/, bool nowait){ @@ -330,9 +312,6 @@ void BrokerAdapter::ServerOps::QueueHandlerImpl::bind(const MethodContext&, u_in Queue::shared_ptr queue = connection.getQueue(queueName, channel.getId()); Exchange::shared_ptr exchange = broker.getExchanges().get(exchangeName); if(exchange){ - // kpvdr - cannot use this any longer as routingKey is now const - // if(routingKey.empty() && queueName.empty()) routingKey = queue->getName(); - // exchange->bind(queue, routingKey, &arguments); string exchangeRoutingKey = routingKey.empty() && queueName.empty() ? queue->getName() : routingKey; exchange->bind(queue, exchangeRoutingKey, &arguments); if(!nowait) connection.client->getQueue().bindOk(channel.getId()); @@ -340,7 +319,27 @@ void BrokerAdapter::ServerOps::QueueHandlerImpl::bind(const MethodContext&, u_in throw ChannelException( 404, "Bind failed. No such exchange: " + exchangeName); } -} +} + +void +BrokerAdapter::ServerOps::QueueHandlerImpl::unbind( + const MethodContext&, + u_int16_t /*ticket*/, + const string& queueName, + const string& exchangeName, + const string& routingKey, + const qpid::framing::FieldTable& arguments ) +{ + Queue::shared_ptr queue = connection.getQueue(queueName, channel.getId()); + if (!queue.get()) throw ChannelException(404, "Unbind failed. No such exchange: " + exchangeName); + + Exchange::shared_ptr exchange = broker.getExchanges().get(exchangeName); + if (!exchange.get()) throw ChannelException(404, "Unbind failed. No such exchange: " + exchangeName); + + exchange->unbind(queue, routingKey, &arguments); + + connection.client->getQueue().unbindOk(channel.getId()); +} void BrokerAdapter::ServerOps::QueueHandlerImpl::purge(const MethodContext&, u_int16_t /*ticket*/, const string& queueName, bool nowait){ @@ -471,21 +470,9 @@ void BrokerAdapter::ServerOps::TxHandlerImpl::rollback(const MethodContext&){ } void -BrokerAdapter::ServerOps::QueueHandlerImpl::unbind( - const MethodContext&, - u_int16_t /*ticket*/, - const string& /*queue*/, - const string& /*exchange*/, - const string& /*routingKey*/, - const qpid::framing::FieldTable& /*arguments*/ ) -{ - assert(0); // FIXME aconway 2007-01-04: 0-9 feature -} - -void BrokerAdapter::ServerOps::ChannelHandlerImpl::ok( const MethodContext& ) { - assert(0); // FIXME aconway 2007-01-04: 0-9 feature + //no specific action required, generic response handling should be sufficient } void |
