Go to file
David Ostrovsky e3172b3496 Expose some BaseCommand's methods to support generic SSH commands
Exposing getName() to the derived SSH command implementation class allows us to
implement generic SSH commands.

For example Gerrit Shell plugin can now bind multiple commands to the same
class, which retrieves the shell command passed and executes it:

  public class SshShellModule extends PluginCommandModule {
    @Override
    protected void configureCommands() {
      command("ls").to(ShellCommand.class);
      command("ps").to(ShellCommand.class);
      [...]
    }
  }

With the possible implementation:

  public class ShellCommand extends SshCommand {
    @Override
    protected void run() throws UnloggedFailure {
      String cmd = getName().substring(getPluginName().length() + 1);
      ProcessBuilder proc = new ProcessBuilder(cmd);
      Process cmd = proc.start();
      [...]
    }
  }

And the call:

  davido@wizball:>ssh gerrit shell ls
  davido@wizball:>ssh gerrit shell ps

Change-Id: I43be66a99340e839b70c07e93752278cee5f039d
2013-10-16 12:32:55 -07:00
2013-05-21 20:28:56 -07:00
2013-05-21 20:28:56 -07:00
2013-09-26 23:12:55 -07:00
2013-05-21 20:28:56 -07:00
2013-09-20 19:41:26 -07:00
2013-09-26 16:33:09 -07:00
2013-09-20 19:41:26 -07:00
2008-11-14 16:59:34 -08:00
2009-03-27 20:20:10 -07:00
Description
RETIRED, Gerrit as used by OpenStack
120 MiB