use of org.ovirt.engine.core.bll.network.vm.mac.VmMacsValidation in project ovirt-engine by oVirt.
the class ValidateVmMacsQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
// Map with a VM id as the key and violation messages (that are related to the VM) as the values.
final Map<Guid, List<List<String>>> result = new HashMap<>();
for (Entry<Guid, List<VM>> clusterEntry : getParameters().getVmsByCluster().entrySet()) {
final Guid clusterId = clusterEntry.getKey();
final List<VM> clusterVms = clusterEntry.getValue();
final ReadMacPool macPool = macPoolPerCluster.getMacPoolForCluster(clusterId);
final List<VmMacsValidation> vmMacsValidations = vmMacsValidationsFactory.createVmMacsValidationList(clusterId, macPool);
clusterVms.forEach(vm -> result.put(vm.getId(), validateVm(vm, vmMacsValidations)));
}
getQueryReturnValue().setReturnValue(result);
}
Aggregations