@Override public JpaRolloutGroup build() { final JpaRolloutGroup group = new JpaRolloutGroup(); group.setName(name); group.setDescription(description); group.setTargetFilterQuery(targetFilterQuery); if (targetPercentage == null) { targetPercentage = 100F; } group.setTargetPercentage(targetPercentage); if (conditions != null) { group.setSuccessCondition(conditions.getSuccessCondition()); group.setSuccessConditionExp(conditions.getSuccessConditionExp()); group.setSuccessAction(conditions.getSuccessAction()); group.setSuccessActionExp(conditions.getSuccessActionExp()); group.setErrorCondition(conditions.getErrorCondition()); group.setErrorConditionExp(conditions.getErrorConditionExp()); group.setErrorAction(conditions.getErrorAction()); group.setErrorActionExp(conditions.getErrorActionExp()); } return group; }
/** * Sets the error action and expression on the builder. * * @param action * the error action * @param expression * the error expression * @return the builder itself */ public RolloutGroupConditionBuilder errorAction(final RolloutGroupErrorAction action, final String expression) { conditions.setErrorAction(action); conditions.setErrorActionExp(expression); return this; }
/** * Verifies that the required success condition and action are actually set. * * @param conditions * input conditions and actions */ public static void verifyRolloutGroupConditions(final RolloutGroupConditions conditions) { if (conditions.getSuccessCondition() == null) { throw new ValidationException("Rollout group is missing success condition"); } if (conditions.getSuccessAction() == null) { throw new ValidationException("Rollout group is missing success action"); } }
private void resetFields() { rolloutName.removeStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR); noOfGroups.clear(); noOfGroups.removeStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR); triggerThreshold.setValue(defaultRolloutGroupConditions.getSuccessConditionExp()); triggerThreshold.removeStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR); errorThreshold.setValue(defaultRolloutGroupConditions.getErrorConditionExp()); errorThreshold.removeStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR); description.clear(); description.removeStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR); }
private TextField createTriggerThreshold() { final TextField thresholdField = createIntegerTextField("prompt.tigger.threshold", UIComponentIdProvider.ROLLOUT_TRIGGER_THRESOLD_ID); thresholdField.addValidator(new ThresholdFieldValidator()); thresholdField.setValue(defaultRolloutGroupConditions.getSuccessConditionExp()); return thresholdField; }
private TextField createErrorThreshold() { final TextField errorField = createIntegerTextField("prompt.error.threshold", UIComponentIdProvider.ROLLOUT_ERROR_THRESOLD_ID); errorField.addValidator(new ThresholdFieldValidator()); errorField.setMaxLength(7); errorField.setValue(defaultRolloutGroupConditions.getErrorConditionExp()); return errorField; }
private void resetFields() { rolloutName.removeStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR); noOfGroups.clear(); noOfGroups.removeStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR); triggerThreshold.setValue(defaultRolloutGroupConditions.getSuccessConditionExp()); triggerThreshold.removeStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR); errorThreshold.setValue(defaultRolloutGroupConditions.getErrorConditionExp()); errorThreshold.removeStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR); description.clear(); description.removeStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR); }
private TextField createTriggerThreshold() { final TextField thresholdField = createIntegerTextField("prompt.tigger.threshold", UIComponentIdProvider.ROLLOUT_TRIGGER_THRESOLD_ID); thresholdField.addValidator(new ThresholdFieldValidator()); thresholdField.setValue(defaultRolloutGroupConditions.getSuccessConditionExp()); return thresholdField; }
private TextField createErrorThreshold() { final TextField errorField = createIntegerTextField("prompt.error.threshold", UIComponentIdProvider.ROLLOUT_ERROR_THRESOLD_ID); errorField.addValidator(new ThresholdFieldValidator()); errorField.setMaxLength(7); errorField.setValue(defaultRolloutGroupConditions.getErrorConditionExp()); return errorField; }
@Override public JpaRolloutGroup build() { final JpaRolloutGroup group = new JpaRolloutGroup(); group.setName(name); group.setDescription(description); group.setTargetFilterQuery(targetFilterQuery); if (targetPercentage == null) { targetPercentage = 100F; } group.setTargetPercentage(targetPercentage); if (conditions != null) { group.setSuccessCondition(conditions.getSuccessCondition()); group.setSuccessConditionExp(conditions.getSuccessConditionExp()); group.setSuccessAction(conditions.getSuccessAction()); group.setSuccessActionExp(conditions.getSuccessActionExp()); group.setErrorCondition(conditions.getErrorCondition()); group.setErrorConditionExp(conditions.getErrorConditionExp()); group.setErrorAction(conditions.getErrorAction()); group.setErrorActionExp(conditions.getErrorActionExp()); } return group; }
@SuppressWarnings("squid:S00107") AddUpdateRolloutWindowLayout(final RolloutManagement rolloutManagement, final TargetManagement targetManagement, final UINotification uiNotification, final UiProperties uiProperties, final EntityFactory entityFactory, final VaadinMessageSource i18n, final UIEventBus eventBus, final TargetFilterQueryManagement targetFilterQueryManagement, final RolloutGroupManagement rolloutGroupManagement, final QuotaManagement quotaManagement) { actionTypeOptionGroupLayout = new ActionTypeOptionGroupLayout(i18n); autoStartOptionGroupLayout = new AutoStartOptionGroupLayout(i18n); this.rolloutManagement = rolloutManagement; this.rolloutGroupManagement = rolloutGroupManagement; this.quotaManagement = quotaManagement; this.targetManagement = targetManagement; this.uiNotification = uiNotification; this.uiProperties = uiProperties; this.entityFactory = entityFactory; this.i18n = i18n; this.eventBus = eventBus; this.targetFilterQueryManagement = targetFilterQueryManagement; defineGroupsLayout = new DefineGroupsLayout(i18n, entityFactory, rolloutManagement, targetFilterQueryManagement, rolloutGroupManagement, quotaManagement); defaultRolloutGroupConditions = new RolloutGroupConditionBuilder().withDefaults().build(); setSizeUndefined(); createRequiredComponents(); buildLayout(); defineGroupsLayout.setValidationListener(this::displayValidationStatus); defineGroupsLayout.setDefaultErrorThreshold(defaultRolloutGroupConditions.getErrorConditionExp()); defineGroupsLayout.setDefaultTriggerThreshold(defaultRolloutGroupConditions.getSuccessConditionExp()); }
group.setSuccessCondition(conditions.getSuccessCondition()); group.setSuccessConditionExp(conditions.getSuccessConditionExp()); group.setSuccessAction(conditions.getSuccessAction()); group.setSuccessActionExp(conditions.getSuccessActionExp()); group.setErrorCondition(conditions.getErrorCondition()); group.setErrorConditionExp(conditions.getErrorConditionExp()); group.setErrorAction(conditions.getErrorAction()); group.setErrorActionExp(conditions.getErrorActionExp());
@SuppressWarnings("squid:S00107") AddUpdateRolloutWindowLayout(final RolloutManagement rolloutManagement, final TargetManagement targetManagement, final UINotification uiNotification, final UiProperties uiProperties, final EntityFactory entityFactory, final VaadinMessageSource i18n, final UIEventBus eventBus, final TargetFilterQueryManagement targetFilterQueryManagement, final RolloutGroupManagement rolloutGroupManagement, final QuotaManagement quotaManagement) { actionTypeOptionGroupLayout = new ActionTypeOptionGroupLayout(i18n); autoStartOptionGroupLayout = new AutoStartOptionGroupLayout(i18n); this.rolloutManagement = rolloutManagement; this.rolloutGroupManagement = rolloutGroupManagement; this.quotaManagement = quotaManagement; this.targetManagement = targetManagement; this.uiNotification = uiNotification; this.uiProperties = uiProperties; this.entityFactory = entityFactory; this.i18n = i18n; this.eventBus = eventBus; this.targetFilterQueryManagement = targetFilterQueryManagement; defineGroupsLayout = new DefineGroupsLayout(i18n, entityFactory, rolloutManagement, targetFilterQueryManagement, rolloutGroupManagement, quotaManagement); defaultRolloutGroupConditions = new RolloutGroupConditionBuilder().withDefaults().build(); setSizeUndefined(); createRequiredComponents(); buildLayout(); defineGroupsLayout.setValidationListener(this::displayValidationStatus); defineGroupsLayout.setDefaultErrorThreshold(defaultRolloutGroupConditions.getErrorConditionExp()); defineGroupsLayout.setDefaultTriggerThreshold(defaultRolloutGroupConditions.getSuccessConditionExp()); }
group.setSuccessCondition(conditions.getSuccessCondition()); group.setSuccessConditionExp(conditions.getSuccessConditionExp()); group.setSuccessAction(conditions.getSuccessAction()); group.setSuccessActionExp(conditions.getSuccessActionExp()); group.setErrorCondition(conditions.getErrorCondition()); group.setErrorConditionExp(conditions.getErrorConditionExp()); group.setErrorAction(conditions.getErrorAction()); group.setErrorActionExp(conditions.getErrorActionExp());
group.setStatus(RolloutGroupStatus.CREATING); group.setSuccessCondition(conditions.getSuccessCondition()); group.setSuccessConditionExp(conditions.getSuccessConditionExp()); group.setSuccessAction(conditions.getSuccessAction()); group.setSuccessActionExp(conditions.getSuccessActionExp()); group.setErrorCondition(conditions.getErrorCondition()); group.setErrorConditionExp(conditions.getErrorConditionExp()); group.setErrorAction(conditions.getErrorAction()); group.setErrorActionExp(conditions.getErrorActionExp());
group.setStatus(RolloutGroupStatus.CREATING); group.setSuccessCondition(conditions.getSuccessCondition()); group.setSuccessConditionExp(conditions.getSuccessConditionExp()); group.setSuccessAction(conditions.getSuccessAction()); group.setSuccessActionExp(conditions.getSuccessActionExp()); group.setErrorCondition(conditions.getErrorCondition()); group.setErrorConditionExp(conditions.getErrorConditionExp()); group.setErrorAction(conditions.getErrorAction()); group.setErrorActionExp(conditions.getErrorActionExp());
successCondition.put("condition", conditions.getSuccessCondition().toString()); successCondition.put("expression", conditions.getSuccessConditionExp()); successAction.put("action", conditions.getSuccessAction().toString()); successAction.put("expression", conditions.getSuccessActionExp()); errorCondition.put("condition", conditions.getErrorCondition().toString()); errorCondition.put("expression", conditions.getErrorConditionExp()); errorAction.put("action", conditions.getErrorAction().toString()); errorAction.put("expression", conditions.getErrorActionExp());