Exemplo n.º 1
0
 @JsonIgnore
 public Map<String, SshHostConfiguration> getSshHostsMap() {
   if (sshConfiguration != null) {
     return sshConfiguration.getHosts();
   } else {
     return null;
   }
 }
Exemplo n.º 2
0
 /**
  * Looks up and lazily creates if required a SSH host configuration for the given host alias. The
  * host name will be defaulted to the same hostAlias value for cases when the alias is the same as
  * the actual host name
  */
 public SshHostConfiguration sshHost(String hostAlias) {
   SshConfiguration config = getSshConfiguration();
   if (config == null) {
     config = new SshConfiguration();
     setSshConfiguration(config);
   }
   Map<String, SshHostConfiguration> hosts = config.getHosts();
   if (hosts == null) {
     hosts = new HashMap<String, SshHostConfiguration>();
     config.setHosts(hosts);
   }
   SshHostConfiguration answer = hosts.get(hostAlias);
   if (answer == null) {
     answer = new SshHostConfiguration(hostAlias);
     hosts.put(hostAlias, answer);
   }
   return answer;
 }