use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.
the class BackendExternalHostGroupsResource method list.
@Override
public ExternalHostGroups list() {
Provider provider = BackendExternalProviderHelper.getProvider(this, providerId);
ProviderQueryParameters parameters = new ProviderQueryParameters();
parameters.setProvider(provider);
return mapCollection(getBackendCollection(QueryType.GetHostGroupsFromExternalProvider, parameters));
}
use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.
the class NewHostModel method providers_SelectedItemChanged.
private void providers_SelectedItemChanged() {
cleanHostParametersFields();
Provider provider = getProviders().getSelectedItem();
setEnableSearchHost(provider != null);
}
use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.
the class NewHostModel method updateHostList.
private void updateHostList() {
Provider provider = getProviders().getSelectedItem();
if (provider == null) {
return;
}
AsyncDataProvider.getInstance().getExternalProviderHostList(new AsyncQuery<>(hosts -> {
ListModel<VDS> hostNameListModel = getExternalHostName();
hostNameListModel.setItems(hosts);
hostNameListModel.setIsChangeable(true);
setEnableSearchHost(true);
getProviders().setIsChangeable(true);
}), provider.getId(), true, getProviderSearchFilter().getEntity());
AsyncDataProvider.getInstance().getExternalProviderHostGroupList(new AsyncQuery<>(hostGroups -> {
ListModel externalHostGroupsListModel = getExternalHostGroups();
externalHostGroupsListModel.setItems(hostGroups);
externalHostGroupsListModel.setIsChangeable(true);
AsyncDataProvider.getInstance().getExternalProviderDiscoveredHostList(new AsyncQuery<>(hosts -> {
ListModel externalDiscoveredHostsListModel = getExternalDiscoveredHosts();
externalDiscoveredHostsListModel.setItems(hosts);
externalDiscoveredHostsListModel.setIsChangeable(true);
}), getProviders().getSelectedItem());
}), provider);
AsyncDataProvider.getInstance().getExternalProviderComputeResourceList(new AsyncQuery<>(computeResources -> {
ListModel externalComputeResourceListModel = getExternalComputeResource();
externalComputeResourceListModel.setItems(computeResources);
externalComputeResourceListModel.setIsChangeable(true);
}), provider);
}
use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.
the class GetComputeResourceFromExternalProviderQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
Provider hostProvider = getParameters().getProvider();
List<ExternalComputeResource> providerComputeResources = getProviderComputeResource(hostProvider);
getQueryReturnValue().setReturnValue(providerComputeResources);
}
use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.
the class BackendExternalProviderCertificateResource method get.
@Override
public Certificate get() {
// The resource identifier is actually the index of the certificate in the chain:
int i;
try {
i = Integer.parseInt(id);
} catch (NumberFormatException exception) {
return notFound();
}
// The backend doesn't have a mechanism to retrieve just one of the certificates of the chain, so we have to
// retrieve them all and find the one that matches the identifier:
Provider provider = BackendExternalProviderHelper.getProvider(this, providerId);
ProviderQueryParameters parameters = new ProviderQueryParameters();
parameters.setProvider(provider);
List<CertificateInfo> entities = getBackendCollection(CertificateInfo.class, QueryType.GetProviderCertificateChain, parameters);
if (entities != null && i >= 0 && i < entities.size()) {
CertificateInfo entity = entities.get(i);
Certificate model = populate(map(entity), entity);
model.setId(id);
return model;
}
// No luck:
return notFound();
}
Aggregations