private List<String> getSlaveNames() { ComputerSet computers = Jenkins.getInstance().getComputer(); List<String> slaveNames = computers.get_slaveNames(); // slaveNames is unmodifiable, therefore create a new list List<String> slaves = new ArrayList<String>(); slaves.addAll(slaveNames); return slaves; }
/** * Gets the names of all configured slaves, regardless whether they are online. * * @return list with all slave names */ @SuppressWarnings("deprecation") private static List<String> getSlaveNames() { ComputerSet computers = Hudson.getInstance().getComputer(); List<String> slaveNames = computers.get_slaveNames(); // slaveNames is unmodifiable, therefore create a new list List<String> test = new ArrayList<String>(); test.addAll(slaveNames); // add 'magic' name for master, so all nodes can be handled the same way if (!test.contains(MASTER)) { test.add(0, MASTER); } return test; }