@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; } }
getSkipFencingIfSDActiveEnabled().setEntity(getEntity().getFencingPolicy().isSkipFencingIfSDActive()); getSkipFencingIfConnectivityBrokenEnabled().setEntity(getEntity().getFencingPolicy() .isSkipFencingIfConnectivityBroken()); getHostsWithBrokenConnectivityThreshold().setSelectedItem(getEntity().getFencingPolicy() .getHostsWithBrokenConnectivityThreshold());
.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()) .addValue("fencing_enabled", cluster.getFencingPolicy().isFencingEnabled())