[camel] branch master updated (f46f91e -> ed4d9a9)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch master updated (f46f91e -> ed4d9a9)

davsclaus-2
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from f46f91e  CAMEL-14177: camel-bean-validator - Allow to turn off xml configuration
     new 7eca8b7  CAMEL-14177: camel-bean-validator - Allow to configure advanced options on component level
     new ed4d9a9  Regen

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/docs/bean-validator-component.adoc    |  6 ++-
 .../bean/validator/BeanValidatorComponent.java     | 62 ++++++++++++++++++++++
 .../ROOT/pages/bean-validator-component.adoc       |  6 ++-
 .../modules/ROOT/pages/cxf-component.adoc          |  2 +-
 .../BeanValidatorComponentConfiguration.java       | 52 ++++++++++++++++++
 5 files changed, 125 insertions(+), 3 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[camel] 01/02: CAMEL-14177: camel-bean-validator - Allow to configure advanced options on component level

davsclaus-2
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 7eca8b7c3c59ad1142705fc6a276f05df69571d3
Author: Claus Ibsen <[hidden email]>
AuthorDate: Thu Nov 14 06:25:31 2019 +0100

    CAMEL-14177: camel-bean-validator - Allow to configure advanced options on component level
---
 .../src/main/docs/bean-validator-component.adoc    |  6 ++-
 .../bean/validator/BeanValidatorComponent.java     | 62 ++++++++++++++++++++++
 .../ROOT/pages/bean-validator-component.adoc       |  6 ++-
 .../BeanValidatorComponentConfiguration.java       | 52 ++++++++++++++++++
 4 files changed, 124 insertions(+), 2 deletions(-)

diff --git a/components/camel-bean-validator/src/main/docs/bean-validator-component.adoc b/components/camel-bean-validator/src/main/docs/bean-validator-component.adoc
index 355bc898..064fef0 100644
--- a/components/camel-bean-validator/src/main/docs/bean-validator-component.adoc
+++ b/components/camel-bean-validator/src/main/docs/bean-validator-component.adoc
@@ -49,7 +49,7 @@ Where *label* is an arbitrary text value describing the endpoint. +
 
 
 // component options: START
-The Bean Validator component supports 4 options, which are listed below.
+The Bean Validator component supports 8 options, which are listed below.
 
 
 
@@ -57,6 +57,10 @@ The Bean Validator component supports 4 options, which are listed below.
 |===
 | Name | Description | Default | Type
 | *ignoreXmlConfiguration* (producer) | Whether to ignore data from the META-INF/validation.xml file. | false | boolean
+| *validationProvider Resolver* (advanced) | To use a a custom ValidationProviderResolver |  | ValidationProviderResolver
+| *messageInterpolator* (advanced) | To use a custom MessageInterpolator |  | MessageInterpolator
+| *traversableResolver* (advanced) | To use a custom TraversableResolver |  | TraversableResolver
+| *constraintValidator Factory* (advanced) | To use a custom ConstraintValidatorFactory |  | ConstraintValidatorFactory
 | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
diff --git a/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorComponent.java b/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorComponent.java
index 857cc77..ad4792c 100644
--- a/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorComponent.java
+++ b/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorComponent.java
@@ -17,6 +17,10 @@
 package org.apache.camel.component.bean.validator;
 
 import java.util.Map;
+import javax.validation.ConstraintValidatorFactory;
+import javax.validation.MessageInterpolator;
+import javax.validation.TraversableResolver;
+import javax.validation.ValidationProviderResolver;
 
 import org.apache.camel.Endpoint;
 import org.apache.camel.spi.Metadata;
@@ -32,6 +36,14 @@ public class BeanValidatorComponent extends DefaultComponent {
 
     @Metadata
     private boolean ignoreXmlConfiguration;
+    @Metadata(label = "advanced")
+    private ValidationProviderResolver validationProviderResolver;
+    @Metadata(label = "advanced")
+    private MessageInterpolator messageInterpolator;
+    @Metadata(label = "advanced")
+    private TraversableResolver traversableResolver;
+    @Metadata(label = "advanced")
+    private ConstraintValidatorFactory constraintValidatorFactory;
 
     public BeanValidatorComponent() {
     }
@@ -39,8 +51,14 @@ public class BeanValidatorComponent extends DefaultComponent {
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
         BeanValidatorEndpoint endpoint = new BeanValidatorEndpoint(uri, this);
+
         endpoint.setLabel(remaining);
         endpoint.setIgnoreXmlConfiguration(ignoreXmlConfiguration);
+        endpoint.setValidationProviderResolver(validationProviderResolver);
+        endpoint.setMessageInterpolator(messageInterpolator);
+        endpoint.setTraversableResolver(traversableResolver);
+        endpoint.setConstraintValidatorFactory(constraintValidatorFactory);
+
         setProperties(endpoint, parameters);
         return endpoint;
     }
@@ -56,4 +74,48 @@ public class BeanValidatorComponent extends DefaultComponent {
         this.ignoreXmlConfiguration = ignoreXmlConfiguration;
     }
 
+    public ValidationProviderResolver getValidationProviderResolver() {
+        return validationProviderResolver;
+    }
+
+    /**
+     * To use a a custom {@link ValidationProviderResolver}
+     */
+    public void setValidationProviderResolver(ValidationProviderResolver validationProviderResolver) {
+        this.validationProviderResolver = validationProviderResolver;
+    }
+
+    public MessageInterpolator getMessageInterpolator() {
+        return messageInterpolator;
+    }
+
+    /**
+     * To use a custom {@link MessageInterpolator}
+     */
+    public void setMessageInterpolator(MessageInterpolator messageInterpolator) {
+        this.messageInterpolator = messageInterpolator;
+    }
+
+    public TraversableResolver getTraversableResolver() {
+        return traversableResolver;
+    }
+
+    /**
+     * To use a custom {@link TraversableResolver}
+     */
+    public void setTraversableResolver(TraversableResolver traversableResolver) {
+        this.traversableResolver = traversableResolver;
+    }
+
+    public ConstraintValidatorFactory getConstraintValidatorFactory() {
+        return constraintValidatorFactory;
+    }
+
+    /**
+     * To use a custom {@link ConstraintValidatorFactory}
+     */
+    public void setConstraintValidatorFactory(ConstraintValidatorFactory constraintValidatorFactory) {
+        this.constraintValidatorFactory = constraintValidatorFactory;
+    }
+
 }
