diff options
| author | Alan Conway <aconway@apache.org> | 2012-06-12 21:20:07 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-06-12 21:20:07 +0000 |
| commit | ed0d321d0ad56b9ea3d370d8b6b34fce2c8ef892 (patch) | |
| tree | 1e225776914dc5b14e0e38c8e2236d5ce144ac3b /cpp/src/qpid/ha/ConnectionObserver.cpp | |
| parent | c9fc98ae80a5d8c4f58541f9738aa975723ff3d6 (diff) | |
| download | qpid-python-ed0d321d0ad56b9ea3d370d8b6b34fce2c8ef892.tar.gz | |
QPID-3603: Introduced RemoteBackup to track backup status.
The primary creates RemoteBackup object for each connected or expected
backup. On first being promoted, the new primary has a RemoteBackup
for each of the known backups at the time of the failure.
The RemoteBackup manages queue guards for its backup and
tracks it's readiness.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1349540 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/ha/ConnectionObserver.cpp')
| -rw-r--r-- | cpp/src/qpid/ha/ConnectionObserver.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cpp/src/qpid/ha/ConnectionObserver.cpp b/cpp/src/qpid/ha/ConnectionObserver.cpp index 694a253fc3..d121aa1191 100644 --- a/cpp/src/qpid/ha/ConnectionObserver.cpp +++ b/cpp/src/qpid/ha/ConnectionObserver.cpp @@ -21,6 +21,7 @@ #include "ConnectionObserver.h" #include "BrokerInfo.h" +#include "HaBroker.h" #include "qpid/framing/FieldTable.h" #include "qpid/broker/Connection.h" #include "qpid/log/Statement.h" @@ -28,9 +29,10 @@ namespace qpid { namespace ha { -ConnectionObserver::ConnectionObserver(const types::Uuid& uuid) - : logPrefix("HA: "), self(uuid) {} +ConnectionObserver::ConnectionObserver(HaBroker& hb, const types::Uuid& uuid) + : haBroker(hb), logPrefix("HA: "), self(uuid) {} +// FIXME aconway 2012-06-06: move to BrokerInfo bool ConnectionObserver::getBrokerInfo(broker::Connection& connection, BrokerInfo& info) { framing::FieldTable ft; if (connection.getClientProperties().getTable(ConnectionObserver::BACKUP_TAG, ft)) { @@ -58,13 +60,16 @@ void ConnectionObserver::opened(broker::Connection& connection) { return; // No need to call observer, always allow admins. } BrokerInfo info; // Avoid self connections. - if (getBrokerInfo(connection, info) && info.getSystemId() == self) - throw Exception("HA rejected self connection"); + if (getBrokerInfo(connection, info)) { + if (info.getSystemId() == self) + throw Exception("HA rejected self connection"); + } ObserverPtr o(getObserver()); if (o) o->opened(connection); } void ConnectionObserver::closed(broker::Connection& connection) { + BrokerInfo info; ObserverPtr o(getObserver()); if (o) o->closed(connection); } |
