use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl 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.AuditLogableImpl in project ovirt-engine by oVirt.
the class RegisterDiskCommand method addRegisterInitatedAuditLog.
private void addRegisterInitatedAuditLog() {
AuditLogable logable = new AuditLogableImpl();
logable.addCustomValue("DiskAlias", getDiskImage().getDiskAlias());
auditLogDirector.log(logable, AuditLogType.USER_REGISTER_DISK_INITIATED);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class IrsBrokerCommand method logToAudit.
@Override
protected void logToAudit() {
AuditLogable logable = new AuditLogableImpl();
logable.addCustomValue("CommandName", getCommandName());
logable.addCustomValue("message", getReturnStatus().message);
auditLogDirector.log(logable, AuditLogType.IRS_BROKER_COMMAND_FAILURE);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class IrsProxy method queueDomainMaintenanceCheck.
public void queueDomainMaintenanceCheck(final StorageDomain domain, final StoragePool pool) {
getEventQueue().submitEventAsync(new Event(storagePoolId, domain.getId(), null, EventType.DOMAINFAILOVER, ""), () -> {
Collection<Guid> vdsConnectedToPool = getVdsConnectedToPool(storagePoolId);
Set<Guid> vdsDomInMaintenance = _domainsInMaintenance.get(domain.getId());
if (vdsConnectedToPool.isEmpty() || (vdsDomInMaintenance != null && vdsDomInMaintenance.containsAll(vdsConnectedToPool))) {
log.info("Moving domain '{}' to maintenance", domain.getId());
storagePoolIsoMapDao.updateStatus(domain.getStoragePoolIsoMapData().getId(), StorageDomainStatus.Maintenance);
AuditLogable logable = new AuditLogableImpl();
logable.setStorageDomainId(domain.getId());
logable.setStorageDomainName(domain.getName());
logable.setStoragePoolId(pool.getId());
logable.setStoragePoolName(pool.getName());
auditLogDirector.log(logable, AuditLogType.STORAGE_DOMAIN_MOVED_TO_MAINTENANCE);
}
return null;
});
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class IrsProxy method logDelayedDomain.
private void logDelayedDomain(String vdsName, String domainName, double delay) {
AuditLogable logable = new AuditLogableImpl();
logable.setVdsName(vdsName);
logable.setStorageDomainName(domainName);
logable.addCustomValue("Delay", Double.toString(delay));
auditLogDirector.log(logable, AuditLogType.VDS_DOMAIN_DELAY_INTERVAL);
}
Aggregations