\ No newline at end of file
diff --git a/docs/components/modules/ROOT/pages/bean-validator-component.adoc b/docs/components/modules/ROOT/pages/bean-validator-component.adoc
index 6d4d991..1620158 100644
--- a/docs/components/modules/ROOT/pages/bean-validator-component.adoc
+++ b/docs/components/modules/ROOT/pages/bean-validator-component.adoc
@@ -50,7 +50,7 @@ Where *label* is an arbitrary text value describing the endpoint. +
 
 
 // component options: START
-The Bean Validator component supports 4 options, which are listed below.
+The Bean Validator component supports 8 options, which are listed below.
 
 
 
@@ -58,6 +58,10 @@ The Bean Validator component supports 4 options, which are listed below.
 |===
 | Name | Description | Default | Type
 | *ignoreXmlConfiguration* (producer) | Whether to ignore data from the META-INF/validation.xml file. | false | boolean
+| *validationProvider Resolver* (advanced) | To use a a custom ValidationProviderResolver |  | ValidationProviderResolver
+| *messageInterpolator* (advanced) | To use a custom MessageInterpolator |  | MessageInterpolator
+| *traversableResolver* (advanced) | To use a custom TraversableResolver |  | TraversableResolver
+| *constraintValidator Factory* (advanced) | To use a custom ConstraintValidatorFactory |  | ConstraintValidatorFactory
 | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
diff --git a/platforms/spring-boot/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentConfiguration.java
index 40e7e9c..2dc3407 100644
--- a/platforms/spring-boot/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentConfiguration.java
@@ -42,6 +42,26 @@ public class BeanValidatorComponentConfiguration
      */
     private Boolean ignoreXmlConfiguration = false;
     /**
+     * To use a a custom ValidationProviderResolver. The option is a
+     * javax.validation.ValidationProviderResolver type.
+     */
+    private String validationProviderResolver;
+    /**
+     * To use a custom MessageInterpolator. The option is a
+     * javax.validation.MessageInterpolator type.
+     */
+    private String messageInterpolator;
+    /**
+     * To use a custom TraversableResolver. The option is a
+     * javax.validation.TraversableResolver type.
+     */
+    private String traversableResolver;
+    /**
+     * To use a custom ConstraintValidatorFactory. The option is a
+     * javax.validation.ConstraintValidatorFactory type.
+     */
+    private String constraintValidatorFactory;
+    /**
      * Whether the component should use basic property binding (Camel 2.x) or
      * the newer property binding with additional capabilities
      */
@@ -75,6 +95,38 @@ public class BeanValidatorComponentConfiguration
         this.ignoreXmlConfiguration = ignoreXmlConfiguration;
     }
 
+    public String getValidationProviderResolver() {
+        return validationProviderResolver;
+    }
+
+    public void setValidationProviderResolver(String validationProviderResolver) {
+        this.validationProviderResolver = validationProviderResolver;
+    }
+
+    public String getMessageInterpolator() {
+        return messageInterpolator;
+    }
+
+    public void setMessageInterpolator(String messageInterpolator) {
+        this.messageInterpolator = messageInterpolator;
+    }
+
+    public String getTraversableResolver() {
+        return traversableResolver;
+    }
+
+    public void setTraversableResolver(String traversableResolver) {
+        this.traversableResolver = traversableResolver;
+    }
+
+    public String getConstraintValidatorFactory() {
+        return constraintValidatorFactory;
+    }
+
+    public void setConstraintValidatorFactory(String constraintValidatorFactory) {
+        this.constraintValidatorFactory = constraintValidatorFactory;
+    }
+
     public Boolean getBasicPropertyBinding() {
         return basicPropertyBinding;
     }

Reply | Threaded
Open this post in threaded view
|

[camel] 02/02: Regen

davsclaus-2
In reply to this post by davsclaus-2
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit ed4d9a99564d5d366cd8213451ac2752f9005f05
Author: Claus Ibsen <[hidden email]>
AuthorDate: Thu Nov 14 06:25:37 2019 +0100

    Regen
---
 docs/components/modules/ROOT/pages/cxf-component.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/components/modules/ROOT/pages/cxf-component.adoc b/docs/components/modules/ROOT/pages/cxf-component.adoc
index e498ae6..5e384fe 100644
--- a/docs/components/modules/ROOT/pages/cxf-component.adoc
+++ b/docs/components/modules/ROOT/pages/cxf-component.adoc
@@ -681,7 +681,7 @@ message with this parameter list. The response message's body is a
 messageContentsList, you can get the result from that list.
 
 If you don't specify the operation name in the message header,
-`CxfProducer` will try to use the `defaultOperationName `from
+`CxfProducer` will try to use the `defaultOperationName` from
 `CxfEndpoint`, if there is no `defaultOperationName` set on
 `CxfEndpoint`, it will pickup the first operationName from the Operation
 list.