You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/08/21 08:44:46 UTC

[camel] 02/02: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

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

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

commit 136a6e8e90c9f4cf04d01beecb9a68693d3383fc
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Aug 21 10:44:30 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../component/xchange/XChangeConfiguration.java    |  8 +++
 .../xmlsecurity/XmlSignatureEndpoint.java          |  8 +++
 .../src/main/docs/zookeeper-component.adoc         |  3 +-
 .../zookeeper/ZooKeeperConfiguration.java          | 20 ------
 .../component/zookeeper/ZooKeeperEndpoint.java     | 16 -----
 .../component/zookeeper/ZooKeeperEndpointTest.java | 11 ----
 .../dsl/ZooKeeperEndpointBuilderFactory.java       | 76 ----------------------
 .../ZooKeeperComponentConfiguration.java           | 17 -----
 .../camel-spring-boot-dependencies/pom.xml         |  2 +-
 9 files changed, 18 insertions(+), 143 deletions(-)

diff --git a/components/camel-xchange/src/main/java/org/apache/camel/component/xchange/XChangeConfiguration.java b/components/camel-xchange/src/main/java/org/apache/camel/component/xchange/XChangeConfiguration.java
index d832872..7bb8db4 100644
--- a/components/camel-xchange/src/main/java/org/apache/camel/component/xchange/XChangeConfiguration.java
+++ b/components/camel-xchange/src/main/java/org/apache/camel/component/xchange/XChangeConfiguration.java
@@ -94,6 +94,10 @@ public class XChangeConfiguration {
         return currency;
     }
 
+    public void setCurrency(Currency currency) {
+        this.currency = currency;
+    }
+
     public void setCurrency(String curr) {
         this.currency = Currency.getInstanceNoCreate(curr);
     }
@@ -102,6 +106,10 @@ public class XChangeConfiguration {
         return currencyPair;
     }
 
+    public void setCurrencyPair(CurrencyPair currencyPair) {
+        this.currencyPair = currencyPair;
+    }
+
     public void setCurrencyPair(String pair) {
         this.currencyPair = new CurrencyPair(pair);
     }
diff --git a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureEndpoint.java b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureEndpoint.java
index e181e20..eecd99d 100644
--- a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureEndpoint.java
+++ b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureEndpoint.java
@@ -51,6 +51,14 @@ public abstract class XmlSignatureEndpoint extends DefaultEndpoint {
         super(uri, component);
     }
 
+    public XmlSignerConfiguration getSignerConfiguration() {
+        return signerConfiguration;
+    }
+
+    public XmlVerifierConfiguration getVerifierConfiguration() {
+        return verifierConfiguration;
+    }
+
     public XmlCommand getCommand() {
         return command;
     }
