use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class HostNetworkTopologyPersisterImpl method logUnsynchronizedNetworks.
private void logUnsynchronizedNetworks(VDS host, Map<String, Network> networks) {
List<String> networkNames = new ArrayList<>();
for (VdsNetworkInterface iface : host.getInterfaces()) {
Network network = networks.get(iface.getNetworkName());
NetworkImplementationDetails networkImplementationDetails = networkImplementationDetailsUtils.calculateNetworkImplementationDetails(iface, network);
if (networkImplementationDetails != null && !networkImplementationDetails.isInSync() && networkImplementationDetails.isManaged()) {
networkNames.add(iface.getNetworkName());
}
}
if (!networkNames.isEmpty()) {
final AuditLogable logable = createAuditLogForHost(host);
logable.addCustomValue("Networks", StringUtils.join(networkNames, ","));
auditLogDirector.log(logable, AuditLogType.VDS_NETWORKS_OUT_OF_SYNC);
}
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class MultipathHealthHandler method createAuditLogableForHost.
private AuditLogable createAuditLogableForHost(VDS vds) {
AuditLogable logable = new AuditLogableImpl();
logable.setVdsId(vds.getId());
logable.setVdsName(vds.getName());
return logable;
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class IsoDomainListSynchronizer method refreshImageDomain.
private boolean refreshImageDomain(final StorageDomain storageDomain, final ImageFileType imageType) {
Provider provider = providerDao.get(new Guid(storageDomain.getStorage()));
final OpenStackImageProviderProxy client = providerProxyFactory.create(provider);
Lock syncObject = getSyncObject(storageDomain.getId(), imageType);
try {
syncObject.lock();
return TransactionSupport.executeInScope(TransactionScopeOption.RequiresNew, () -> {
repoFileMetaDataDao.removeRepoDomainFileList(storageDomain.getId(), imageType);
Integer totalListSize = Config.<Integer>getValue(ConfigValues.GlanceImageTotalListSize);
List<RepoImage> repoImages = client.getAllImagesAsRepoImages(Config.<Integer>getValue(ConfigValues.GlanceImageListSize), totalListSize);
if (repoImages.size() >= totalListSize) {
AuditLogable logable = new AuditLogableImpl();
logable.addCustomValue("imageDomain", storageDomain.getName()).addCustomValue("imageListSize", String.valueOf(repoImages.size()));
logable.setStorageDomainId(storageDomain.getId());
logable.setStorageDomainName(storageDomain.getName());
auditLogDirector.log(logable, AuditLogType.REFRESH_REPOSITORY_IMAGE_LIST_INCOMPLETE);
}
for (RepoImage repoImage : repoImages) {
repoImage.setRepoDomainId(storageDomain.getId());
repoFileMetaDataDao.addRepoFileMap(repoImage);
}
return true;
});
} finally {
syncObject.unlock();
}
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class MetadataDiskDescriptionHandler method auditLogDiskFieldTruncatedAndOthersWereLost.
private void auditLogDiskFieldTruncatedAndOthersWereLost(String diskAlias, String fieldName, String diskFieldsNames) {
AuditLogable logable = createDiskEvent(diskAlias);
logable.addCustomValue("DiskFieldName", fieldName);
logable.addCustomValue("DiskFieldsNames", diskFieldsNames);
auditLogDirector.log(logable, AuditLogType.FAILED_TO_STORE_ENTIRE_DISK_FIELD_AND_REST_OF_FIELDS_IN_DISK_DESCRIPTION_METADATA);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class MetadataDiskDescriptionHandler method auditLogDiskFieldTruncated.
private void auditLogDiskFieldTruncated(String diskAlias, String fieldName) {
AuditLogable logable = createDiskEvent(diskAlias);
logable.addCustomValue("DiskFieldName", fieldName);
auditLogDirector.log(logable, AuditLogType.FAILED_TO_STORE_ENTIRE_DISK_FIELD_IN_DISK_DESCRIPTION_METADATA);
}
Aggregations