use of org.ovirt.engine.core.common.businessentities.Cluster in project ovirt-engine by oVirt.
the class AsyncDataProvider method getClusterListByService.
public void getClusterListByService(AsyncQuery<List<Cluster>> aQuery, final boolean supportsVirtService, final boolean supportsGlusterService) {
aQuery.converterCallback = source -> {
if (source != null) {
ArrayList<Cluster> list = getClusterByServiceList((ArrayList<Cluster>) source, supportsVirtService, supportsGlusterService);
Collections.sort(list, new NameableComparator());
return list;
}
return new ArrayList<>();
};
Frontend.getInstance().runQuery(QueryType.GetAllClusters, new QueryParametersBase(), aQuery);
}
use of org.ovirt.engine.core.common.businessentities.Cluster in project ovirt-engine by oVirt.
the class AsyncDataProvider method getClusterByServiceList.
public void getClusterByServiceList(AsyncQuery<List<Cluster>> aQuery, Guid dataCenterId, final boolean supportsVirtService, final boolean supportsGlusterService) {
aQuery.converterCallback = source -> {
if (source == null) {
return new ArrayList<>();
}
final ArrayList<Cluster> list = (ArrayList<Cluster>) source;
return getClusterByServiceList(list, supportsVirtService, supportsGlusterService);
};
Frontend.getInstance().runQuery(QueryType.GetClustersByStoragePoolId, new IdQueryParameters(dataCenterId), aQuery);
}
use of org.ovirt.engine.core.common.businessentities.Cluster in project ovirt-engine by oVirt.
the class Cloner method cloneCluster.
private static Cluster cloneCluster(Cluster instance) {
Cluster obj = new Cluster();
obj.setId(instance.getId());
obj.setName(instance.getName());
obj.setDescription(instance.getDescription());
obj.setComment(instance.getComment());
obj.setCpuName(instance.getCpuName());
obj.setClusterCompatibilityLevelUpgradeNeeded(instance.isClusterCompatibilityLevelUpgradeNeeded());
obj.setCompatibilityVersion(instance.getCompatibilityVersion());
obj.setMigrateOnError(instance.getMigrateOnError());
obj.setTransparentHugepages(instance.getTransparentHugepages());
obj.setStoragePoolId(instance.getStoragePoolId());
obj.setMaxVdsMemoryOverCommit(instance.getMaxVdsMemoryOverCommit());
obj.setCountThreadsAsCores(instance.getCountThreadsAsCores());
obj.setEmulatedMachine(instance.getEmulatedMachine());
obj.setDetectEmulatedMachine(instance.isDetectEmulatedMachine());
obj.setArchitecture(instance.getArchitecture());
obj.setSerialNumberPolicy(instance.getSerialNumberPolicy());
obj.setCustomSerialNumber(instance.getCustomSerialNumber());
obj.setFencingPolicy(new FencingPolicy(instance.getFencingPolicy()));
obj.setAutoConverge(instance.getAutoConverge());
obj.setMigrateCompressed(instance.getMigrateCompressed());
return obj;
}
use of org.ovirt.engine.core.common.businessentities.Cluster in project ovirt-engine by oVirt.
the class HostModel method getCurrentCpuVendor.
/**
* @return it may return `null`
*/
private CpuVendor getCurrentCpuVendor() {
if (getCluster().getSelectedItem() == null) {
return null;
}
final Cluster selectedCluster = getCluster().getSelectedItem();
final ServerCpu clustersCpu = AsyncDataProvider.getInstance().getCpuByName(selectedCluster.getCpuName(), selectedCluster.getCompatibilityVersion());
if (clustersCpu == null) {
// in case CPU of cluster was not yet set
return null;
}
return clustersCpu.getVendor();
}
use of org.ovirt.engine.core.common.businessentities.Cluster in project ovirt-engine by oVirt.
the class HostListModel method remove.
public void remove() {
if (getWindow() != null) {
return;
}
final ConfirmationModel model = new ConfirmationModel();
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().removeHostsTitle());
model.setHelpTag(HelpTag.remove_host);
// $NON-NLS-1$
model.setHashName("remove_host");
Set<Guid> clusters = new HashSet<>();
ArrayList<String> list = new ArrayList<>();
boolean heOnHosts = false;
for (VDS item : getSelectedItems()) {
clusters.add(item.getClusterId());
String name = item.getName();
if (item.isHostedEngineDeployed()) {
// $NON-NLS-1$
name = name + " *";
heOnHosts = true;
}
list.add(name);
}
model.setItems(list);
if (heOnHosts) {
model.setNote(ConstantsManager.getInstance().getConstants().heHostRemovalWarning());
}
// - the cluster should have gluster service enabled
if (clusters.size() == 1) {
model.startProgress();
AsyncDataProvider.getInstance().getClusterById(new AsyncQuery<>(cluster -> {
if (cluster != null && cluster.supportsGlusterService()) {
model.getForce().setIsAvailable(true);
}
model.stopProgress();
}), clusters.iterator().next());
}
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnRemove", this);
model.getCommands().add(tempVar);
// $NON-NLS-1$
UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
model.getCommands().add(tempVar2);
}
Aggregations