diff options
author | Kim van der Riet <kpvdr@apache.org> | 2013-02-28 16:14:30 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2013-02-28 16:14:30 +0000 |
commit | 9c73ef7a5ac10acd6a50d5d52bd721fc2faa5919 (patch) | |
tree | 2a890e1df09e5b896a9b4168a7b22648f559a1f2 /cpp/src/qpid/ha/QueueReplicator.h | |
parent | 172d9b2a16cfb817bbe632d050acba7e31401cd2 (diff) | |
download | qpid-python-asyncstore.tar.gz |
Update from trunk r1375509 through r1450773asyncstore
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1451244 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/ha/QueueReplicator.h')
-rw-r--r-- | cpp/src/qpid/ha/QueueReplicator.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/cpp/src/qpid/ha/QueueReplicator.h b/cpp/src/qpid/ha/QueueReplicator.h index 8d8a41a5ba..e8a793f611 100644 --- a/cpp/src/qpid/ha/QueueReplicator.h +++ b/cpp/src/qpid/ha/QueueReplicator.h @@ -41,6 +41,7 @@ class Deliverable; namespace ha { class HaBroker; +class Settings; /** * Exchange created on a backup broker to replicate a queue on the primary. @@ -57,7 +58,11 @@ class QueueReplicator : public broker::Exchange, public: static const std::string DEQUEUE_EVENT_KEY; static const std::string POSITION_EVENT_KEY; + static const std::string QPID_SYNC_FREQUENCY; + static std::string replicatorName(const std::string& queueName); + static bool isReplicatorName(const std::string&); + /** Test if a string is an event key */ static bool isEventKey(const std::string key); @@ -68,7 +73,6 @@ class QueueReplicator : public broker::Exchange, ~QueueReplicator(); void activate(); // Call after ctor - void deactivate(); // Call before dtor std::string getType() const; bool bind(boost::shared_ptr<broker::Queue>, const std::string&, const framing::FieldTable*, qpid::broker::AsyncStore* const); @@ -80,8 +84,18 @@ class QueueReplicator : public broker::Exchange, uint64_t getSize(); void write(char* target); + // Set if the queue has ever been subscribed to, used for auto-delete cleanup. + void setSubscribed() { subscribed = true; } + bool isSubscribed() { return subscribed; } + + boost::shared_ptr<broker::Queue> getQueue() const { return queue; } + private: + class ErrorListener; + class QueueObserver; + void initializeBridge(broker::Bridge& bridge, broker::SessionHandler& sessionHandler); + void destroy(); // Called when the queue is destroyed. void dequeue(framing::SequenceNumber, sys::Mutex::ScopedLock&); HaBroker& haBroker; @@ -92,6 +106,8 @@ class QueueReplicator : public broker::Exchange, boost::shared_ptr<broker::Link> link; boost::shared_ptr<broker::Bridge> bridge; BrokerInfo brokerInfo; + bool subscribed; + const Settings& settings; }; }} // namespace qpid::ha |