diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-09-04 19:39:59 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-09-04 19:39:59 +0000 |
commit | 1ce69fc8c36f2b7fa1d71ebe18e7ac4de01e3268 (patch) | |
tree | cd87f8121980159fdafd6b01e6802ea594478b93 /cpp/src/IceGrid/Parser.cpp | |
parent | icegridadmin always uses routed config if possible. added error messages if (diff) | |
download | ice-1ce69fc8c36f2b7fa1d71ebe18e7ac4de01e3268.tar.bz2 ice-1ce69fc8c36f2b7fa1d71ebe18e7ac4de01e3268.tar.xz ice-1ce69fc8c36f2b7fa1d71ebe18e7ac4de01e3268.zip |
Improved observers, refactored topic manager and initialization Added
icegridadmin commands to examine the registries
Diffstat (limited to 'cpp/src/IceGrid/Parser.cpp')
-rw-r--r-- | cpp/src/IceGrid/Parser.cpp | 89 |
1 files changed, 85 insertions, 4 deletions
diff --git a/cpp/src/IceGrid/Parser.cpp b/cpp/src/IceGrid/Parser.cpp index f2aec2882c6..c7fcf90e9e4 100644 --- a/cpp/src/IceGrid/Parser.cpp +++ b/cpp/src/IceGrid/Parser.cpp @@ -628,6 +628,91 @@ Parser::listAllNodes() } void +Parser::describeRegistry(const list<string>& args) +{ + if(args.size() != 1) + { + invalidCommand("`registry describe' requires exactly one argument"); + return; + } + + try + { + RegistryInfo info = _admin->getRegistryInfo(args.front()); + Output out(cout); + out << "registry `" << args.front() << "'"; + out << sb; + out << nl << "host name = `" << info.hostname << "'"; + out << nl << "endpoints = `" << info.endpoints << "'"; + out << eb; + out << nl; + } + catch(const Ice::Exception& ex) + { + exception(ex); + } +} + +void +Parser::pingRegistry(const list<string>& args) +{ + if(args.size() != 1) + { + invalidCommand("`registry ping' requires exactly one argument"); + return; + } + + try + { + if(_admin->pingRegistry(args.front())) + { + cout << "registry is up" << endl; + } + else + { + cout << "registry is down" << endl; + } + } + catch(const Ice::Exception& ex) + { + exception(ex); + } +} + +void +Parser::shutdownRegistry(const list<string>& args) +{ + if(args.size() != 1) + { + invalidCommand("`registry shutdown' requires exactly one argument"); + return; + } + + try + { + _admin->shutdownRegistry(args.front()); + } + catch(const Ice::Exception& ex) + { + exception(ex); + } +} + +void +Parser::listAllRegistries() +{ + try + { + Ice::StringSeq names = _admin->getAllRegistryNames(); + copy(names.begin(), names.end(), ostream_iterator<string>(cout,"\n")); + } + catch(const Ice::Exception& ex) + { + exception(ex); + } +} + +void Parser::removeServer(const list<string>& args) { if(args.size() != 1) @@ -1527,10 +1612,6 @@ Parser::exception(const Ice::Exception& ex) { error("object `" + _communicator->identityToString(ex.id) + "' already exists"); } - catch(const ObjectNotExistException& ex) - { - error("couldn't find object `" + _communicator->identityToString(ex.id) + "'"); - } catch(const DeploymentException& ex) { ostringstream s; |