/** * Returns the consolidation status of a virtual machine */ private void getVmConsolidationNeeded(String vmName, PrintWriter out) throws IOException { try { VirtualMachine vm = (VirtualMachine) getManagedEntity(vmName, "VirtualMachine"); Boolean is = false; if (vm == null) { LOG.warn("No vm named '" + vmName + "' found"); } else { VirtualMachineRuntimeInfo vmRuntime = vm.getRuntime(); is = vmRuntime.getConsolidationNeeded(); if (is == null) { is = false; } } out.print(is ? "1" : "0"); out.flush(); } catch (Exception ex) { LOG.error("An error occurred : " + ex.toString()); } }