Example #1
0
File: SSH.java Project: ning/atlas
 public SSH(Host host, Space space, String credentialName) throws IOException {
   this(
       SSHCredentials.lookup(space, credentialName)
           .otherwise(SSHCredentials.defaultCredentials(space))
           .otherwise(
               new IllegalStateException("no ssh credentials available for " + host.getId())),
       space
           .get(host.getId(), Server.class, Missing.RequireAll)
           .otherwise(new IllegalStateException("no server info available for " + host.getId()))
           .getExternalAddress());
 }
Example #2
0
File: SSH.java Project: ning/atlas
 public SSH(Identity hostId, String credentialName, Space space) throws IOException {
   this(
       SSHCredentials.lookup(space, credentialName)
           .otherwise(SSHCredentials.defaultCredentials(space))
           .otherwise(
               new IllegalStateException("Unable to find ssh credentials for " + credentialName)),
       space
           .get(hostId, Server.class, Missing.RequireAll)
           .otherwise(
               new IllegalStateException("Unable to find server info to ssh into " + hostId))
           .getExternalAddress());
 }