use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl 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.AuditLogableImpl 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);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl 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);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl 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;
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl 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;
}
Aggregations