Search in sources :

Example 6 with HostProviderProxy

use of org.ovirt.engine.core.bll.host.provider.HostProviderProxy in project ovirt-engine by oVirt.

the class EngineForemanProviderFinder method findEngineProvider.

public HostProviderProxy findEngineProvider() {
    engineHostName = resolveEngineHostName();
    if (engineHostName == null) {
        return null;
    }
    List<Provider<?>> hostProviders = dbFacade.getProviderDao().getAllByTypes(ProviderType.FOREMAN);
    HostProviderProxy proxy;
    for (Provider<?> provider : hostProviders) {
        proxy = providerProxyFactory.create(provider);
        if (proxy.isContentHostExist(engineHostName)) {
            return proxy;
        }
    }
    log.error("Failed to find host on any provider by host name '{}' ", engineHostName);
    return null;
}
Also used : HostProviderProxy(org.ovirt.engine.core.bll.host.provider.HostProviderProxy) Provider(org.ovirt.engine.core.common.businessentities.Provider)

Example 7 with HostProviderProxy

use of org.ovirt.engine.core.bll.host.provider.HostProviderProxy in project ovirt-engine by oVirt.

the class GetErrataForHostQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    VdsStatic host = hostStaticDao.get(getParameters().getId());
    if (host == null || host.getHostProviderId() == null) {
        getQueryReturnValue().setReturnValue(ErrataData.emptyData());
        return;
    }
    Provider<?> provider = providerDao.get(host.getHostProviderId());
    if (provider != null) {
        HostProviderProxy proxy = providerProxyFactory.create(provider);
        ErrataData errataForHost = proxy.getErrataForHost(host.getHostName(), getParameters().getErrataFilter());
        getQueryReturnValue().setReturnValue(errataForHost);
    } else {
        getQueryReturnValue().setReturnValue(ErrataData.emptyData());
    }
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) ErrataData(org.ovirt.engine.core.common.businessentities.ErrataData) HostProviderProxy(org.ovirt.engine.core.bll.host.provider.HostProviderProxy)

Example 8 with HostProviderProxy

use of org.ovirt.engine.core.bll.host.provider.HostProviderProxy in project ovirt-engine by oVirt.

the class GetErrataForVmQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    VM vm = vmDao.get(getParameters().getId());
    if (vm == null || vm.getDynamicData().getVmHost() == null) {
        getQueryReturnValue().setReturnValue(ErrataData.emptyData());
        return;
    }
    Provider<?> provider = providerDao.get(vm.getProviderId());
    if (provider != null) {
        HostProviderProxy proxy = providerProxyFactory.create(provider);
        ErrataData errataForVm = proxy.getErrataForHost(vm.getDynamicData().getVmHost(), getParameters().getErrataFilter());
        getQueryReturnValue().setReturnValue(errataForVm);
    } else {
        getQueryReturnValue().setReturnValue(ErrataData.emptyData());
    }
}
Also used : ErrataData(org.ovirt.engine.core.common.businessentities.ErrataData) VM(org.ovirt.engine.core.common.businessentities.VM) HostProviderProxy(org.ovirt.engine.core.bll.host.provider.HostProviderProxy)

Example 9 with HostProviderProxy

use of org.ovirt.engine.core.bll.host.provider.HostProviderProxy in project ovirt-engine by oVirt.

the class GetErratumByIdForVmQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    VM vm = vmDao.get(getParameters().getId());
    if (vm == null || vm.getDynamicData().getVmHost() == null || vm.getProviderId() == null) {
        return;
    }
    Provider<?> provider = providerDao.get(vm.getProviderId());
    if (provider != null) {
        HostProviderProxy proxy = providerProxyFactory.create(provider);
        getQueryReturnValue().setReturnValue(proxy.getErratumForHost(vm.getDynamicData().getVmHost(), getParameters().getErratumId()));
    }
}
Also used : VM(org.ovirt.engine.core.common.businessentities.VM) HostProviderProxy(org.ovirt.engine.core.bll.host.provider.HostProviderProxy)

Aggregations

HostProviderProxy (org.ovirt.engine.core.bll.host.provider.HostProviderProxy)9 ErrataData (org.ovirt.engine.core.common.businessentities.ErrataData)5 VM (org.ovirt.engine.core.common.businessentities.VM)3 VdsStatic (org.ovirt.engine.core.common.businessentities.VdsStatic)3 HashMap (java.util.HashMap)1 ExecutionContext (org.ovirt.engine.core.bll.job.ExecutionContext)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 VdsActionParameters (org.ovirt.engine.core.common.action.VdsActionParameters)1 AddVdsActionParameters (org.ovirt.engine.core.common.action.hostdeploy.AddVdsActionParameters)1 InstallVdsParameters (org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters)1 Provider (org.ovirt.engine.core.common.businessentities.Provider)1 EngineException (org.ovirt.engine.core.common.errors.EngineException)1 Step (org.ovirt.engine.core.common.job.Step)1 Guid (org.ovirt.engine.core.compat.Guid)1