diff options
author | Gordon Sim <gsim@apache.org> | 2007-05-17 11:03:55 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-05-17 11:03:55 +0000 |
commit | 9a6c0d41b19744c8e4dc4711d13a5a0afa2f7ed2 (patch) | |
tree | 539a8102197fa119c7efb77056841932e2eb5c1a /cpp/src/qpid/broker/RecoveryManagerImpl.cpp | |
parent | decfd77364e211bc8f8784e15f54e06a79e16675 (diff) | |
download | qpid-python-9a6c0d41b19744c8e4dc4711d13a5a0afa2f7ed2.tar.gz |
Changes to support durable exchanges.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@538872 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/RecoveryManagerImpl.cpp')
-rw-r--r-- | cpp/src/qpid/broker/RecoveryManagerImpl.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/RecoveryManagerImpl.cpp b/cpp/src/qpid/broker/RecoveryManagerImpl.cpp index f82399f95c..355c8de926 100644 --- a/cpp/src/qpid/broker/RecoveryManagerImpl.cpp +++ b/cpp/src/qpid/broker/RecoveryManagerImpl.cpp @@ -61,9 +61,19 @@ public: void recover(RecoverableMessage::shared_ptr msg); }; -void RecoveryManagerImpl::recoverExchange(framing::Buffer&) +class RecoverableExchangeImpl : public RecoverableExchange { - //TODO + Exchange::shared_ptr exchange; + QueueRegistry& queues; +public: + RecoverableExchangeImpl(Exchange::shared_ptr _exchange, QueueRegistry& _queues) : exchange(_exchange), queues(_queues) {} + void setPersistenceId(uint64_t id); + void bind(std::string& queue, std::string& routingKey, qpid::framing::FieldTable& args); +}; + +RecoverableExchange::shared_ptr RecoveryManagerImpl::recoverExchange(framing::Buffer& buffer) +{ + return RecoverableExchange::shared_ptr(new RecoverableExchangeImpl(Exchange::decode(exchanges, buffer), queues)); } RecoverableQueue::shared_ptr RecoveryManagerImpl::recoverQueue(framing::Buffer& buffer) @@ -141,3 +151,14 @@ void RecoverableQueueImpl::setPersistenceId(uint64_t id) { queue->setPersistenceId(id); } + +void RecoverableExchangeImpl::setPersistenceId(uint64_t id) +{ + exchange->setPersistenceId(id); +} + +void RecoverableExchangeImpl::bind(string& queueName, string& key, framing::FieldTable& args) +{ + Queue::shared_ptr queue = queues.find(queueName); + exchange->bind(queue, key, &args); +} |