summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/Parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceGrid/Parser.cpp')
-rw-r--r--cpp/src/IceGrid/Parser.cpp89
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;