use of org.ovirt.engine.core.common.queries.IdAndNameQueryParameters in project ovirt-engine by oVirt.
the class ClusterModel method initTunedProfiles.
public void initTunedProfiles() {
this.startProgress();
if (getVersion() == null || getVersion().getSelectedItem() == null) {
return;
}
Version version = getVersion().getSelectedItem();
Frontend.getInstance().runQuery(QueryType.GetGlusterTunedProfiles, new IdAndNameQueryParameters(null, version.getValue()), new AsyncQuery<QueryReturnValue>(returnValue -> {
stopProgress();
List<String> glusterTunedProfiles = new ArrayList<>();
if (returnValue.getSucceeded()) {
glusterTunedProfiles.addAll(returnValue.getReturnValue());
}
final String oldSelectedProfile = glusterTunedProfile.getSelectedItem();
glusterTunedProfile.setItems(glusterTunedProfiles);
glusterTunedProfile.setIsAvailable(glusterTunedProfile.getItems().size() > 0);
String newSelectedItem = null;
if (oldSelectedProfile != null) {
newSelectedItem = Linq.firstOrNull(glusterTunedProfiles, x -> x.equals(oldSelectedProfile));
}
if (newSelectedItem != null) {
glusterTunedProfile.setSelectedItem(newSelectedItem);
} else if (getIsEdit()) {
glusterTunedProfile.setSelectedItem(Linq.firstOrNull(glusterTunedProfiles, x -> x.equals(getEntity().getGlusterTunedProfile())));
}
}));
}
use of org.ovirt.engine.core.common.queries.IdAndNameQueryParameters in project ovirt-engine by oVirt.
the class ManagementNetworkFinder method getManagementNetworkId.
Guid getManagementNetworkId(Cluster cluster, Guid dataCenterId) {
Guid managementNetworkId = null;
if (cluster.isSetManagementNetwork()) {
backendResource.validateParameters(cluster.getManagementNetwork(), "id|name");
final Network rawManagementNetwork = cluster.getManagementNetwork();
if (rawManagementNetwork.isSetId()) {
managementNetworkId = GuidUtils.asGuid(rawManagementNetwork.getId());
} else {
final org.ovirt.engine.core.common.businessentities.network.Network managementNetwork = backendResource.getEntity(org.ovirt.engine.core.common.businessentities.network.Network.class, QueryType.GetNetworkByNameAndDataCenter, new IdAndNameQueryParameters(dataCenterId, rawManagementNetwork.getName()), String.format("Network: %s", rawManagementNetwork.getName()));
managementNetworkId = managementNetwork.getId();
}
}
return managementNetworkId;
}
Aggregations