use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class GetVmsFullInfoFromExternalProviderVDSCommand method logNonDownVms.
private void logNonDownVms(List<VM> notDownVms) {
if (!notDownVms.isEmpty()) {
if (shouldLogToAuditLog()) {
AuditLogable logable = new AuditLogableImpl();
logable.addCustomValue("URL", getParameters().getUrl());
logable.addCustomValue("Vms", StringUtils.join(notDownVms, ","));
auditLogDirector.log(logable, AuditLogType.IMPORTEXPORT_GET_EXTERNAL_VMS_NOT_IN_DOWN_STATUS);
} else {
log.warn("The following VMs retrieved from external server '{}' are not in down status and therefore can't be imported: '{}'.", getParameters().getUrl(), StringUtils.join(notDownVms, ","));
}
}
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class HostNetworkTopologyPersisterImpl method logChangedDisplayNetwork.
private void logChangedDisplayNetwork(VDS host, Collection<Network> engineHostNetworks, Collection<VdsNetworkInterface> engineInterfaces) {
if (isVmRunningOnHost(host.getId())) {
final Network engineDisplayNetwork = findDisplayNetwork(host.getClusterId(), engineHostNetworks);
if (engineDisplayNetwork == null) {
return;
}
final IsNetworkOnInterfacePredicate isNetworkOnInterfacePredicate = new IsNetworkOnInterfacePredicate(engineDisplayNetwork.getName());
final VdsNetworkInterface vdsmDisplayInterface = host.getInterfaces().stream().filter(isNetworkOnInterfacePredicate).findFirst().orElse(null);
final VdsNetworkInterface engineDisplayInterface = engineInterfaces.stream().filter(isNetworkOnInterfacePredicate).findFirst().orElse(null);
final DisplayInterfaceEqualityPredicate displayIneterfaceEqualityPredicate = new DisplayInterfaceEqualityPredicate(engineDisplayInterface);
if (// the display interface is't on host anymore
vdsmDisplayInterface == null || !displayIneterfaceEqualityPredicate.test(vdsmDisplayInterface)) {
final AuditLogable loggable = createAuditLogForHost(host);
auditLogDirector.log(loggable, AuditLogType.NETWORK_UPDATE_DISPLAY_FOR_HOST_WITH_ACTIVE_VM);
}
}
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class HostNetworkTopologyPersisterImpl method createAuditLogForHost.
private AuditLogable createAuditLogForHost(VDS host) {
final AuditLogable loggable = new AuditLogableImpl();
loggable.setVdsId(host.getId());
loggable.setVdsName(host.getName());
return loggable;
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class AutoStartVmsRunner method createVmEvent.
private AuditLogable createVmEvent(Guid vmId) {
AuditLogable event = new AuditLogableImpl();
event.setVmId(vmId);
event.setVmName(resourceManager.getVmManager(vmId).getName());
return event;
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class AutoStartVmsRunner method logVmEvent.
private void logVmEvent(Guid vmId, AuditLogType restartFailedAuditLogType) {
AuditLogable event = createVmEvent(vmId);
auditLogDirector.log(event, restartFailedAuditLogType);
}
Aggregations