diff options
| author | Alan Conway <aconway@apache.org> | 2013-01-14 20:07:15 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2013-01-14 20:07:15 +0000 |
| commit | e642dd293cc007778f6bca8ef6a96d5390a5cba4 (patch) | |
| tree | 8f6aa98882f6ef5adb4daacd60e016aa8702836c /qpid/cpp/src | |
| parent | 131018c36d1f4b3e48df13362a9917deac3faf22 (diff) | |
| download | qpid-python-e642dd293cc007778f6bca8ef6a96d5390a5cba4.tar.gz | |
QPID-4514: Clean up cluster code: remove passive links.
Remove passive code from Link and LinkRegistry, only used by defunct cluster code.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1433089 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Link.cpp | 28 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Link.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/LinkRegistry.cpp | 16 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/LinkRegistry.h | 10 |
4 files changed, 5 insertions, 51 deletions
diff --git a/qpid/cpp/src/qpid/broker/Link.cpp b/qpid/cpp/src/qpid/broker/Link.cpp index 66cb1ebf3a..dfa7d4c3ab 100644 --- a/qpid/cpp/src/qpid/broker/Link.cpp +++ b/qpid/cpp/src/qpid/broker/Link.cpp @@ -171,12 +171,8 @@ Link::Link(const string& _name, agent->addObject(mgmtObject, 0, durable); } } - if (links->isPassive()) { - setStateLH(STATE_PASSIVE); - } else { - setStateLH(STATE_WAITING); - startConnectionLH(); - } + setStateLH(STATE_WAITING); + startConnectionLH(); broker->getTimer().add(timerTask); if (failover) { @@ -217,7 +213,6 @@ void Link::setStateLH (int newState) case STATE_OPERATIONAL : mgmtObject->set_state("Operational"); break; case STATE_FAILED : mgmtObject->set_state("Failed"); break; case STATE_CLOSED : mgmtObject->set_state("Closed"); break; - case STATE_PASSIVE : mgmtObject->set_state("Passive"); break; } } @@ -241,7 +236,6 @@ void Link::startConnectionLH () void Link::established(Connection* c) { - if (state == STATE_PASSIVE) return; stringstream addr; addr << host << ":" << port; QPID_LOG (info, "Inter-broker link established to " << addr.str()); @@ -364,7 +358,7 @@ void Link::closed(int, std::string text) } active.clear(); - if (state != STATE_FAILED && state != STATE_PASSIVE) + if (state != STATE_FAILED) { setStateLH(STATE_WAITING); mgmtObject->set_lastError (text); @@ -713,22 +707,6 @@ Manageable::status_t Link::ManagementMethod (uint32_t op, Args& args, string& te return Manageable::STATUS_UNKNOWN_METHOD; } -void Link::setPassive(bool passive) -{ - Mutex::ScopedLock mutex(lock); - if (passive) { - setStateLH(STATE_PASSIVE); - } else { - if (state == STATE_PASSIVE) { - setStateLH(STATE_WAITING); - } else { - QPID_LOG(warning, "Ignoring attempt to activate non-passive link " - << host << ":" << port); - } - } -} - - /** utility to clean up connection resources correctly */ void Link::closeConnection( const std::string& reason) { diff --git a/qpid/cpp/src/qpid/broker/Link.h b/qpid/cpp/src/qpid/broker/Link.h index 0c2d412690..f2f672b507 100644 --- a/qpid/cpp/src/qpid/broker/Link.h +++ b/qpid/cpp/src/qpid/broker/Link.h @@ -98,7 +98,6 @@ class Link : public PersistableConfig, public management::Manageable { static const int STATE_OPERATIONAL = 3; static const int STATE_FAILED = 4; static const int STATE_CLOSED = 5; - static const int STATE_PASSIVE = 6; static const uint32_t MAX_INTERVAL = 32; @@ -165,7 +164,6 @@ class Link : public PersistableConfig, public management::Manageable { std::string getPassword() { return password; } Broker* getBroker() { return broker; } - void setPassive(bool p); bool isConnecting() const { return state == STATE_CONNECTING; } // PersistableConfig: diff --git a/qpid/cpp/src/qpid/broker/LinkRegistry.cpp b/qpid/cpp/src/qpid/broker/LinkRegistry.cpp index a162bff229..5af6053943 100644 --- a/qpid/cpp/src/qpid/broker/LinkRegistry.cpp +++ b/qpid/cpp/src/qpid/broker/LinkRegistry.cpp @@ -44,7 +44,7 @@ namespace _qmf = qmf::org::apache::qpid::broker; // factored: The persistence element should be factored separately LinkRegistry::LinkRegistry () : broker(0), - parent(0), store(0), passive(false), + parent(0), store(0), realm("") { } @@ -61,7 +61,7 @@ class LinkRegistryConnectionObserver : public ConnectionObserver { LinkRegistry::LinkRegistry (Broker* _broker) : broker(_broker), - parent(0), store(0), passive(false), + parent(0), store(0), realm(broker->getOptions().realm) { broker->getConnectionObservers().add( @@ -414,16 +414,4 @@ std::string LinkRegistry::getAuthIdentity(const std::string& key) return link->getUsername(); } - -void LinkRegistry::setPassive(bool p) -{ - Mutex::ScopedLock locker(lock); - passive = p; - if (passive) { QPID_LOG(info, "Passivating links"); } - else { QPID_LOG(info, "Activating links"); } - for (LinkMap::iterator i = links.begin(); i != links.end(); i++) { - i->second->setPassive(passive); - } -} - }} // namespace qpid::broker diff --git a/qpid/cpp/src/qpid/broker/LinkRegistry.h b/qpid/cpp/src/qpid/broker/LinkRegistry.h index a3a5004ebb..21e8ddec81 100644 --- a/qpid/cpp/src/qpid/broker/LinkRegistry.h +++ b/qpid/cpp/src/qpid/broker/LinkRegistry.h @@ -53,7 +53,6 @@ namespace broker { Broker* broker; management::Manageable* parent; MessageStore* store; - bool passive; std::string realm; boost::shared_ptr<Link> findLink(const std::string& key); @@ -144,15 +143,6 @@ namespace broker { QPID_BROKER_EXTERN std::string getPassword (const std::string& key); QPID_BROKER_EXTERN std::string getHost (const std::string& key); QPID_BROKER_EXTERN uint16_t getPort (const std::string& key); - - /** - * Called to alter passive state. In passive state the links - * and bridges managed by a link registry will be recorded and - * updated but links won't actually establish connections and - * bridges won't therefore pull or push any messages. - */ - QPID_BROKER_EXTERN void setPassive(bool); - QPID_BROKER_EXTERN bool isPassive() { return passive; } }; } } |
