use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class UpdateVmCommand method logHotSetActionEvent.
/**
* add audit log msg for failed hot set in case error was in CDA
* otherwise internal command will audit log the result
*/
private void logHotSetActionEvent(ActionReturnValue setActionResult, AuditLogType logType) {
if (!setActionResult.isValid()) {
AuditLogable logable = new AuditLogableImpl();
logable.setVmId(getVmId());
logable.setVmName(getVmName());
List<String> validationMessages = backend.getErrorsTranslator().translateErrorText(setActionResult.getValidationMessages());
logable.addCustomValue(HotSetNumberOfCpusCommand.LOGABLE_FIELD_ERROR_MESSAGE, StringUtils.join(validationMessages, ","));
auditLogDirector.log(logable, logType);
}
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class RemoveAuditLogByIdCommand method executeCommand.
@Override
protected void executeCommand() {
AuditLog auditLog = getAuditLog();
auditLogDao.remove(getParameters().getAuditLogId());
setAuditLogDetails(auditLog);
// clear the id so the auditLog will be considered as a system-level auditLog
auditLog.setUserId(Guid.Empty);
AuditLogable logableToClear = createAuditLogableImpl(auditLog);
// clean cache manager entry (if exists)
EventFloodRegulator eventFloodRegulator = new EventFloodRegulator(logableToClear, auditLog.getLogType());
eventFloodRegulator.evict();
setSucceeded(true);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class FenceAgentExecutor method createAuditLogObject.
private AuditLogable createAuditLogObject(FenceActionType action, FenceAgent agent, VDS proxyHost) {
AuditLogable alb = new AuditLogableImpl();
alb.addCustomValue("Action", action.name().toLowerCase());
alb.addCustomValue("Host", fencedHost.getName() == null ? fencedHost.getId().toString() : fencedHost.getName());
alb.addCustomValue("AgentType", agent.getType());
alb.addCustomValue("AgentIp", agent.getIp());
alb.addCustomValue("ProxyHost", proxyHost.getName());
alb.setVdsId(fencedHost.getId());
return alb;
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class PowerSavingBalancePolicyUnit method logAction.
private void logAction(VDS vds, AuditLogType type) {
AuditLogable loggable = new AuditLogableImpl();
loggable.addCustomValue("Host", vds.getName());
loggable.setVdsName(vds.getName());
loggable.setVdsId(vds.getId());
loggable.setClusterId(vds.getClusterId());
loggable.setClusterName(vds.getClusterName());
Injector.get(AuditLogDirector.class).log(loggable, type);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class DataCenterCompatibilityChecker method logAlert.
private void logAlert(Version version, StoragePool storagePool) {
AuditLogable auditLog = new AuditLogableImpl();
auditLog.setStoragePoolId(storagePool.getId());
auditLog.setStoragePoolName(storagePool.getName());
auditLog.addCustomValue("engineVersion", version.toString());
auditLog.addCustomValue("dcVersion", storagePool.getCompatibilityVersion().toString());
auditLogDirector.log(auditLog, AuditLogType.STORAGE_POOL_LOWER_THAN_ENGINE_HIGHEST_CLUSTER_LEVEL);
}
Aggregations