Exemplo n.º 1
0
  private void wakeup(String[] names, Configuration config, InetAddress host, int port) {
    Machine[] hosts = config.getMachines();
    HashMap hostMap = new HashMap(hosts.length);

    for (int i = 0; i < hosts.length; i++) {
      Machine hostConfig = hosts[i];
      hostMap.put(hostConfig.getName().toLowerCase(), hostConfig);
    }

    for (int i = 0; i < names.length; i++) {
      String name = names[i];
      Machine hostConfig = (Machine) hostMap.get(name.toLowerCase());
      if (null != hostConfig) {
        wakeupConfig(hostConfig);
      } else {
        try {
          wakeupEthernetAddresses(name, host, port);
        } catch (IllegalEthernetAddressException e) {
          LOG.warning(
              Messages.ERROR_MESSAGES.getFormattedString("wakeup.notAHostOrEthernetAddress", name));
        }
      }
    }
  }