@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; } }
private void updateFencingPolicyContent(Version ver) { // skipFencingIfConnectivityBroken option is enabled when fencing is enabled for all cluster versions getSkipFencingIfConnectivityBrokenEnabled().setIsChangeable(getFencingEnabledModel().getEntity()); getHostsWithBrokenConnectivityThreshold().setIsChangeable(getFencingEnabledModel().getEntity()); getSkipFencingIfGlusterBricksUp().setIsChangeable(getFencingEnabledModel().getEntity()); getSkipFencingIfGlusterQuorumNotMet().setIsChangeable(getFencingEnabledModel().getEntity()); if (ver == null) { if (!getFencingEnabledModel().getEntity()) { // fencing is disabled and cluster version not selected yet, so disable skipFencingIfSDActive getSkipFencingIfSDActiveEnabled().setIsChangeable(false); } } else { // skipFencingIfSDActive is enabled for supported cluster level if fencing is not disabled getSkipFencingIfSDActiveEnabled().setIsChangeable(getFencingEnabledModel().getEntity()); if (getEntity() == null) { // this can happen when creating new cluster and cluster dialog is shown getSkipFencingIfSDActiveEnabled().setEntity(true); } else { getSkipFencingIfSDActiveEnabled().setEntity( getEntity().getFencingPolicy().isSkipFencingIfSDActive()); } } }
getVncEncryptionEnabled().setEntity(getEntity().isVncEncryptionEnabled()); getFencingEnabledModel().setEntity(getEntity().getFencingPolicy().isFencingEnabled()); getSkipFencingIfSDActiveEnabled().setEntity(getEntity().getFencingPolicy().isSkipFencingIfSDActive()); getSkipFencingIfConnectivityBrokenEnabled().setEntity(getEntity().getFencingPolicy() .isSkipFencingIfConnectivityBroken());
.addValue("serial_number_policy", cluster.getSerialNumberPolicy() == null ? null : cluster.getSerialNumberPolicy().getValue()) .addValue("custom_serial_number", cluster.getCustomSerialNumber()) .addValue("skip_fencing_if_sd_active", cluster.getFencingPolicy().isSkipFencingIfSDActive()) .addValue("skip_fencing_if_connectivity_broken", cluster.getFencingPolicy().isSkipFencingIfConnectivityBroken()) .addValue("hosts_with_broken_connectivity_threshold", cluster.getFencingPolicy().getHostsWithBrokenConnectivityThreshold())