Search in sources :

Example 81 with AuditLogable

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);
    }
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) Network(org.ovirt.engine.core.common.businessentities.network.Network) ArrayList(java.util.ArrayList) VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface) NetworkImplementationDetails(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails)

Example 82 with AuditLogable

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

Example 83 with AuditLogable

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();
    }
}
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 84 with AuditLogable

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

Example 85 with AuditLogable

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

Aggregations

AuditLogable (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable)126 AuditLogableImpl (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)86 AuditLogType (org.ovirt.engine.core.common.AuditLogType)10 AuditLogDirector (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector)9 Guid (org.ovirt.engine.core.compat.Guid)8 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)6 ArrayList (java.util.ArrayList)5 Date (java.util.Date)3 HashMap (java.util.HashMap)3 List (java.util.List)3 Map (java.util.Map)3 Collectors (java.util.stream.Collectors)3 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)3 VDS (org.ovirt.engine.core.common.businessentities.VDS)3 EngineException (org.ovirt.engine.core.common.errors.EngineException)3 HashSet (java.util.HashSet)2 Inject (javax.inject.Inject)2 Singleton (javax.inject.Singleton)2 HostUpgradeManagerResult (org.ovirt.engine.core.common.HostUpgradeManagerResult)2 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)2