예제 #1
0
파일: SSH.java 프로젝트: 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());
 }
예제 #2
0
파일: SSH.java 프로젝트: 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());
 }