use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class GuideModel method checkVdsClusterChangeSucceeded.
protected void checkVdsClusterChangeSucceeded(final String searchStr, final List<ActionParametersBase> changeVdsParameterList, final List<ActionParametersBase> activateVdsParameterList) {
final Map<Guid, Guid> hostClusterIdMap = new HashMap<>();
for (ActionParametersBase param : changeVdsParameterList) {
hostClusterIdMap.put(((ChangeVDSClusterParameters) param).getVdsId(), ((ChangeVDSClusterParameters) param).getClusterId());
}
Frontend.getInstance().runQuery(QueryType.Search, new SearchParameters(searchStr, SearchType.VDS), new AsyncQuery<QueryReturnValue>(returnValue -> {
List<VDS> hosts = returnValue.getReturnValue();
boolean succeeded = true;
for (VDS host : hosts) {
if (!host.getClusterId().equals(hostClusterIdMap.get(host.getId()))) {
succeeded = false;
}
}
if (!succeeded) {
getWindow().stopProgress();
cancel();
errorPopupManager.show(ConstantsManager.getInstance().getConstants().hostChangeClusterTimeOut());
} else {
activateHostsAfterClusterChange(searchStr, activateVdsParameterList);
}
}));
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class ImportSanStorageModel method getUnregisteredStorageDomains.
protected void getUnregisteredStorageDomains(List<StorageServerConnections> connections) {
VDS vds = getContainer().getHost().getSelectedItem();
Frontend.getInstance().runQuery(QueryType.GetUnregisteredBlockStorageDomains, new GetUnregisteredBlockStorageDomainsParameters(vds.getId(), getType(), connections), new AsyncQuery<QueryReturnValue>(returnValue -> {
Pair<List<StorageDomain>, List<StorageServerConnections>> returnValuePair = returnValue.getReturnValue();
ArrayList<StorageDomain> storageDomains = (ArrayList<StorageDomain>) returnValuePair.getFirst();
ArrayList<StorageServerConnections> connections1 = (ArrayList<StorageServerConnections>) returnValuePair.getSecond();
if (storageDomains != null) {
addStorageDomains(storageDomains);
}
postGetUnregisteredStorageDomains(storageDomains, connections1);
}));
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class VmModelBehaviorBase method doChangeDefaultHost.
protected void doChangeDefaultHost(List<Guid> dedicatedHostIds) {
getModel().getIsAutoAssign().setEntity(true);
if (dedicatedHostIds == null) {
return;
}
if (getModel().getDefaultHost().getItems() != null) {
List<VDS> selectedHosts = new ArrayList<>();
for (VDS host : getModel().getDefaultHost().getItems()) {
if (dedicatedHostIds.contains(host.getId())) {
selectedHosts.add(host);
}
}
if (!selectedHosts.isEmpty()) {
getModel().getDefaultHost().setSelectedItems(selectedHosts);
getModel().getIsAutoAssign().setEntity(false);
}
}
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class ReplaceBrickPopupView method initEditors.
private void initEditors() {
showBricksListEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
serverEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<VDS>() {
@Override
public String renderNullSafe(VDS vds) {
return vds.getHostName();
}
});
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class AddBrickPopupView method initEditors.
private void initEditors() {
volumeTypeEditor = new EntityModelLabelEditor<>(new EnumRenderer<GlusterVolumeType>());
forceEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
showBricksListEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
serverEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<VDS>() {
@Override
public String renderNullSafe(VDS vds) {
return vds.getHostName();
}
});
}
Aggregations