use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class ExternalSchedulerBrokerImpl method auditLogFailedToConnect.
private void auditLogFailedToConnect() {
AuditLogable loggable = new AuditLogableImpl();
auditLogDirector.log(loggable, AuditLogType.FAILED_TO_CONNECT_TO_SCHEDULER_PROXY);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class ExternalSchedulerBrokerObjectBuilder method auditLogPluginError.
private static void auditLogPluginError(String pluginName, String errorMessage) {
AuditLogable loggable = new AuditLogableImpl();
loggable.addCustomValue("PluginName", pluginName);
loggable.addCustomValue("ErrorMessage", errorMessage);
auditLogDirector.log(loggable, AuditLogType.EXTERNAL_SCHEDULER_PLUGIN_ERROR);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class ExternalSchedulerBrokerObjectBuilder method auditLogExternalSchedulerError.
private static void auditLogExternalSchedulerError(String errorMessage) {
AuditLogable loggable = new AuditLogableImpl();
loggable.addCustomValue("ErrorMessage", errorMessage);
auditLogDirector.log(loggable, AuditLogType.EXTERNAL_SCHEDULER_ERROR);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class ExternalSchedulerDiscovery method discover.
/**
* Discover external schedulers and process its policy units. This operation may take time and is recommended to run
* in a different thread. If we found new policy units we save them to db and expose them for usage.
*
* @return {@code true} if new policies where found and saved to db, {@code false} otherwise.
*/
public boolean discover() {
boolean dbUpdated;
Optional<ExternalSchedulerDiscoveryResult> discoveryResult = broker.runDiscover();
if (discoveryResult.isPresent()) {
updateDB(discoveryResult.get());
log.debug("PolicyUnits updated for external broker.");
dbUpdated = true;
} else {
AuditLogable loggable = new AuditLogableImpl();
auditLogDirector.log(loggable, AuditLogType.FAILED_TO_CONNECT_TO_SCHEDULER_PROXY);
log.warn("Discovery returned empty result when talking to broker. Disabling external units");
List<PolicyUnit> failingPolicyUnits = policyUnitDao.getAll().stream().collect(Collectors.toList());
markExternalPoliciesAsDisabled(failingPolicyUnits);
dbUpdated = true;
}
return dbUpdated;
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class BlockStorageDiscardFunctionalityHelper method logLunsBrokeStorageDomainDiscardAfterDeleteSupport.
private void logLunsBrokeStorageDomainDiscardAfterDeleteSupport(Collection<LUNs> lunsThatBreakSdDiscardAfterDeleteSupport, StorageDomain storageDomain) {
AuditLogable auditLog = new AuditLogableImpl();
auditLog.setStorageDomainId(storageDomain.getId());
auditLog.setStorageDomainName(storageDomain.getName());
auditLog.addCustomValue("LunsIds", lunsThatBreakSdDiscardAfterDeleteSupport.stream().map(LUNs::getLUNId).collect(Collectors.joining(", ")));
auditLogDirector.log(auditLog, AuditLogType.LUNS_BROKE_SD_DISCARD_AFTER_DELETE_SUPPORT);
}
Aggregations