コード例 #1
0
  public int getSshPort() {
    String sshPort = amiType.isUnix() ? ((UnixData) amiType).getSshPort() : "22";
    if (sshPort == null || sshPort.length() == 0) return 22;

    int port = 0;
    try {
      port = Integer.parseInt(sshPort);
    } catch (Exception e) {
    }
    return port != 0 ? port : 22;
  }
コード例 #2
0
 public int getSshPort() {
   try {
     String sshPort = "";
     if (amiType.isUnix()) {
       sshPort = ((UnixData) amiType).getSshPort();
     }
     return Integer.parseInt(sshPort);
   } catch (NumberFormatException e) {
     return 22;
   }
 }
コード例 #3
0
 public String getRootCommandPrefix() {
   return amiType.isUnix() ? ((UnixData) amiType).getRootCommandPrefix() : "";
 }
コード例 #4
0
 public boolean isUseHTTPS() {
   return amiType.isWindows() && ((WindowsData) amiType).isUseHTTPS();
 }
コード例 #5
0
 public Secret getAdminPassword() {
   return amiType.isWindows() ? ((WindowsData) amiType).getPassword() : Secret.fromString("");
 }
コード例 #6
0
 public boolean isUnixSlave() {
   return amiType.isUnix();
 }
コード例 #7
0
 public boolean isWindowsSlave() {
   return amiType.isWindows();
 }
コード例 #8
0
 public int getBootDelay() {
   return amiType.isWindows() ? ((WindowsData) amiType).getBootDelayInMillis() : 0;
 }
コード例 #9
0
 public boolean isUseHTTPS() {
   return amiType.isWindows() ? ((WindowsData) amiType).isUseHTTPS() : false;
 }
コード例 #10
0
 public String getAdminPassword() {
   return amiType.isWindows() ? ((WindowsData) amiType).getPassword() : "";
 }
コード例 #11
0
 String getRootCommandPrefix() {
   String commandPrefix = amiType.isUnix() ? ((UnixData) amiType).getRootCommandPrefix() : "";
   if (commandPrefix == null || commandPrefix.length() == 0) return "";
   return commandPrefix + " ";
 }
コード例 #12
0
 String getRemoteAdmin() {
   if (remoteAdmin == null || remoteAdmin.length() == 0)
     return amiType.isWindows() ? "Administrator" : "root";
   return remoteAdmin;
 }