@Mapping(from = FencingPolicy.class, to = org.ovirt.engine.core.common.businessentities.FencingPolicy.class) public static org.ovirt.engine.core.common.businessentities.FencingPolicy map(FencingPolicy model, org.ovirt.engine.core.common.businessentities.FencingPolicy template) { org.ovirt.engine.core.common.businessentities.FencingPolicy entity = template != null ? template : new org.ovirt.engine.core.common.businessentities.FencingPolicy(); if(model.isSetEnabled()) { entity.setFencingEnabled(model.isEnabled()); } if (model.isSetSkipIfSdActive()) { entity.setSkipFencingIfSDActive(model.getSkipIfSdActive().isEnabled()); } if (model.isSetSkipIfConnectivityBroken()) { entity.setSkipFencingIfConnectivityBroken(model.getSkipIfConnectivityBroken().isEnabled()); if (model.getSkipIfConnectivityBroken().getThreshold() != null) { entity.setHostsWithBrokenConnectivityThreshold(model.getSkipIfConnectivityBroken().getThreshold()); } else { entity.setHostsWithBrokenConnectivityThreshold(50); } } if (model.isSetSkipIfGlusterBricksUp()) { entity.setSkipFencingIfGlusterBricksUp(model.isSkipIfGlusterBricksUp()); } if (model.isSetSkipIfGlusterQuorumNotMet()) { entity.setSkipFencingIfGlusterQuorumNotMet(model.isSkipIfGlusterQuorumNotMet()); } return entity; }
cluster.getFencingPolicy().setFencingEnabled(model.getFencingEnabledModel().getEntity()); cluster.getFencingPolicy().setSkipFencingIfSDActive(model.getSkipFencingIfSDActiveEnabled().getEntity()); cluster.getFencingPolicy().setSkipFencingIfConnectivityBroken(model.getSkipFencingIfConnectivityBrokenEnabled().getEntity());