/** * Saves the settings for team mapping, last deployment, and current username/server to the * settings file Called by the GuiMenuBar and WindowListeners */ public void saveSettings() { for (VirtualMachineExt each : vmRootEntities) { TEAMS.put(each.getName(), each.getTeam()); } SETTINGS_READER.lastServer = getCurrentServer(); SETTINGS_READER.lastUser = getCurrentUsername(); SETTINGS_READER.save(); LOG.write("Settings Saved Successfully"); }
/** * Gets a VirtualMachineExt based on a name * * @param name the name of the VirtualMachineExt to find * @return the VirtualMachineExt, or null if not found */ public VirtualMachineExt getVM(String name) { VirtualMachineExt foundVM = null; for (VirtualMachineExt thisVM : vmRootEntities) { if (thisVM.getName().equals(name)) { foundVM = thisVM; } } return foundVM; }
/** * Gathers the data from each VirtualMachine object Creates an Object[][] which is filled with * data in a primary for/each loop. <br> * <strong>Important: </strong>refresh() should be called to ensure this information is valid * * @return the table of information from each virtual machine */ public Object[][] gatherTableData() { Object[][] data = null; try { data = new Object[vmRootEntities.size()][COLUMN_HEADINGS.length]; int row = 0; for (VirtualMachineExt each : vmRootEntities) { data[row][0] = each.getIcon(); data[row][1] = each.getName(); data[row][2] = each.getGuestOS(); data[row][3] = each.getTeam(); data[row][4] = each.getPowerStatus(); data[row][5] = each.getCpuUsage(); data[row][6] = each.getMemUsage(); data[row][7] = each.getHost(); data[row][8] = each.getIpAddr(); data[row][9] = each.getHostName(); data[row][10] = each.getDescription(); row++; } } catch (Exception e) { LOG.write("Error getting data to update VM table", true); LOG.printStackTrace(e); } return data; }