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