Search in sources :

Example 41 with AuditLogable

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

Example 42 with AuditLogable

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

Example 43 with AuditLogable

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

Example 44 with AuditLogable

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

Example 45 with AuditLogable

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);
}
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)

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