diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-11-16 17:54:50 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-11-16 17:54:50 +0100 |
commit | 35ea645bf53d93373ba7a1457698caad74448add (patch) | |
tree | fc184e698c205d38604762996376910e85f01744 /cpp/src/IceGrid/Parser.cpp | |
parent | Added .gitignore files (diff) | |
download | ice-35ea645bf53d93373ba7a1457698caad74448add.tar.bz2 ice-35ea645bf53d93373ba7a1457698caad74448add.tar.xz ice-35ea645bf53d93373ba7a1457698caad74448add.zip |
Bug 2446
Diffstat (limited to 'cpp/src/IceGrid/Parser.cpp')
-rw-r--r-- | cpp/src/IceGrid/Parser.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/Parser.cpp b/cpp/src/IceGrid/Parser.cpp index 35ab0cbf548..1f684e13c5e 100644 --- a/cpp/src/IceGrid/Parser.cpp +++ b/cpp/src/IceGrid/Parser.cpp @@ -127,6 +127,12 @@ static const char* _commandsHelp[][3] = { { "server", "describe", "server describe ID Describe server ID.\n" }, +{ "server", "properties", +"server properties ID Get the runtime properties of server ID.\n" +}, +{ "server", "property", +"server property ID NAME Get the runtime property NAME of server ID.\n" +}, { "server", "state", "server state ID Get the state of server ID.\n" }, @@ -1197,6 +1203,41 @@ Parser::pidServer(const list<string>& args) } void +Parser::propertiesServer(const list<string>& args, bool single) +{ + if(single && args.size() != 2) + { + invalidCommand("server property", "requires exactly two arguments"); + return; + } + else if(!single && args.size() != 1) + { + invalidCommand("server properties", "requires exactly one argument"); + return; + } + + try + { + Ice::PropertyDict properties = _admin->getServerProperties(args.front()); + if(single) + { + cout << properties[*(++args.begin())] << endl; + } + else + { + for(Ice::PropertyDict::const_iterator p = properties.begin(); p != properties.end(); ++p) + { + cout << p->first << "=" << p->second << endl; + } + } + } + catch(const Ice::Exception& ex) + { + exception(ex); + } +} + +void Parser::enableServer(const list<string>& args, bool enable) { if(args.size() != 1) @@ -2048,6 +2089,10 @@ Parser::exception(const Ice::Exception& ex) { error("registry `" + ex.name + "' couldn't be reached:\n" + ex.reason); } + catch(const ServerUnreachableException& ex) + { + error("server `" + ex.name + "' couldn't be reached:\n" + ex.reason); + } catch(const AccessDeniedException& ex) { error("couldn't update the registry, the session from `" + ex.lockUserId + "' is updating the registry"); |