diff --git a/components/camel-zookeeper/src/main/docs/zookeeper-component.adoc b/components/camel-zookeeper/src/main/docs/zookeeper-component.adoc
index 8317817..0f8ad4a 100644
--- a/components/camel-zookeeper/src/main/docs/zookeeper-component.adoc
+++ b/components/camel-zookeeper/src/main/docs/zookeeper-component.adoc
@@ -71,13 +71,12 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (14 parameters):
+=== Query Parameters (13 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *awaitExistence* (common) | *Deprecated* Not in use | true | boolean
 | *listChildren* (common) | Whether the children of the node should be listed | false | boolean
 | *timeout* (common) | The time interval to wait on connection before timing out. | 5000 | int
 | *backoff* (consumer) | The time interval to backoff for after an error before retrying. | 5000 | long
diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java
index 12b107e..287614c 100644
--- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java
+++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java
@@ -45,9 +45,6 @@ public class ZooKeeperConfiguration implements Cloneable {
     private int timeout = 5000;
     @UriParam(label = "consumer", defaultValue = "5000")
     private long backoff = 5000;
-    @UriParam(defaultValue = "true")
-    @Deprecated
-    private boolean awaitExistence = true;
     @UriParam(label = "consumer")
     private boolean repeat;
     @UriParam
@@ -153,23 +150,6 @@ public class ZooKeeperConfiguration implements Cloneable {
         this.repeat = repeat;
     }
 
-    /**
-     * @deprecated The usage of this option has no effect at all.
-     */
-    @Deprecated
-    public boolean shouldAwaitExistence() {
-        return awaitExistence;
-    }
-
-    /**
-     * Not in use
-     * @deprecated The usage of this option has no effect at all.
-     */
-    @Deprecated
-    public void setAwaitExistence(boolean awaitExistence) {
-        this.awaitExistence = awaitExistence;
-    }
-
     public long getBackoff() {
         return backoff;
     }
diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java
index 76f5b20..4bb31fc 100644
--- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java
+++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java
@@ -131,22 +131,6 @@ public class ZooKeeperEndpoint extends DefaultEndpoint {
         getConfiguration().setBackoff(backoff);
     }
 
-    /**
-     * @deprecated The usage of this property has no effect at all.
-     */
-    @Deprecated
-    public boolean getAwaitExistence() {
-        return getConfiguration().shouldAwaitExistence();
-    }
-
-    /**
-     * @deprecated The usage of this property has no effect at all.
-     */
-    @Deprecated
-    public void setAwaitExistence(boolean awaitExistence) {
-        getConfiguration().setAwaitExistence(awaitExistence);
-    }
-
     @ManagedOperation
     public void addServer(String server) {
         getConfiguration().addZookeeperServer(server);
diff --git a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/ZooKeeperEndpointTest.java b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/ZooKeeperEndpointTest.java
index 0f9c119..6a3dbfd 100644
--- a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/ZooKeeperEndpointTest.java
+++ b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/ZooKeeperEndpointTest.java
@@ -22,17 +22,6 @@ import org.junit.Test;
 public class ZooKeeperEndpointTest extends CamelTestSupport {
 
     @Test
-    public void awaitExistenceOptionOnEndpoint() {
-        ZooKeeperEndpoint endpoint = context.getEndpoint("zookeeper:someserver/zoo", ZooKeeperEndpoint.class);
-        assertTrue("The awaitExistence option should default to true", endpoint.getAwaitExistence());
-
-        endpoint = context.getEndpoint("zookeeper:someserver/zoo?awaitExistence=true", ZooKeeperEndpoint.class);
-        assertTrue("The awaitExistence option should be true", endpoint.getAwaitExistence());
-
-        endpoint = context.getEndpoint("zookeeper:someserver/zoo?awaitExistence=false", ZooKeeperEndpoint.class);
-        assertFalse("The awaitExistence option should be false", endpoint.getAwaitExistence());
-    }
-    
     public void multipleZooKeeperServers() {
         ZooKeeperEndpoint endpoint = context.getEndpoint("zookeeper:someserver1,someserver2:1234/zoo", ZooKeeperEndpoint.class);
         assertEquals("Get wrong number of servers", 2, endpoint.getConfiguration().getServers().size());
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ZooKeeperEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ZooKeeperEndpointBuilderFactory.java
index 97a68dc..c219afb 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ZooKeeperEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ZooKeeperEndpointBuilderFactory.java
@@ -42,32 +42,6 @@ public interface ZooKeeperEndpointBuilderFactory {
             return (AdvancedZooKeeperEndpointConsumerBuilder) this;
         }
         /**
-         * Not in use.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: common
-         */
-        @Deprecated
-        default ZooKeeperEndpointConsumerBuilder awaitExistence(
-                boolean awaitExistence) {
-            setProperty("awaitExistence", awaitExistence);
-            return this;
-        }
-        /**
-         * Not in use.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: common
-         */
-        @Deprecated
-        default ZooKeeperEndpointConsumerBuilder awaitExistence(
-                String awaitExistence) {
-            setProperty("awaitExistence", awaitExistence);
-            return this;
-        }
-        /**
          * Whether the children of the node should be listed.
          * 
          * The option is a: <code>boolean</code> type.
@@ -351,32 +325,6 @@ public interface ZooKeeperEndpointBuilderFactory {
             return (AdvancedZooKeeperEndpointProducerBuilder) this;
         }
         /**
-         * Not in use.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: common
-         */
-        @Deprecated
-        default ZooKeeperEndpointProducerBuilder awaitExistence(
-                boolean awaitExistence) {
-            setProperty("awaitExistence", awaitExistence);
-            return this;
-        }
-        /**
-         * Not in use.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: common
-         */
-        @Deprecated
-        default ZooKeeperEndpointProducerBuilder awaitExistence(
-                String awaitExistence) {
-            setProperty("awaitExistence", awaitExistence);
-            return this;
-        }
-        /**
          * Whether the children of the node should be listed.
          * 
          * The option is a: <code>boolean</code> type.
@@ -570,30 +518,6 @@ public interface ZooKeeperEndpointBuilderFactory {
             return (AdvancedZooKeeperEndpointBuilder) this;
         }
         /**
-         * Not in use.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: common
-         */
-        @Deprecated
-        default ZooKeeperEndpointBuilder awaitExistence(boolean awaitExistence) {
-            setProperty("awaitExistence", awaitExistence);
-            return this;
-        }
-        /**
-         * Not in use.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: common
-         */
-        @Deprecated
-        default ZooKeeperEndpointBuilder awaitExistence(String awaitExistence) {
-            setProperty("awaitExistence", awaitExistence);
-            return this;
-        }
-        /**
          * Whether the children of the node should be listed.
          * 
          * The option is a: <code>boolean</code> type.
diff --git a/platforms/spring-boot/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/ZooKeeperComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/ZooKeeperComponentConfiguration.java
index ead0e39..98700c3 100644
--- a/platforms/spring-boot/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/ZooKeeperComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/ZooKeeperComponentConfiguration.java
@@ -20,7 +20,6 @@ import java.util.List;
 import javax.annotation.Generated;
 import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
 import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
 
 /**
  * The zookeeper component allows interaction with a ZooKeeper cluster.
@@ -88,11 +87,6 @@ public class ZooKeeperComponentConfiguration
          */
         private Boolean repeat = false;
         /**
-         * Not in use
-         */
-        @Deprecated
-        private Boolean awaitExistence = true;
-        /**
          * The time interval to backoff for after an error before retrying.
          */
         private Long backoff = 5000L;
@@ -150,17 +144,6 @@ public class ZooKeeperComponentConfiguration
             this.repeat = repeat;
         }
 
-        @Deprecated
-        @DeprecatedConfigurationProperty
-        public Boolean getAwaitExistence() {
-            return awaitExistence;
-        }
-
-        @Deprecated
-        public void setAwaitExistence(Boolean awaitExistence) {
-            this.awaitExistence = awaitExistence;
-        }
-
         public Long getBackoff() {
             return backoff;
         }
diff --git a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
index 817ff3e..e353bea 100644
--- a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
+++ b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
@@ -3768,7 +3768,7 @@
       <dependency>
         <groupId>org.knowm.xchange</groupId>
         <artifactId>xchange-core</artifactId>
-        <version>4.3.20</version>
+        <version>4.3.21</version>
       </dependency>
       <dependency>
         <groupId>org.mozilla</groupId>