Search in sources :

Example 61 with AuditLogableImpl

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();
    }
}
Also used : RepoImage(org.ovirt.engine.core.common.businessentities.storage.RepoImage) AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) Guid(org.ovirt.engine.core.compat.Guid) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl) OpenStackImageProviderProxy(org.ovirt.engine.core.bll.provider.storage.OpenStackImageProviderProxy) Provider(org.ovirt.engine.core.common.businessentities.Provider) ReentrantLock(java.util.concurrent.locks.ReentrantLock) Lock(java.util.concurrent.locks.Lock)

Example 62 with AuditLogableImpl

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);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 63 with AuditLogableImpl

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);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 64 with AuditLogableImpl

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;
    });
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) Event(org.ovirt.engine.core.common.eventqueue.Event) Guid(org.ovirt.engine.core.compat.Guid) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 65 with AuditLogableImpl

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);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Aggregations

AuditLogableImpl (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)88 AuditLogable (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable)85 AuditLogDirector (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector)8 AuditLogType (org.ovirt.engine.core.common.AuditLogType)6 Guid (org.ovirt.engine.core.compat.Guid)5 EngineException (org.ovirt.engine.core.common.errors.EngineException)4 HostUpgradeManagerResult (org.ovirt.engine.core.common.HostUpgradeManagerResult)3 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)3 AnsibleCommandBuilder (org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder)3 AnsibleReturnValue (org.ovirt.engine.core.common.utils.ansible.AnsibleReturnValue)3 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)2 StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)2 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)2 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)2 LUNs (org.ovirt.engine.core.common.businessentities.storage.LUNs)2 Event (org.ovirt.engine.core.common.eventqueue.Event)2