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 17e61e48c74280592e0b48c04c0c5f225e79ec66 Author: Claus Ibsen <[email protected]> AuthorDate: Mon Nov 6 11:51:54 2017 +0100 CAMEL-11959: Polished. --- apache-camel/pom.xml | 15 +++++++++++++++ apache-camel/src/main/descriptors/common-bin.xml | 1 + components/camel-yql/src/main/docs/yql-component.adoc | 8 ++++++-- .../org/apache/camel/component/yql/YqlComponent.java | 8 +++++++- .../java/org/apache/camel/component/yql/YqlEndpoint.java | 16 ++++++++++------ .../component/yql/configuration/YqlConfiguration.java | 2 +- parent/pom.xml | 5 +++++ .../yql/springboot/YqlComponentConfiguration.java | 5 +++-- .../camel-spring-boot-dependencies/pom.xml | 5 +++++ 9 files changed, 53 insertions(+), 12 deletions(-) diff --git a/apache-camel/pom.xml b/apache-camel/pom.xml index 99439e3..ae1bd55 100644 --- a/apache-camel/pom.xml +++ b/apache-camel/pom.xml @@ -1189,6 +1189,16 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-asn1-starter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-asterisk-starter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-atmosphere-websocket-starter</artifactId> <version>${project.version}</version> </dependency> @@ -2388,6 +2398,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-yql-starter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-zendesk-starter</artifactId> <version>${project.version}</version> </dependency> diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml index d795394..237a75f 100644 --- a/apache-camel/src/main/descriptors/common-bin.xml +++ b/apache-camel/src/main/descriptors/common-bin.xml @@ -576,6 +576,7 @@ <include>org.apache.camel:camel-xmpp-starter</include> <include>org.apache.camel:camel-xstream-starter</include> <include>org.apache.camel:camel-yammer-starter</include> + <include>org.apache.camel:camel-yql-starter</include> <include>org.apache.camel:camel-zendesk-starter</include> <include>org.apache.camel:camel-zipfile-starter</include> <include>org.apache.camel:camel-zipkin-starter</include> diff --git a/components/camel-yql/src/main/docs/yql-component.adoc b/components/camel-yql/src/main/docs/yql-component.adoc index 43780f8..a655c06 100644 --- a/components/camel-yql/src/main/docs/yql-component.adoc +++ b/components/camel-yql/src/main/docs/yql-component.adoc @@ -4,6 +4,10 @@ The *yql* component is used for accessing the https://developer.yahoo.com/yql/[Yahoo Query Language platform]. +The YQL (Yahoo! Query Language) platform enables you to query, filter, and combine data across the web through +a single interface. It exposes a SQL-like syntax that is both familiar to developers and expressive enough for +getting the right data. + Maven users will need to add the following dependency to their `pom.xml` for this component: @@ -35,7 +39,7 @@ The Yahoo Query Language component supports 2 options which are listed below. [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type -| *connectionManager* (producer) | Set the connection manager. | | HttpClientConnection Manager +| *connectionManager* (producer) | To use a custom configured HttpClientConnectionManager. | | HttpClientConnection Manager | *resolveProperty Placeholders* (advanced) | Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. | true | boolean |=== // component options: END @@ -68,7 +72,7 @@ with the following path and query parameters: | *diagnostics* (producer) | If true diagnostic information is returned with the response. | false | boolean | *env* (producer) | Allows you to use multiple Open Data Tables through a YQL environment file. More information https://developer.yahoo.com/yql/guide/yql_storage.htmlusing-records-env-files= | | String | *format* (producer) | The expected format. Allowed values: xml or json. | json | String -| *jsonCompat* (producer) | Enables lossless JSON processing. The only allowed value is new. More information https://developer.yahoo.com/yql/guide/response.htmljson-to-json= | | String +| *jsonCompat* (producer) | Enables lossless JSON processing. The only allowed value is new. More information https://developer.yahoo.com/yql/guide/response.htmljson-to-json | | String | *throwExceptionOnFailure* (producer) | Option to disable throwing the YqlHttpException in case of failed responses from the remote server. This allows you to get all responses regardless of the HTTP status code. | true | boolean | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). | false | boolean | *https* (security) | Option to use HTTPS to communicate with YQL. | true | boolean diff --git a/components/camel-yql/src/main/java/org/apache/camel/component/yql/YqlComponent.java b/components/camel-yql/src/main/java/org/apache/camel/component/yql/YqlComponent.java index 59e39a8..6b7a92b 100644 --- a/components/camel-yql/src/main/java/org/apache/camel/component/yql/YqlComponent.java +++ b/components/camel-yql/src/main/java/org/apache/camel/component/yql/YqlComponent.java @@ -22,11 +22,13 @@ import org.apache.camel.Endpoint; import org.apache.camel.component.yql.configuration.YqlConfiguration; import org.apache.camel.component.yql.configuration.YqlConfigurationValidator; import org.apache.camel.impl.DefaultComponent; +import org.apache.camel.spi.Metadata; import org.apache.http.conn.HttpClientConnectionManager; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; public class YqlComponent extends DefaultComponent { + @Metadata(label = "advanced") private HttpClientConnectionManager localConnectionManager; @Override @@ -48,8 +50,12 @@ public class YqlComponent extends DefaultComponent { } } + public HttpClientConnectionManager getLocalConnectionManager() { + return localConnectionManager; + } + /** - * Set the connection manager. + * To use a custom configured HttpClientConnectionManager. */ public void setConnectionManager(final HttpClientConnectionManager connectionManager) { this.localConnectionManager = connectionManager; diff --git a/components/camel-yql/src/main/java/org/apache/camel/component/yql/YqlEndpoint.java b/components/camel-yql/src/main/java/org/apache/camel/component/yql/YqlEndpoint.java index 8c9bb05..1a08139 100644 --- a/components/camel-yql/src/main/java/org/apache/camel/component/yql/YqlEndpoint.java +++ b/components/camel-yql/src/main/java/org/apache/camel/component/yql/YqlEndpoint.java @@ -26,17 +26,20 @@ import org.apache.camel.spi.UriParam; import org.apache.http.conn.HttpClientConnectionManager; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -@UriEndpoint(firstVersion = "2.21.0", scheme = "yql", title = "Yahoo Query Language", syntax = "yql:query", producerOnly = true, label = "yql") +/** + * The YQL (Yahoo! Query Language) platform enables you to query, filter, and combine data across the web. + */ +@UriEndpoint(firstVersion = "2.21.0", scheme = "yql", title = "Yahoo Query Language", syntax = "yql:query", producerOnly = true, label = "cloud") public class YqlEndpoint extends DefaultEndpoint { - @UriParam - private final YqlConfiguration configuration; private final HttpClientConnectionManager connectionManager; private CloseableHttpClient httpClient; - YqlEndpoint(final String uri, final YqlComponent component, final YqlConfiguration configuration, final HttpClientConnectionManager connectionManager) { + @UriParam + private final YqlConfiguration configuration; + + public YqlEndpoint(String uri, YqlComponent component, YqlConfiguration configuration, HttpClientConnectionManager connectionManager) { super(uri, component); this.configuration = configuration; this.connectionManager = connectionManager; @@ -49,7 +52,7 @@ public class YqlEndpoint extends DefaultEndpoint { @Override public Consumer createConsumer(final Processor processor) throws Exception { - throw new UnsupportedOperationException("Consumer does not supported for YQL component: " + getEndpointUri()); + throw new UnsupportedOperationException("Consumer is not supported for YQL component"); } @Override @@ -61,6 +64,7 @@ public class YqlEndpoint extends DefaultEndpoint { protected void doStop() throws Exception { if (httpClient != null) { httpClient.close(); + httpClient = null; } } diff --git a/components/camel-yql/src/main/java/org/apache/camel/component/yql/configuration/YqlConfiguration.java b/components/camel-yql/src/main/java/org/apache/camel/component/yql/configuration/YqlConfiguration.java index a9b0555..d459d30 100644 --- a/components/camel-yql/src/main/java/org/apache/camel/component/yql/configuration/YqlConfiguration.java +++ b/components/camel-yql/src/main/java/org/apache/camel/component/yql/configuration/YqlConfiguration.java @@ -145,7 +145,7 @@ public class YqlConfiguration { /** * Enables lossless JSON processing. The only allowed value is new. - * More information https://developer.yahoo.com/yql/guide/response.html#json-to-json= + * More information https://developer.yahoo.com/yql/guide/response.html#json-to-json */ public void setJsonCompat(final String jsonCompat) { this.jsonCompat = jsonCompat; diff --git a/parent/pom.xml b/parent/pom.xml index d3c2b9e..110e776 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -3551,6 +3551,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-yql-starter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-zendesk-starter</artifactId> <version>${project.version}</version> </dependency> diff --git a/platforms/spring-boot/components-starter/camel-yql-starter/src/main/java/org/apache/camel/component/yql/springboot/YqlComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-yql-starter/src/main/java/org/apache/camel/component/yql/springboot/YqlComponentConfiguration.java index 4b736b5..04aa63e 100644 --- a/platforms/spring-boot/components-starter/camel-yql-starter/src/main/java/org/apache/camel/component/yql/springboot/YqlComponentConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-yql-starter/src/main/java/org/apache/camel/component/yql/springboot/YqlComponentConfiguration.java @@ -23,7 +23,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.NestedConfigurationProperty; /** - * Camel Yahoo Query Language Component + * The YQL (Yahoo! Query Language) platform enables you to query filter and + * combine data across the web. * * Generated by camel-package-maven-plugin - do not edit this file! */ @@ -34,7 +35,7 @@ public class YqlComponentConfiguration ComponentConfigurationPropertiesCommon { /** - * Set the connection manager. + * To use a custom configured HttpClientConnectionManager. */ @NestedConfigurationProperty private HttpClientConnectionManager connectionManager; 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 2e960d9..bcf877a 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 @@ -2921,6 +2921,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-yql-starter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-zendesk</artifactId> <version>${project.version}</version> </dependency> -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
