@Mapping(from = org.ovirt.engine.core.common.businessentities.FencingPolicy.class, to = FencingPolicy.class) public static FencingPolicy map(org.ovirt.engine.core.common.businessentities.FencingPolicy entity, FencingPolicy template) { FencingPolicy model = template != null ? template : new FencingPolicy(); SkipIfSdActive skipIfSdActive = new SkipIfSdActive(); SkipIfConnectivityBroken skipIfConnBroken = new SkipIfConnectivityBroken(); skipIfSdActive.setEnabled(entity.isSkipFencingIfSDActive()); skipIfConnBroken.setEnabled(entity.isSkipFencingIfConnectivityBroken()); skipIfConnBroken.setThreshold(entity.getHostsWithBrokenConnectivityThreshold()); model.setEnabled(entity.isFencingEnabled()); model.setSkipIfSdActive(skipIfSdActive); model.setSkipIfConnectivityBroken(skipIfConnBroken); model.setSkipIfGlusterBricksUp(entity.isSkipFencingIfGlusterBricksUp()); model.setSkipIfGlusterQuorumNotMet(entity.isSkipFencingIfGlusterQuorumNotMet()); return model; } }
protected void cluster_SelectedItemChanged() { Cluster cluster = getCluster().getSelectedItem(); if (cluster == null) { return; } getFencingEnabled().setEntity(cluster.getFencingPolicy().isFencingEnabled()); AsyncDataProvider.getInstance().getPmTypeList(new AsyncQuery<>(pmTypes -> updatePmTypeList(pmTypes)), cluster.getCompatibilityVersion()); //Match the appropriate selected data center to the selected cluster, don't fire update events. if (getDataCenter() != null && getDataCenter().getItems() != null) { for (StoragePool datacenter : getDataCenter().getItems()) { if (datacenter.getId().equals(cluster.getStoragePoolId())) { getDataCenter().setSelectedItem(datacenter, false); break; } } } final CpuVendor newCpuVendor = getCurrentCpuVendor(); if (newCpuVendor != null && !newCpuVendor.equals(lastNonNullCpuVendor)) { lastNonNullCpuVendor = newCpuVendor; cpuVendorChanged(); } getNetworkProviderModel().setDefaultProviderId(cluster.getDefaultNetworkProviderId()); setVgpuPlacementChangeability(cluster.getCompatibilityVersion()); }
getFencingEnabledModel().setEntity(getEntity().getFencingPolicy().isFencingEnabled()); getSkipFencingIfSDActiveEnabled().setEntity(getEntity().getFencingPolicy().isSkipFencingIfSDActive()); getSkipFencingIfConnectivityBrokenEnabled().setEntity(getEntity().getFencingPolicy()
.addValue("skip_fencing_if_connectivity_broken", cluster.getFencingPolicy().isSkipFencingIfConnectivityBroken()) .addValue("hosts_with_broken_connectivity_threshold", cluster.getFencingPolicy().getHostsWithBrokenConnectivityThreshold()) .addValue("fencing_enabled", cluster.getFencingPolicy().isFencingEnabled()) .addValue("is_auto_converge", cluster.getAutoConverge()) .addValue("is_migrate_compressed", cluster.getMigrateCompressed())