Example #1
0
 @Override
 public void start() {
   try {
     log.info("Starting Opal SSH Server on port {}", sshd.getPort());
     sshd.start();
     isRunning = true;
   } catch (IOException e) {
     throw new RuntimeException(e);
   }
 }
 /**
  * creates a new Config with the ssh hostname and port set to connect to the provided server.
  *
  * @param sshd the server to configure for
  * @param sshKey the public key location to configure
  * @param existing the existing configuration
  * @return a new Config
  * @see Config#Config(IGerritHudsonTriggerConfig)
  */
 public static Config getConfigFor(
     final SshServer sshd, KeyPairFiles sshKey, IGerritHudsonTriggerConfig existing) {
   Config c = new Config(existing);
   String host = sshd.getHost();
   if (StringUtils.isBlank(host)) {
     c.setGerritHostName("localhost");
   } else {
     c.setGerritHostName(host);
   }
   c.setGerritSshPort(sshd.getPort());
   if (sshKey != null) {
     c.setGerritAuthKeyFile(sshKey.getPrivateKey());
   }
   return c;
 }