diff options
author | Bernard Normier <bernard@zeroc.com> | 2014-09-10 19:09:53 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2014-09-10 19:09:53 +0000 |
commit | ac587d9f1a6d34e46956fd17c81f99beb7ed97ad (patch) | |
tree | fa09b2b2d5b6037c76976ee293eb0d15b7a93717 /cpp/src/IceGrid/SessionServantManager.cpp | |
parent | Fix networkProxy test dependencies (diff) | |
download | ice-ac587d9f1a6d34e46956fd17c81f99beb7ed97ad.tar.bz2 ice-ac587d9f1a6d34e46956fd17c81f99beb7ed97ad.tar.xz ice-ac587d9f1a6d34e46956fd17c81f99beb7ed97ad.zip |
IceGrid::Admin now provides remote access to IceGrid registry and node Admin objects, and icegridadmin uses these
new operations to show the Ice log file for IceGrid registries and IceGrid nodes (ICE-2400)
Diffstat (limited to 'cpp/src/IceGrid/SessionServantManager.cpp')
-rw-r--r-- | cpp/src/IceGrid/SessionServantManager.cpp | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/cpp/src/IceGrid/SessionServantManager.cpp b/cpp/src/IceGrid/SessionServantManager.cpp index 6f85ff9ccff..a0a54302fe6 100644 --- a/cpp/src/IceGrid/SessionServantManager.cpp +++ b/cpp/src/IceGrid/SessionServantManager.cpp @@ -21,12 +21,20 @@ SessionServantManager::SessionServantManager(const Ice::ObjectAdapterPtr& adapte bool checkConnection, const string& serverAdminCategory, const Ice::ObjectPtr& serverAdminRouter, + const string& nodeAdminCategory, + const Ice::ObjectPtr& nodeAdminRouter, + const string& replicaAdminCategory, + const Ice::ObjectPtr& replicaAdminRouter, const AdminCallbackRouterPtr& adminCallbackRouter) : _adapter(adapter), _instanceName(instanceName), _checkConnection(checkConnection), _serverAdminCategory(serverAdminCategory), _serverAdminRouter(serverAdminRouter), + _nodeAdminCategory(nodeAdminCategory), + _nodeAdminRouter(nodeAdminRouter), + _replicaAdminCategory(replicaAdminCategory), + _replicaAdminRouter(replicaAdminRouter), _adminCallbackRouter(adminCallbackRouter) { } @@ -35,26 +43,43 @@ Ice::ObjectPtr SessionServantManager::locate(const Ice::Current& current, Ice::LocalObjectPtr&) { Lock sync(*this); + Ice::ObjectPtr servant; + bool plainServant = false; + if(_serverAdminRouter && current.id.category == _serverAdminCategory) { - if(_checkConnection && _adminConnections.find(current.con) == _adminConnections.end()) - { - return 0; - } - else - { - return _serverAdminRouter; - } + servant = _serverAdminRouter; + } + else if(_nodeAdminRouter && current.id.category == _nodeAdminCategory) + { + servant = _nodeAdminRouter; + } + else if(_replicaAdminRouter && current.id.category == _replicaAdminCategory) + { + servant = _replicaAdminRouter; } else { + plainServant = true; + map<Ice::Identity, ServantInfo>::const_iterator p = _servants.find(current.id); if(p == _servants.end() || (_checkConnection && p->second.connection != current.con)) { - return 0; + servant = 0; + } + else + { + servant = p->second.servant; } - return p->second.servant; } + + if(!plainServant && servant && _checkConnection && + _adminConnections.find(current.con) == _adminConnections.end()) + { + servant = 0; + } + + return servant; } void |