Search in sources :

Example 46 with AuditLogable

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.

the class BlockStorageDiscardFunctionalityHelper method logLunsBrokeStorageDomainPassDiscardSupport.

private void logLunsBrokeStorageDomainPassDiscardSupport(Collection<LUNs> lunsThatBreakSdPassDiscardSupport, StorageDomain storageDomain) {
    AuditLogable auditLog = new AuditLogableImpl();
    auditLog.setStorageDomainId(storageDomain.getId());
    auditLog.setStorageDomainName(storageDomain.getName());
    auditLog.addCustomValue("LunsIds", lunsThatBreakSdPassDiscardSupport.stream().map(LUNs::getLUNId).collect(Collectors.joining(", ")));
    auditLogDirector.log(auditLog, AuditLogType.LUNS_BROKE_SD_PASS_DISCARD_SUPPORT);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs)

Example 47 with AuditLogable

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.

the class GlusterAuditLogUtil method createEvent.

private AuditLogable createEvent(GlusterVolumeEntity volume, VDS server, Guid clusterId, String clusterName) {
    AuditLogable logable = new AuditLogableImpl();
    if (server != null) {
        logable.setVdsId(server.getId());
        logable.setVdsName(server.getName());
    }
    if (volume != null) {
        logable.setGlusterVolumeId(volume.getId());
        logable.setGlusterVolumeName(volume.getName());
    }
    logable.setClusterId(clusterId);
    logable.setClusterName(clusterName);
    return logable;
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 48 with AuditLogable

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.

the class GlusterAuditLogUtil method logAuditMessage.

public void logAuditMessage(final Guid clusterId, String clusterName, final GlusterVolumeEntity volume, final VDS server, final AuditLogType logType, final Map<String, String> customValues) {
    AuditLogable logable = createEvent(volume, server, clusterId, clusterName);
    if (customValues != null) {
        customValues.entrySet().forEach(e -> logable.addCustomValue(e.getKey(), e.getValue()));
    }
    auditLogDirector.log(logable, logType);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable)

Example 49 with AuditLogable

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.

the class GlusterEventFactory method createEvent.

public static AuditLogable createEvent(VDS vds, VDSReturnValue returnValue) {
    AuditLogable logable = new AuditLogableImpl();
    logable.setVdsId(vds.getId());
    logable.setVdsName(vds.getName());
    logable.setClusterId(vds.getClusterId());
    logable.setClusterName(vds.getClusterName());
    logable.addCustomValue("ErrorMessage", returnValue.getVdsError().getMessage());
    logable.updateCallStackFromThrowable(returnValue.getExceptionObject());
    return logable;
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 50 with AuditLogable

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.

the class IPTablesDeprecationNotifier method logWarning.

private void logWarning(Cluster cluster) {
    AuditLogable auditLog = new AuditLogableImpl();
    auditLog.setClusterId(cluster.getId());
    auditLog.setClusterName(cluster.getName());
    auditLog.addCustomValue("DeprecatingVersion", Version.v4_2.toString());
    // we cannot add 4.3 to Version enum until 4.2 release is branched
    auditLog.addCustomValue("RemovingVersion", "4.3");
    auditLogDirector.log(auditLog, AuditLogType.DEPRECATED_IPTABLES_FIREWALL);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

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