diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/BeanStep.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/BeanStep.java index 5180fc97a..642f71b42 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/BeanStep.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/BeanStep.java @@ -1,7 +1,8 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; +import io.kaoto.backend.camel.KamelHelper; import io.kaoto.backend.model.parameter.Parameter; import io.kaoto.backend.model.step.Step; @@ -14,36 +15,27 @@ public class BeanStep extends EIPStep { public static final String BEAN_TYPE_LABEL = "beanType"; public static final String BEAN_TYPE_LABEL2 = "bean-type"; public static final String SCOPE_LABEL = "scope"; - public static final String DESCRIPTION_LABEL = "description"; public static final String ID_LABEL = "id"; + @JsonProperty(REF_LABEL) private String ref; + @JsonProperty(METHOD_LABEL) private String method; + @JsonProperty(BEAN_TYPE_LABEL) + @JsonAlias(BEAN_TYPE_LABEL2) private String beanType; + + @JsonProperty(SCOPE_LABEL) private String scope; + + @JsonProperty(KamelHelper.DESCRIPTION) private String description; public BeanStep() { } - @JsonCreator - public BeanStep(final @JsonProperty(REF_LABEL) String ref, - final @JsonProperty(METHOD_LABEL) String method, - final @JsonProperty(BEAN_TYPE_LABEL) String beanType, - final @JsonProperty(BEAN_TYPE_LABEL2) String beanType2, - final @JsonProperty(SCOPE_LABEL) String scope, - final @JsonProperty(DESCRIPTION_LABEL) String description, - final @JsonProperty(ID_LABEL) String id) { - setRef(ref); - setMethod(method); - setDescription(description); - setBeanType(beanType != null ? beanType : beanType2); - setScope(scope); - setId(id); - } - public BeanStep(Step step) { super(step); } @@ -59,8 +51,8 @@ public BeanStep(Map map) { if (map.containsKey(SCOPE_LABEL)) { this.setScope(String.valueOf(map.get(SCOPE_LABEL))); } - if (map.containsKey(DESCRIPTION_LABEL)) { - this.setDescription(String.valueOf(map.get(DESCRIPTION_LABEL))); + if (map.containsKey(KamelHelper.DESCRIPTION)) { + this.setDescription(String.valueOf(map.get(KamelHelper.DESCRIPTION))); } if (map.containsKey(ID_LABEL)) { this.setId(String.valueOf(map.get(ID_LABEL))); @@ -89,7 +81,7 @@ public Map getRepresenterProperties() { properties.put(BEAN_TYPE_LABEL, this.getBeanType()); } if (this.getDescription() != null) { - properties.put(DESCRIPTION_LABEL, this.getDescription()); + properties.put(KamelHelper.DESCRIPTION, this.getDescription()); } return properties; } @@ -111,7 +103,7 @@ protected void assignAttribute(final Parameter parameter) { case BEAN_TYPE_LABEL2: this.setBeanType(parameter.getValue().toString()); break; - case DESCRIPTION_LABEL: + case KamelHelper.DESCRIPTION: this.setDescription(parameter.getValue().toString()); break; case ID_LABEL: @@ -140,7 +132,7 @@ protected void assignProperty(final Parameter parameter) { case ID_LABEL: parameter.setValue(this.getId()); break; - case DESCRIPTION_LABEL: + case KamelHelper.DESCRIPTION: parameter.setValue(this.getDescription()); break; default: diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/CircuitBreaker.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/CircuitBreaker.java index 8365ed5a6..fc6fe0cdd 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/CircuitBreaker.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/CircuitBreaker.java @@ -5,7 +5,7 @@ import java.util.List; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; import io.kaoto.backend.api.metadata.catalog.StepCatalog; @@ -20,6 +20,7 @@ public class CircuitBreaker extends EIPStep { public static final String STEPS_LABEL = KamelHelper.STEPS; public static final String ON_FALLBACK_LABEL = "on-fallback"; + public static final String ON_FALLBACK_LABEL2 = "onFallback"; public static final String RESILIENCE_4_J_CONFIGURATION_LABEL = "resilience-4j-configuration"; public static final String FAULT_TOLERANCE_CONFIGURATION_LABEL = "fault-tolerance-configuration"; public static final String CONFIGURATION_LABEL = "configuration"; @@ -31,12 +32,15 @@ public class CircuitBreaker extends EIPStep { private List steps; @JsonProperty(ON_FALLBACK_LABEL) + @JsonAlias(ON_FALLBACK_LABEL2) private GenericFlowWithSteps onFallback; @JsonProperty(RESILIENCE_4_J_CONFIGURATION_LABEL) + @JsonAlias(RESILIENCE_4_J_CONFIGURATION_LABEL2) private Map resilience4jConfiguration; @JsonProperty(FAULT_TOLERANCE_CONFIGURATION_LABEL) + @JsonAlias(FAULT_TOLERANCE_CONFIGURATION_LABEL2) private Map faultToleranceConfiguration; @JsonProperty(CONFIGURATION_LABEL) @@ -49,24 +53,6 @@ public CircuitBreaker() { super(); } - @JsonCreator - public CircuitBreaker( - final @JsonProperty(STEPS_LABEL) List steps, - final @JsonProperty(ON_FALLBACK_LABEL) GenericFlowWithSteps onFallback, - final @JsonProperty(RESILIENCE_4_J_CONFIGURATION_LABEL) Map resilience4jConfiguration, - final @JsonProperty(FAULT_TOLERANCE_CONFIGURATION_LABEL) Map faultToleranceConfiguration, - final @JsonProperty(CONFIGURATION_LABEL) String configuration, - final @JsonProperty(DESCRIPTION_LABEL) Map description, - final @JsonProperty("id") String id) { - super(); - setSteps(steps); - setOnFallback(onFallback); - setResilience4jConfiguration(resilience4jConfiguration); - setFaultToleranceConfiguration(faultToleranceConfiguration); - setConfiguration(configuration); - setDescription(description); - setId(id); - } public CircuitBreaker(final Step step, final KamelPopulator kameletPopulator) { super(step); diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/ClaimCheck.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/ClaimCheck.java index a50fde3a8..d50879603 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/ClaimCheck.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/ClaimCheck.java @@ -1,6 +1,8 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; +import io.kaoto.backend.camel.KamelHelper; import io.kaoto.backend.model.parameter.Parameter; import io.kaoto.backend.model.step.Step; @@ -9,7 +11,7 @@ public class ClaimCheck extends EIPStep { - public static final String DESCRIPTION_LABEL = "description"; + public static final String DESCRIPTION_LABEL = KamelHelper.DESCRIPTION; public static final String OPERATION_LABEL = "operation"; public static final String KEY_LABEL = "key"; public static final String FILTER_LABEL = "filter"; @@ -28,9 +30,11 @@ public class ClaimCheck extends EIPStep { private String filter; @JsonProperty(AGGREGATION_STRATEGY_LABEL) + @JsonAlias(AGGREGATION_STRATEGY_LABEL2) private String aggregationStrategy; @JsonProperty(AGGREGATION_STRATEGY_METHOD_NAME_LABEL) + @JsonAlias(AGGREGATION_STRATEGY_METHOD_NAME_LABEL2) private String aggregationStrategyMethodName; @JsonProperty(DESCRIPTION_LABEL) diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/ConvertBodyTo.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/ConvertBodyTo.java index 02c931859..617a04cab 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/ConvertBodyTo.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/ConvertBodyTo.java @@ -1,6 +1,7 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; import com.fasterxml.jackson.annotation.JsonProperty; +import io.kaoto.backend.camel.KamelHelper; import io.kaoto.backend.model.parameter.Parameter; import io.kaoto.backend.model.step.Step; @@ -12,7 +13,7 @@ public class ConvertBodyTo extends EIPStep { public static final String TYPE_LABEL = "type"; public static final String MANDATORY_LABEL = "mandatory"; public static final String CHARSET_LABEL = "charset"; - public static final String DESCRIPTION_LABEL = "description"; + public static final String DESCRIPTION_LABEL = KamelHelper.DESCRIPTION; @JsonProperty(TYPE_LABEL) private String type; diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Delay.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Delay.java index ed3d7b58e..885aea7c3 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Delay.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Delay.java @@ -1,6 +1,8 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; +import io.kaoto.backend.camel.KamelHelper; import io.kaoto.backend.camel.model.deployment.kamelet.expression.Expression; import io.kaoto.backend.model.parameter.Parameter; import io.kaoto.backend.model.step.Step; @@ -16,18 +18,21 @@ public class Delay extends EIPStep { public static final String CALLER_RUNS_WHEN_REJECTED_LABEL2 = "caller-runs-when-rejected"; public static final String EXECUTOR_SERVICE_LABEL = "executorService"; public static final String EXECUTOR_SERVICE_LABEL2 = "executor-service"; - public static final String DESCRIPTION_LABEL = "description"; + public static final String DESCRIPTION_LABEL = KamelHelper.DESCRIPTION; @JsonProperty(EXPRESSION_LABEL) private Expression expression; @JsonProperty(ASYNC_DELAYED_LABEL2) + @JsonAlias(ASYNC_DELAYED_LABEL2) private Boolean asyncDelayed; @JsonProperty(CALLER_RUNS_WHEN_REJECTED_LABEL2) + @JsonAlias(CALLER_RUNS_WHEN_REJECTED_LABEL) private Boolean callerRunsWhenRejected; @JsonProperty(EXECUTOR_SERVICE_LABEL2) + @JsonAlias(EXECUTOR_SERVICE_LABEL) private Map executorService; @JsonProperty(DESCRIPTION_LABEL) diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/EnrichFlowStep.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/EnrichFlowStep.java index c3a55e0cc..39126464d 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/EnrichFlowStep.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/EnrichFlowStep.java @@ -1,6 +1,5 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; -import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonDeserializer; @@ -20,10 +19,8 @@ public class EnrichFlowStep implements FlowStep { public static final String LABEL = "enrich"; - @JsonCreator - public EnrichFlowStep(final @JsonProperty(LABEL) Enrich enrich) { - setEnrich(enrich); - } + @JsonProperty(LABEL) + private Enrich enrich; public EnrichFlowStep() { //Needed for serialization @@ -33,8 +30,6 @@ public EnrichFlowStep(Step step) { setEnrich(new Enrich(step)); } - private Enrich enrich; - @Override public Map getRepresenterProperties() { Map properties = new HashMap<>(); diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/LogStep.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/LogStep.java index 9fb460fc5..03d6e4933 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/LogStep.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/LogStep.java @@ -1,7 +1,8 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; +import io.kaoto.backend.camel.KamelHelper; import io.kaoto.backend.model.parameter.Parameter; import io.kaoto.backend.model.step.Step; @@ -12,43 +13,34 @@ public class LogStep extends EIPStep { public static final String MESSAGE = "message"; public static final String MARKER = "marker"; public static final String LOGGER = "logger"; - public static final String DESCRIPTION = "description"; public static final String LOGGING_LEVEL = "logging-level"; public static final String LOG_NAME = "log-name"; public static final String LOGGING_LEVEL1 = "loggingLevel"; public static final String LOG_NAME1 = "logName"; + @JsonProperty(MESSAGE) private String message; + @JsonProperty(LOGGING_LEVEL) + @JsonAlias(LOGGING_LEVEL1) private String loggingLevel; + @JsonProperty(LOG_NAME) + @JsonAlias(LOG_NAME1) private String logName; + + @JsonProperty(MARKER) private String marker; + + @JsonProperty(LOGGER) private String logger; + + @JsonProperty(KamelHelper.DESCRIPTION) private String description; public LogStep() { } - @JsonCreator - public LogStep(final @JsonProperty(MESSAGE) String message, - final @JsonProperty(MARKER) String marker, - final @JsonProperty(LOGGER) String logger, - final @JsonProperty(DESCRIPTION) String description, - final @JsonProperty(LOGGING_LEVEL) String loggingLevel, - final @JsonProperty(LOG_NAME) String logName, - final @JsonProperty(LOGGING_LEVEL1) String loggingLevel2, - final @JsonProperty(LOG_NAME1) String logName2, - final @JsonProperty("id") String id) { - setMessage(message); - setMarker(marker); - setLogger(logger); - setDescription(description); - setLoggingLevel(loggingLevel != null ? loggingLevel : loggingLevel2); - setLogName(logName != null ? logName : logName2); - setId(id); - } - public LogStep(Step step) { super(step); } @@ -64,8 +56,8 @@ public LogStep(Map map) { if (map.containsKey(LOGGER)) { this.setLogger(String.valueOf(map.get(LOGGER))); } - if (map.containsKey(DESCRIPTION)) { - this.setDescription(String.valueOf(map.get(DESCRIPTION))); + if (map.containsKey(KamelHelper.DESCRIPTION)) { + this.setDescription(String.valueOf(map.get(KamelHelper.DESCRIPTION))); } if (map.containsKey(LOGGING_LEVEL)) { this.setLoggingLevel(String.valueOf(map.get(LOGGING_LEVEL))); @@ -98,7 +90,7 @@ public Map getRepresenterProperties() { properties.put(LOGGER, this.getLogger()); } if (this.description != null) { - properties.put(DESCRIPTION, this.getDescription()); + properties.put(KamelHelper.DESCRIPTION, this.getDescription()); } return properties; } @@ -124,7 +116,7 @@ protected void assignAttribute(final Parameter parameter) { case LOGGER: this.setLogger(parameter.getValue().toString()); break; - case DESCRIPTION: + case KamelHelper.DESCRIPTION: this.setDescription(parameter.getValue().toString()); break; default: @@ -153,7 +145,7 @@ protected void assignProperty(final Parameter parameter) { case LOGGER: parameter.setValue(this.getLogger()); break; - case DESCRIPTION: + case KamelHelper.DESCRIPTION: parameter.setValue(this.getDescription()); break; default: diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Multicast.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Multicast.java index d83813ffe..9d17ac489 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Multicast.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Multicast.java @@ -1,6 +1,6 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; import io.kaoto.backend.camel.KamelHelper; import io.kaoto.backend.camel.KamelPopulator; @@ -52,78 +52,54 @@ public class Multicast extends EIPStep { public static final String SHARE_UNIT_OF_WORK_LABEL = "shareUnitOfWork"; public static final String SHARE_UNIT_OF_WORK_LABEL2 = "share-init-of-work"; + @JsonProperty(AGGREGATION_STRATEGY_LABEL) + @JsonAlias(AGGREGATION_STRATEGY_LABEL2) private Map aggregationStrategy; + @JsonProperty(AGGREGATION_STRATEGY_METHOD_NAME_LABEL) + @JsonAlias(AGGREGATION_STRATEGY_METHOD_NAME_LABEL2) private String aggregationStrategyMethodName; + @JsonProperty(AGGREGATION_STRATEGY_METHOD_ALLOW_NULL_LABEL) + @JsonAlias(AGGREGATION_STRATEGY_METHOD_ALLOW_NULL_LABEL2) private Boolean aggregationStrategyMethodAllowNull; + @JsonProperty(PARALLEL_AGGREGATE_LABEL) + @JsonAlias(PARALLEL_AGGREGATE_LABEL2) private Boolean parallelAggregate; + @JsonProperty(PARALLEL_PROCESSING_LABEL) + @JsonAlias(PARALLEL_PROCESSING_LABEL2) private Boolean parallelProcessing; + @JsonProperty(STREAMING_LABEL) private Boolean streaming; + @JsonProperty(STOP_ON_EXCEPTION_LABEL) + @JsonAlias(STOP_ON_EXCEPTION_LABEL2) private Boolean stopOnException; + @JsonProperty(TIMEOUT_LABEL) private String timeout; + @JsonProperty(EXECUTOR_SERVICE_LABEL) + @JsonAlias(EXECUTOR_SERVICE_LABEL2) private Map executorService; + @JsonProperty(ON_PREPARE_LABEL) + @JsonAlias(ON_PREPARE_LABEL2) private Map onPrepare; + @JsonProperty(SHARE_UNIT_OF_WORK_LABEL) + @JsonAlias(SHARE_UNIT_OF_WORK_LABEL2) private Boolean shareUnitOfWork; + @JsonProperty(DESCRIPTION_LABEL) private Map description; + @JsonProperty(STEPS_LABEL) private List steps; - - @JsonCreator - public Multicast(final @JsonProperty(DESCRIPTION_LABEL) Map description, - final @JsonProperty(STEPS_LABEL) List steps, - final @JsonProperty(AGGREGATION_STRATEGY_LABEL) Map aggregationStrategy, - final @JsonProperty(AGGREGATION_STRATEGY_LABEL2) Map aggregationStrategy2, - final @JsonProperty(AGGREGATION_STRATEGY_METHOD_NAME_LABEL) String aggregationStrategyMethodName, - final @JsonProperty(AGGREGATION_STRATEGY_METHOD_NAME_LABEL2) String aggregationStrategyMethodName2, - final @JsonProperty(AGGREGATION_STRATEGY_METHOD_ALLOW_NULL_LABEL) - Boolean aggregationStrategyMethodAllowNull, - final @JsonProperty(AGGREGATION_STRATEGY_METHOD_ALLOW_NULL_LABEL2) - Boolean aggregationStrategyMethodAllowNull2, - final @JsonProperty(PARALLEL_AGGREGATE_LABEL) Boolean parallelAggregate, - final @JsonProperty(PARALLEL_AGGREGATE_LABEL2) Boolean parallelAggregate2, - final @JsonProperty(PARALLEL_PROCESSING_LABEL) Boolean parallelProcessing, - final @JsonProperty(PARALLEL_PROCESSING_LABEL2) Boolean parallelProcessing2, - final @JsonProperty(STREAMING_LABEL) Boolean streaming, - final @JsonProperty(STOP_ON_EXCEPTION_LABEL2) Boolean stopOnException, - final @JsonProperty(STOP_ON_EXCEPTION_LABEL) Boolean stopOnException2, - final @JsonProperty(TIMEOUT_LABEL) String timeout, - final @JsonProperty(EXECUTOR_SERVICE_LABEL) Map executorService, - final @JsonProperty(EXECUTOR_SERVICE_LABEL2) Map executorService2, - final @JsonProperty(ON_PREPARE_LABEL) Map onPrepare, - final @JsonProperty(ON_PREPARE_LABEL2) Map onPrepare2, - final @JsonProperty(SHARE_UNIT_OF_WORK_LABEL) Boolean shareUnitOfWork, - final @JsonProperty(SHARE_UNIT_OF_WORK_LABEL2) Boolean shareUnitOfWork2, - final @JsonProperty("id") String id) { - super(); - setDescription(description); - setSteps(steps); - setAggregationStrategy(aggregationStrategy != null ? aggregationStrategy : aggregationStrategy2); - setAggregationStrategyMethodName(aggregationStrategyMethodName != null ? aggregationStrategyMethodName : - aggregationStrategyMethodName2); - setAggregationStrategyMethodAllowNull(aggregationStrategyMethodAllowNull != null ? - aggregationStrategyMethodAllowNull : aggregationStrategyMethodAllowNull2); - setParallelAggregate(parallelAggregate != null ? parallelAggregate : parallelAggregate2); - setParallelProcessing(parallelProcessing != null ? parallelProcessing : parallelProcessing2); - setStreaming(streaming); - setStopOnException(stopOnException != null ? stopOnException : stopOnException2); - setTimeout(timeout); - setExecutorService(executorService != null ? executorService : executorService2); - setOnPrepare(onPrepare != null ? onPrepare : onPrepare2); - setShareUnitOfWork(shareUnitOfWork != null ? shareUnitOfWork : shareUnitOfWork2); - setId(id); - } - public Multicast() { //Needed for serialization } diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/RemoveHeaders.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/RemoveHeaders.java index d97c4c84f..90313d850 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/RemoveHeaders.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/RemoveHeaders.java @@ -1,6 +1,8 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; +import io.kaoto.backend.camel.KamelHelper; import io.kaoto.backend.model.parameter.Parameter; import io.kaoto.backend.model.step.Step; @@ -14,12 +16,14 @@ public class RemoveHeaders extends EIPStep { public static final String EXCLUDE_PATTERN_LABEL = "exclude-pattern"; public static final String EXCLUDE_PATTERN_LABEL2 = "excludePattern"; - public static final String DESCRIPTION_LABEL = "description"; - + @JsonProperty(PATTERN_LABEL) private String pattern; + @JsonProperty(EXCLUDE_PATTERN_LABEL) + @JsonAlias(EXCLUDE_PATTERN_LABEL2) private String excludePattern; + @JsonProperty(KamelHelper.DESCRIPTION) private Map description; @@ -27,16 +31,6 @@ public RemoveHeaders() { //Needed for serialization } - public RemoveHeaders(final @JsonProperty(PATTERN_LABEL) String pattern, - final @JsonProperty(EXCLUDE_PATTERN_LABEL) String excludePattern, - final @JsonProperty(EXCLUDE_PATTERN_LABEL2) String excludePattern2, - final @JsonProperty(DESCRIPTION_LABEL) Map description, - final @JsonProperty("id") String id) { - setPattern(pattern); - setExcludePattern(excludePattern != null ? excludePattern : excludePattern2); - setDescription(description); - setId(id); - } public RemoveHeaders(Step step) { super(step); @@ -54,7 +48,7 @@ public Map getRepresenterProperties() { } if (this.description != null) { - properties.put(DESCRIPTION_LABEL, this.description); + properties.put(KamelHelper.DESCRIPTION, this.description); } return properties; } @@ -69,7 +63,7 @@ protected void assignProperty(final Parameter parameter) { case EXCLUDE_PATTERN_LABEL2: parameter.setValue(this.getExcludePattern()); break; - case DESCRIPTION_LABEL: + case KamelHelper.DESCRIPTION: parameter.setValue(this.getDescription()); break; default: @@ -88,7 +82,7 @@ protected void assignAttribute(final Parameter parameter) { case EXCLUDE_PATTERN_LABEL2: this.setExcludePattern(String.valueOf(parameter.getValue())); break; - case DESCRIPTION_LABEL: + case KamelHelper.DESCRIPTION: this.setDescription((Map) parameter.getValue()); break; default: diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Rollback.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Rollback.java index b6c9c0e13..f8ece48f0 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Rollback.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Rollback.java @@ -1,5 +1,6 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; import io.kaoto.backend.model.parameter.Parameter; import io.kaoto.backend.model.step.Step; @@ -17,10 +18,15 @@ public class Rollback extends EIPStep { public static final String MESSAGE_LABEL = "message"; + @JsonProperty(MARK_ROLLBACK_ONLY_LABEL) + @JsonAlias(MARK_ROLLBACK_ONLY_LABEL2) private Boolean markRollbackOnly; + @JsonProperty(MARK_ROLLBACK_ONLY_LAST_LABEL) + @JsonAlias(MARK_ROLLBACK_ONLY_LAST_LABEL2) private Boolean markRollbackOnlyLast; + @JsonProperty(MESSAGE_LABEL) private String message; @@ -28,17 +34,6 @@ public Rollback() { //Needed for serialization } - public Rollback(final @JsonProperty(MARK_ROLLBACK_ONLY_LABEL) Boolean markRollbackOnly, - final @JsonProperty(MARK_ROLLBACK_ONLY_LABEL2) Boolean markRollbackOnly2, - final @JsonProperty(MARK_ROLLBACK_ONLY_LAST_LABEL) Boolean markRollbackOnlyLast, - final @JsonProperty(MARK_ROLLBACK_ONLY_LAST_LABEL2) Boolean markRollbackOnlyLast2, - final @JsonProperty(MESSAGE_LABEL) String message, - final @JsonProperty("id") String id) { - setMarkRollbackOnly(markRollbackOnly != null ? markRollbackOnly : markRollbackOnly2); - setMarkRollbackOnlyLast(markRollbackOnlyLast != null ? markRollbackOnlyLast : markRollbackOnlyLast2); - setMessage(message); - setId(id); - } public Rollback(Step step) { super(step); } diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Saga.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Saga.java index 0b1068c94..f8f18d38d 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Saga.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Saga.java @@ -1,5 +1,6 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; import io.kaoto.backend.camel.KamelHelper; import io.kaoto.backend.camel.KamelPopulator; @@ -34,22 +35,33 @@ public class Saga extends EIPStep { public static final String DESCRIPTION_LABEL = KamelHelper.DESCRIPTION; + @JsonProperty(STEPS_LABEL) private List steps; + @JsonProperty(SAGA_SERVICE_LABEL) + @JsonAlias(SAGA_SERVICE_LABEL2) private Map sagaService; + @JsonProperty(PROPAGATION_LABEL) private String propagation; + @JsonProperty(COMPLETION_MODE_LABEL) + @JsonAlias(COMPLETION_MODE_LABEL2) private String completionMode; + @JsonProperty(TIMEOUT_LABEL) private String timeout; + @JsonProperty(COMPENSATION_LABEL) private Object compensation; + @JsonProperty(COMPLETION_LABEL) private Object completion; + @JsonProperty(OPTION_LABEL) private Object option; + @JsonProperty(DESCRIPTION_LABEL) private Map description; @@ -57,28 +69,6 @@ public Saga() { //Needed for serialization } - public Saga(final @JsonProperty(SAGA_SERVICE_LABEL) Map sagaService, - final @JsonProperty(SAGA_SERVICE_LABEL2) Map sagaService2, - final @JsonProperty(PROPAGATION_LABEL) String propagation, - final @JsonProperty(COMPLETION_MODE_LABEL) String completionMode, - final @JsonProperty(COMPLETION_MODE_LABEL2) String completionMode2, - final @JsonProperty(TIMEOUT_LABEL) String timeout, - final @JsonProperty(COMPENSATION_LABEL) Object compensation, - final @JsonProperty(COMPLETION_LABEL) Object completion, - final @JsonProperty(OPTION_LABEL) Object option, - final @JsonProperty(DESCRIPTION_LABEL) Map description, - final @JsonProperty("id") String id) { - setSagaService(sagaService != null ? sagaService : sagaService2); - setPropagation(propagation); - setCompletionMode(completionMode != null ? completionMode : completionMode2); - setTimeout(timeout); - setCompensation(compensation); - setCompletion(completion); - setOption(option); - setDescription(description); - setId(id); - } - public Saga(Step step, final KamelPopulator kameletPopulator) { super(step); diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Sample.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Sample.java index 6e8eec32d..2420b525f 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Sample.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Sample.java @@ -1,6 +1,8 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; +import io.kaoto.backend.camel.KamelHelper; import io.kaoto.backend.model.parameter.Parameter; import io.kaoto.backend.model.step.Step; @@ -15,12 +17,17 @@ public class Sample extends EIPStep { public static final String MESSAGE_FREQUENCY_LABEL = "message-frequency"; public static final String MESSAGE_FREQUENCY_LABEL2 = "messageFrequency"; - public static final String DESCRIPTION_LABEL = "description"; + public static final String DESCRIPTION_LABEL = KamelHelper.DESCRIPTION; + @JsonProperty(SAMPLE_PERIOD_LABEL) + @JsonAlias(SAMPLE_PERIOD_LABEL2) private String samplePeriod; + @JsonProperty(MESSAGE_FREQUENCY_LABEL) + @JsonAlias(MESSAGE_FREQUENCY_LABEL2) private Long messageFrequency; + @JsonProperty(DESCRIPTION_LABEL) private Map description; @@ -28,18 +35,6 @@ public Sample() { //Needed for serialization } - public Sample(final @JsonProperty(SAMPLE_PERIOD_LABEL) String samplePeriod, - final @JsonProperty(SAMPLE_PERIOD_LABEL2) String samplePeriod2, - final @JsonProperty(MESSAGE_FREQUENCY_LABEL) Long messageFrequency, - final @JsonProperty(MESSAGE_FREQUENCY_LABEL2) Long messageFrequency2, - final @JsonProperty(DESCRIPTION_LABEL) Map description, - final @JsonProperty("id") String id) { - setDescription(description); - setSamplePeriod(samplePeriod != null ? samplePeriod : samplePeriod2); - setMessageFrequency(messageFrequency != null ? messageFrequency : messageFrequency2); - setId(id); - } - public Sample(Step step) { super(step); } diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Threads.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Threads.java index d42021d75..440c5db63 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Threads.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Threads.java @@ -1,7 +1,8 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; +import io.kaoto.backend.camel.KamelHelper; import io.kaoto.backend.model.parameter.Parameter; import io.kaoto.backend.model.step.Step; @@ -10,9 +11,6 @@ public class Threads extends EIPStep { - - public static final String DESCRIPTION_LABEL = "description"; - public static final String EXECUTOR_SERVICE_LABEL = "executorService"; public static final String EXECUTOR_SERVICE_LABEL2 = "executor-service"; @@ -44,26 +42,47 @@ public class Threads extends EIPStep { public static final String CALLER_RUNS_WHEN_REJECTED_LABEL2 = "caller-runs-when-rejected"; + @JsonProperty(KamelHelper.DESCRIPTION) private Map description; + @JsonProperty(EXECUTOR_SERVICE_LABEL) + @JsonAlias(EXECUTOR_SERVICE_LABEL2) private Map executorService; + @JsonProperty(POOL_SIZE_LABEL) + @JsonAlias(POOL_SIZE_LABEL2) private Integer poolSize; + @JsonProperty(MAX_POOL_SIZE_LABEL) + @JsonAlias(MAX_POOL_SIZE_LABEL2) private Integer maxPoolSize; + @JsonProperty(KEEP_ALIVE_TIME_LABEL) + @JsonAlias(KEEP_ALIVE_TIME_LABEL2) private Long keepAliveTime; + @JsonProperty(TIME_UNIT_LABEL) + @JsonAlias(TIME_UNIT_LABEL2) private String timeUnit; + @JsonProperty(MAX_QUEUE_SIZE_LABEL) + @JsonAlias(MAX_QUEUE_SIZE_LABEL2) private Integer maxQueueSize; + @JsonProperty(ALLOW_CORE_THREAD_TIME_OUT_LABEL) + @JsonAlias(ALLOW_CORE_THREAD_TIME_OUT_LABEL2) private Boolean allowCoreThreadTimeOut; + @JsonProperty(THREAD_NAME_LABEL) + @JsonAlias(THREAD_NAME_LABEL2) private String threadName; + @JsonProperty(REJECTED_POLICY_LABEL) + @JsonAlias(REJECTED_POLICY_LABEL2) private String rejectedPolicy; + @JsonProperty(CALLER_RUNS_WHEN_REJECTED_LABEL) + @JsonAlias(CALLER_RUNS_WHEN_REJECTED_LABEL2) private String callerRunsWhenRejected; @@ -71,43 +90,6 @@ public Threads() { //Needed for serialization } - @JsonCreator - public Threads(final @JsonProperty(DESCRIPTION_LABEL) Map description, - final @JsonProperty(EXECUTOR_SERVICE_LABEL) Map executorService, - final @JsonProperty(EXECUTOR_SERVICE_LABEL2) Map executorService2, - final @JsonProperty(POOL_SIZE_LABEL) Integer poolSize, - final @JsonProperty(POOL_SIZE_LABEL2) Integer poolSize2, - final @JsonProperty(MAX_POOL_SIZE_LABEL) Integer maxPoolSize, - final @JsonProperty(MAX_POOL_SIZE_LABEL2) Integer maxPoolSize2, - final @JsonProperty(KEEP_ALIVE_TIME_LABEL) Long keepAliveTime, - final @JsonProperty(KEEP_ALIVE_TIME_LABEL2) Long keepAliveTime2, - final @JsonProperty(TIME_UNIT_LABEL) String timeUnit, - final @JsonProperty(TIME_UNIT_LABEL2) String timeUnit2, - final @JsonProperty(MAX_QUEUE_SIZE_LABEL) Integer maxQueueSize, - final @JsonProperty(MAX_QUEUE_SIZE_LABEL2) Integer maxQueueSize2, - final @JsonProperty(ALLOW_CORE_THREAD_TIME_OUT_LABEL) Boolean allowCoreThreadTimeOut, - final @JsonProperty(ALLOW_CORE_THREAD_TIME_OUT_LABEL2) Boolean allowCoreThreadTimeOut2, - final @JsonProperty(THREAD_NAME_LABEL) String threadName, - final @JsonProperty(THREAD_NAME_LABEL2) String threadName2, - final @JsonProperty(REJECTED_POLICY_LABEL) String rejectedPolicy, - final @JsonProperty(REJECTED_POLICY_LABEL2) String rejectedPolicy2, - final @JsonProperty(CALLER_RUNS_WHEN_REJECTED_LABEL) String callerRunsWhenRejected, - final @JsonProperty(CALLER_RUNS_WHEN_REJECTED_LABEL2) String callerRunsWhenRejected2, - final @JsonProperty("id") String id) { - setDescription(description); - setExecutorService(executorService != null ? executorService : executorService2); - setPoolSize(poolSize != null ? poolSize : poolSize2); - setMaxPoolSize(maxPoolSize != null ? maxPoolSize : maxPoolSize2); - setKeepAliveTime(keepAliveTime != null ? keepAliveTime : keepAliveTime2); - setTimeUnit(timeUnit != null ? timeUnit : timeUnit2); - setMaxQueueSize(maxQueueSize != null ? maxQueueSize : maxQueueSize2); - setAllowCoreThreadTimeOut(allowCoreThreadTimeOut != null ? allowCoreThreadTimeOut : allowCoreThreadTimeOut2); - setThreadName(threadName != null ? threadName : threadName2); - setRejectedPolicy(rejectedPolicy != null ? rejectedPolicy : rejectedPolicy2); - setCallerRunsWhenRejected(callerRunsWhenRejected != null ? callerRunsWhenRejected : callerRunsWhenRejected2); - setId(id); - } - public Threads(Step step) { super(step); @@ -157,7 +139,7 @@ protected void assignAttribute(final Parameter parameter) { case CALLER_RUNS_WHEN_REJECTED_LABEL2: this.setCallerRunsWhenRejected(String.valueOf(parameter.getValue())); break; - case DESCRIPTION_LABEL: + case KamelHelper.DESCRIPTION: this.setDescription((Map) parameter.getValue()); break; default: @@ -208,7 +190,7 @@ protected void assignProperty(final Parameter parameter) { case CALLER_RUNS_WHEN_REJECTED_LABEL2: parameter.setValue(this.getCallerRunsWhenRejected()); break; - case DESCRIPTION_LABEL: + case KamelHelper.DESCRIPTION: parameter.setValue(this.getDescription()); break; default: @@ -220,7 +202,7 @@ protected void assignProperty(final Parameter parameter) { public Map getRepresenterProperties() { Map properties = super.getDefaultRepresenterProperties(); if (this.getDescription() != null) { - properties.put(DESCRIPTION_LABEL, this.getDescription()); + properties.put(KamelHelper.DESCRIPTION, this.getDescription()); } if (this.getExecutorService() != null) { properties.put(EXECUTOR_SERVICE_LABEL2, this.getExecutorService()); diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/ToDynamic.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/ToDynamic.java index 8552629f6..97f7c9725 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/ToDynamic.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/ToDynamic.java @@ -1,6 +1,6 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; import io.kaoto.backend.camel.KamelHelper; import io.kaoto.backend.model.parameter.Parameter; @@ -30,13 +30,32 @@ public class ToDynamic extends EIPStep { public static final String DESCRIPTION_LABEL = KamelHelper.DESCRIPTION; public static final String PARAMETERS_LABEL = KamelHelper.PARAMETERS; + @JsonProperty(URI_LABEL) private String uri; + + @JsonProperty(PATTERN_LABEL) private String pattern; + + @JsonProperty(CACHE_SIZE_LABEL) + @JsonAlias(CACHE_SIZE_LABEL2) private Integer cacheSize; + + @JsonProperty(IGNORE_INVALID_ENDPOINTS_LABEL) + @JsonAlias(IGNORE_INVALID_ENDPOINTS_LABEL2) private Boolean ignoreInvalidEndpoints; + + @JsonProperty(ALLOW_OPTIMISED_COMPONENTS_LABEL) + @JsonAlias(ALLOW_OPTIMISED_COMPONENTS_LABEL2) private Boolean allowOptimisedComponents; + + @JsonProperty(AUTO_START_COMPONENTS_LABEL) + @JsonAlias(AUTO_START_COMPONENTS_LABEL2) private Boolean autoStartComponents; + + @JsonProperty(DESCRIPTION_LABEL) private Map description; + + @JsonProperty(PARAMETERS_LABEL) private Map parameters; public ToDynamic() { @@ -47,33 +66,6 @@ public ToDynamic(Step step) { super(step); } - @JsonCreator - public ToDynamic(final @JsonProperty(URI_LABEL) String uri, - final @JsonProperty(PATTERN_LABEL) String pattern, - final @JsonProperty(CACHE_SIZE_LABEL) Integer cacheSize, - final @JsonProperty(CACHE_SIZE_LABEL2) Integer cacheSize2, - final @JsonProperty(IGNORE_INVALID_ENDPOINTS_LABEL) Boolean ignoreInvalidEndpoints, - final @JsonProperty(IGNORE_INVALID_ENDPOINTS_LABEL2) Boolean ignoreInvalidEndpoints2, - final @JsonProperty(ALLOW_OPTIMISED_COMPONENTS_LABEL) Boolean allowOptimisedComponents, - final @JsonProperty(ALLOW_OPTIMISED_COMPONENTS_LABEL2) Boolean allowOptimisedComponents2, - final @JsonProperty(AUTO_START_COMPONENTS_LABEL) Boolean autoStartComponents, - final @JsonProperty(AUTO_START_COMPONENTS_LABEL2) Boolean autoStartComponents2, - final @JsonProperty(DESCRIPTION_LABEL) Map description, - final @JsonProperty(PARAMETERS_LABEL) Map parameters, - final @JsonProperty("id") String id) { - super(); - setUri(uri); - setPattern(pattern); - setCacheSize(cacheSize != null ? cacheSize : cacheSize2); - setIgnoreInvalidEndpoints(ignoreInvalidEndpoints != null ? ignoreInvalidEndpoints : ignoreInvalidEndpoints2); - setAllowOptimisedComponents(allowOptimisedComponents != null ? allowOptimisedComponents : - allowOptimisedComponents2); - setAutoStartComponents(autoStartComponents != null ? autoStartComponents : autoStartComponents2); - setDescription(description); - setParameters(parameters); - setId(id); - } - @Override protected void assignAttribute(final Parameter parameter) { switch (parameter.getId()) { diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Transacted.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Transacted.java index efbb222b3..a1289bc0a 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Transacted.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/Transacted.java @@ -11,6 +11,7 @@ public class Transacted extends EIPStep { public static final String REF_LABEL = "ref"; + @JsonProperty(REF_LABEL) private String ref; @@ -22,13 +23,6 @@ public Transacted(Step step) { super(step); } - public Transacted(final @JsonProperty(REF_LABEL) String ref, - final @JsonProperty("id") String id) { - super(); - setRef(ref); - setId(id); - } - @Override protected void assignAttribute(final Parameter parameter) { this.setRef(String.valueOf(parameter.getValue())); diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/TryCatch.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/TryCatch.java index f0d62cba3..c5c20de42 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/TryCatch.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/TryCatch.java @@ -5,7 +5,7 @@ import java.util.List; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; import io.kaoto.backend.api.metadata.catalog.StepCatalog; @@ -29,29 +29,21 @@ public class TryCatch extends EIPStep { public static final String DO_FINALLY_LABEL = "do-finally"; public static final String DO_FINALLY_LABEL2 = "doFinally"; + @JsonProperty(STEPS_LABEL) private List steps; + + @JsonProperty(DO_CATCH_LABEL) + @JsonAlias(DO_CATCH_LABEL2) private List doCatch; + + @JsonProperty(DO_FINALLY_LABEL) + @JsonAlias(DO_FINALLY_LABEL2) private GenericFlowWithSteps doFinally; public TryCatch() { super(); } - @JsonCreator - public TryCatch( - final @JsonProperty(STEPS_LABEL) List steps, - final @JsonProperty(DO_CATCH_LABEL) List doCatch, - final @JsonProperty(DO_CATCH_LABEL2) List doCatch2, - final @JsonProperty(DO_FINALLY_LABEL) GenericFlowWithSteps doFinally, - final @JsonProperty(DO_FINALLY_LABEL2) GenericFlowWithSteps doFinally2, - final @JsonProperty("id") String id) { - super(); - setSteps(steps); - setDoCatch(doCatch != null ? doCatch : doCatch2); - setDoFinally(doFinally != null ? doFinally : doFinally2); - setId(id); - } - public TryCatch(final Step step, final KamelPopulator kameletPopulator) { super(step); diff --git a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/UriFlowStep.java b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/UriFlowStep.java index 21475f39f..881b8a677 100644 --- a/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/UriFlowStep.java +++ b/camel-support/src/main/java/io/kaoto/backend/camel/model/deployment/kamelet/step/UriFlowStep.java @@ -1,6 +1,5 @@ package io.kaoto.backend.camel.model.deployment.kamelet.step; -import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -19,6 +18,7 @@ @JsonDeserialize(using = JsonDeserializer.None.class) @JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) public class UriFlowStep implements FlowStep { @Serial private static final long serialVersionUID = 3379417696583645440L; @@ -26,11 +26,7 @@ public class UriFlowStep implements FlowStep { public static final String PARAMETERS = KamelHelper.PARAMETERS; public static final String URI = "uri"; - @JsonCreator - public UriFlowStep( - final @JsonProperty(value = URI) String uri, - final @JsonProperty(value = PARAMETERS) Map parameters, - final @JsonProperty(value = ID) String id) { + public UriFlowStep(final String uri, final Map parameters, final String id) { super(); setUri(uri); setParameters(parameters); @@ -38,7 +34,6 @@ public UriFlowStep( } @JsonProperty(URI) - @JsonInclude(JsonInclude.Include.NON_NULL) private String uri; @JsonProperty(PARAMETERS) diff --git a/camel-support/src/test/java/io/kaoto/backend/camel/model/deployment/kamelet/step/TryCatchTest.java b/camel-support/src/test/java/io/kaoto/backend/camel/model/deployment/kamelet/step/TryCatchTest.java index 3b4ac85da..6bf639ec9 100644 --- a/camel-support/src/test/java/io/kaoto/backend/camel/model/deployment/kamelet/step/TryCatchTest.java +++ b/camel-support/src/test/java/io/kaoto/backend/camel/model/deployment/kamelet/step/TryCatchTest.java @@ -9,7 +9,7 @@ class TryCatchTest { @Test void noFinally() throws Exception { - var tryCatch = new TryCatch(null, null, null, null, null, null); + var tryCatch = new TryCatch(); assertNotNull(tryCatch.getRepresenterProperties()); } }