This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 7dc41981c854b9bada7624307e559d5232bf98ee Author: Claus Ibsen <[email protected]> AuthorDate: Fri Nov 27 11:03:34 2026 +0100 CAMEL-23832: camel-geocoder - improve the component and option descriptions This commit rewrites the component description, the texts of 1 component option, 15 endpoint options and 10 headers of geocoder. The new texts say which options apply to Google and which to Nominatim, that a latitude and longitude takes precedence over an address, and that the address and latitude and longitude headers replace the path. The proxyAuthDomain and proxyAuthHost texts now say that the component does not use them. Documentation only, no behavior change. The component JSON, the catalog copy, the doc page header and the DSL are regenerated. camel-geocoder is marked as done in tasks/component-descriptions.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../apache/camel/catalog/components/geocoder.json | 54 ++++---- .../camel/catalog/docs/geocoder-component.adoc | 2 +- .../apache/camel/component/geocoder/geocoder.json | 54 ++++---- .../src/main/docs/geocoder-component.adoc | 2 +- .../component/geocoder/GeoCoderComponent.java | 9 +- .../component/geocoder/GeoCoderConstants.java | 38 ++++-- .../camel/component/geocoder/GeoCoderEndpoint.java | 104 +++++++-------- .../component/ComponentsBuilderFactory.java | 4 +- .../dsl/GeocoderComponentBuilderFactory.java | 12 +- .../builder/endpoint/EndpointHeaderBuilders.java | 4 +- .../builder/endpoint/StaticEndpointBuilders.java | 30 +++-- .../dsl/GeoCoderEndpointBuilderFactory.java | 140 +++++++++++++++------ tasks/component-descriptions.md | 2 +- 13 files changed, 265 insertions(+), 190 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/geocoder.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/geocoder.json index 986baee7d375..bc85c95804c3 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/geocoder.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/geocoder.json @@ -3,7 +3,7 @@ "kind": "component", "name": "geocoder", "title": "Geocoder", - "description": "Find geocodes (latitude and longitude) for a given address or the other way round.", + "description": "Look up the latitude and longitude of an address, or the address of a latitude and longitude, with Google or a Nominatim server.", "deprecated": false, "firstVersion": "2.12.0", "label": "api,search", @@ -26,19 +26,19 @@ "componentProperties": { "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 [...] "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] - "geoApiContext": { "index": 2, "kind": "property", "displayName": "Geo Api Context", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.google.maps.GeoApiContext", "deprecated": false, "autowired": false, "secret": false, "description": "Configuration for Google maps API" } + "geoApiContext": { "index": 2, "kind": "property", "displayName": "Geo Api Context", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.google.maps.GeoApiContext", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom com.google.maps.GeoApiContext for the requests to Google. When it is set, the apiKey, clientId, clientKey and proxy options of the endpoints are not used." } }, "headers": { - "CamelGeoCoderAddress": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The formatted address", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#ADDRESS" }, - "CamelGeoCoderLatlng": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The latitude and longitude of the location. Separated by comma.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#LATLNG" }, - "CamelGeoCoderLat": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The latitude of the location.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#LAT" }, - "CamelGeoCoderLng": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The longitude of the location.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#LNG" }, - "CamelGeoCoderStatus": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": true, "javaType": "org.apache.camel.component.geocoder.GeocoderStatus", "enum": [ "ERROR", "INVALID_REQUEST", "ACCESS_NOT_CONFIGURED", "OK", "OVER_QUERY_LIMIT", "OVER_DAILY_LIMIT", "REQUEST_DENIED", "UNKNOWN_ERROR", "ZERO_RESULTS" ], "deprecated": false, "autowired": false, "secret": false, "description": "Status code from the geocoder library. If status is Geocoder [...] - "CamelGeoCoderRegionCode": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The region code.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#REGION_CODE" }, - "CamelGeoCoderRegionName": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The region name.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#REGION_NAME" }, - "CamelGeoCoderCity": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The city long name.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#CITY" }, - "CamelGeoCoderCountryLong": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The country long name.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#COUNTRY_LONG" }, - "CamelGeoCoderCountryShort": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The country short name.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#COUNTRY_SHORT" }, + "CamelGeoCoderAddress": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The address. The producer reads it as the address to look up, which replaces the address of the endpoint, and sets it to the formatted address of the first result.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#ADDRESS" }, + "CamelGeoCoderLatlng": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The latitude and longitude, separated by a comma. The producer reads it as the location to look up, which replaces the latlng of the endpoint and takes precedence over an address, and sets it to the location of the first result. For Nominatim, it sets a space after [...] + "CamelGeoCoderLat": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The latitude of the first result, with 8 decimals.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#LAT" }, + "CamelGeoCoderLng": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The longitude of the first result, with 8 decimals.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#LNG" }, + "CamelGeoCoderStatus": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": true, "javaType": "org.apache.camel.component.geocoder.GeocoderStatus", "enum": [ "ERROR", "INVALID_REQUEST", "ACCESS_NOT_CONFIGURED", "OK", "OVER_QUERY_LIMIT", "OVER_DAILY_LIMIT", "REQUEST_DENIED", "UNKNOWN_ERROR", "ZERO_RESULTS" ], "deprecated": false, "autowired": false, "secret": false, "description": "The status of the lookup: OK, or ZERO_RESULTS when no place [...] + "CamelGeoCoderRegionCode": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The code of the first-level administrative area, such as a state. With Google, the short name of the administrative_area_level_1 address component, and with Nominatim the state_code of the address in upper case.", "constantName": "org.apache.camel.component.geo [...] + "CamelGeoCoderRegionName": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the first-level administrative area, such as a state. With Google, the long name of the administrative_area_level_1 address component, and with Nominatim the state of the address.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConsta [...] + "CamelGeoCoderCity": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the city. With Google, the long name of the locality address component, and with Nominatim the city of the address.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#CITY" }, + "CamelGeoCoderCountryLong": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the country, such as France.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#COUNTRY_LONG" }, + "CamelGeoCoderCountryShort": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The two-letter country code (ISO 3166-1 alpha-2) in upper case, such as FR.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#COUNTRY_SHORT" }, "CamelGeoCoderPostalCode": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The postal code.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#POSTAL_CODE" } }, "bodyTypes": { @@ -46,22 +46,22 @@ "producerOut": { "carriers": [ "list", "unchanged" ], "byOption": [ { "option": "type", "value": "NOMINATIM", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "headersOnly", "value": "true", "carriers": [ "unchanged" ] } ], "description": "With Google, the array of com.google.maps.model.GeocodingResult, empty for no results; unchanged when Google denies the request, with the status in the CamelGeoCoderStatus header. With Nominatim, its jsonv2 response as text: an [...] }, "properties": { - "address": { "index": 0, "kind": "path", "displayName": "Address", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The geo address which should be prefixed with address:" }, - "latlng": { "index": 1, "kind": "path", "displayName": "Latlng", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The geo latitude and longitude which should be prefixed with latlng:" }, - "headersOnly": { "index": 2, "kind": "parameter", "displayName": "Headers Only", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to only enrich the Exchange with headers, and leave the body as-is." }, + "address": { "index": 0, "kind": "path", "displayName": "Address", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The address to look up the latitude and longitude of, such as Paris, France, written after address: in the URI. With Google, the address current looks up the location of the IP address that the request comes from. The CamelGeoCoderAddress heade [...] + "latlng": { "index": 1, "kind": "path", "displayName": "Latlng", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The latitude and longitude to look up the address of, written after latlng: in the URI as two decimal numbers separated by a comma, such as 48.8566,2.3522. The CamelGeoCoderLatlng header replaces this option. A latitude and longitude, from this o [...] + "headersOnly": { "index": 2, "kind": "parameter", "displayName": "Headers Only", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to leave the message body as it is and only set the headers. If false, the producer sets the body to the result: an array of com.google.maps.model.GeocodingResult for Google, or the JSON response of Nominati [...] "language": { "index": 3, "kind": "parameter", "displayName": "Language", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "en", "description": "The language of the answer (such as the address, the country and the city), as a language code such as en, de or fr. It is sent as the accept-language parameter to Nominatim and as the language parameter to Google." }, - "serverUrl": { "index": 4, "kind": "parameter", "displayName": "Server URL", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "URL to the geocoder server. Mandatory for Nominatim server." }, - "type": { "index": 5, "kind": "parameter", "displayName": "GeoCoding Type", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.component.geocoder.GeoCoderType", "enum": [ "NOMINATIM", "GOOGLE" ], "deprecated": false, "autowired": false, "secret": false, "description": "Type of GeoCoding server. Supported Nominatim and Google." }, + "serverUrl": { "index": 4, "kind": "parameter", "displayName": "Server URL", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The base URL of the Nominatim server, such as https:\/\/nominatim.openstreetmap.org, to which the producer adds \/search or \/reverse. Required when type is NOMINATIM, and not used for Google." }, + "type": { "index": 5, "kind": "parameter", "displayName": "GeoCoding Type", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.component.geocoder.GeoCoderType", "enum": [ "NOMINATIM", "GOOGLE" ], "deprecated": false, "autowired": false, "secret": false, "description": "The geocoding service: GOOGLE for the Google Geocoding API, or NOMINATIM for the Nominatim server at serverUrl. If not set, Google is used." }, "lazyStartProducer": { "index": 6, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 produc [...] - "proxyAuthDomain": { "index": 7, "kind": "parameter", "displayName": "Proxy Auth Domain", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy Authentication Domain to access Google GeoCoding server." }, - "proxyAuthHost": { "index": 8, "kind": "parameter", "displayName": "Proxy Auth Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy Authentication Host to access Google GeoCoding server." }, - "proxyAuthMethod": { "index": 9, "kind": "parameter", "displayName": "Proxy Auth Method", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Authentication Method to Google GeoCoding server." }, - "proxyAuthPassword": { "index": 10, "kind": "parameter", "displayName": "Proxy Auth Password", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Proxy Password to access GeoCoding server." }, - "proxyAuthUsername": { "index": 11, "kind": "parameter", "displayName": "Proxy Auth Username", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy Username to access GeoCoding server." }, - "proxyHost": { "index": 12, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy Host to access GeoCoding server." }, - "proxyPort": { "index": 13, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy Port to access GeoCoding server." }, - "apiKey": { "index": 14, "kind": "parameter", "displayName": "Api Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "API Key to access Google. Mandatory for Google GeoCoding server." }, - "clientId": { "index": 15, "kind": "parameter", "displayName": "Client Id", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Client ID to access Google GeoCoding server." }, - "clientKey": { "index": 16, "kind": "parameter", "displayName": "Client Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Client Key to access Google GeoCoding server." } + "proxyAuthDomain": { "index": 7, "kind": "parameter", "displayName": "Proxy Auth Domain", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The domain for NTLM proxy authentication. The component does not use this option, as proxyAuthMethod accepts only Basic and Digest." }, + "proxyAuthHost": { "index": 8, "kind": "parameter", "displayName": "Proxy Auth Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The host for NTLM proxy authentication. The component does not use this option, as proxyAuthMethod accepts only Basic and Digest." }, + "proxyAuthMethod": { "index": 9, "kind": "parameter", "displayName": "Proxy Auth Method", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The authentication method for the proxy, Basic or Digest. When it is set, the producer authenticates to the proxy with proxyAuthUsername and proxyAuthPassword. Another value fails when the producer starts." }, + "proxyAuthPassword": { "index": 10, "kind": "parameter", "displayName": "Proxy Auth Password", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The password for the proxy authentication, used when proxyAuthMethod is set." }, + "proxyAuthUsername": { "index": 11, "kind": "parameter", "displayName": "Proxy Auth Username", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The user name for the proxy authentication, used when proxyAuthMethod is set." }, + "proxyHost": { "index": 12, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The host name of the HTTP proxy for the requests to Google. The proxy is used only when proxyPort is also set, and not for Nominatim." }, + "proxyPort": { "index": 13, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "The port of the HTTP proxy for the requests to Google. The proxy is used only when proxyHost is also set." }, + "apiKey": { "index": 14, "kind": "parameter", "displayName": "Api Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The API key of the Google Maps Platform, which the producer uses when clientId is not set. Google needs either this key or clientId and clientKey. It is not used for Nominatim." }, + "clientId": { "index": 15, "kind": "parameter", "displayName": "Client Id", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The client ID of the Google Maps Platform Premium Plan. When it is set, the producer signs the requests to Google with it and clientKey instead of using apiKey. The geolocation of the address current does n [...] + "clientKey": { "index": 16, "kind": "parameter", "displayName": "Client Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The URL signing secret (cryptographic key) that belongs to clientId, with which the producer signs the requests to Google." } } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/geocoder-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/geocoder-component.adoc index d59b7e832c36..2cafaf03f88e 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/geocoder-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/geocoder-component.adoc @@ -2,7 +2,7 @@ :doctitle: Geocoder :shortname: geocoder :artifactid: camel-geocoder -:description: Find geocodes (latitude and longitude) for a given address or the other way round. +:description: Look up the latitude and longitude of an address, or the address of a latitude and longitude, with Google or a Nominatim server. :since: 2.12 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-geocoder/src/generated/resources/META-INF/org/apache/camel/component/geocoder/geocoder.json b/components/camel-geocoder/src/generated/resources/META-INF/org/apache/camel/component/geocoder/geocoder.json index 986baee7d375..bc85c95804c3 100644 --- a/components/camel-geocoder/src/generated/resources/META-INF/org/apache/camel/component/geocoder/geocoder.json +++ b/components/camel-geocoder/src/generated/resources/META-INF/org/apache/camel/component/geocoder/geocoder.json @@ -3,7 +3,7 @@ "kind": "component", "name": "geocoder", "title": "Geocoder", - "description": "Find geocodes (latitude and longitude) for a given address or the other way round.", + "description": "Look up the latitude and longitude of an address, or the address of a latitude and longitude, with Google or a Nominatim server.", "deprecated": false, "firstVersion": "2.12.0", "label": "api,search", @@ -26,19 +26,19 @@ "componentProperties": { "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 [...] "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] - "geoApiContext": { "index": 2, "kind": "property", "displayName": "Geo Api Context", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.google.maps.GeoApiContext", "deprecated": false, "autowired": false, "secret": false, "description": "Configuration for Google maps API" } + "geoApiContext": { "index": 2, "kind": "property", "displayName": "Geo Api Context", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.google.maps.GeoApiContext", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom com.google.maps.GeoApiContext for the requests to Google. When it is set, the apiKey, clientId, clientKey and proxy options of the endpoints are not used." } }, "headers": { - "CamelGeoCoderAddress": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The formatted address", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#ADDRESS" }, - "CamelGeoCoderLatlng": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The latitude and longitude of the location. Separated by comma.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#LATLNG" }, - "CamelGeoCoderLat": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The latitude of the location.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#LAT" }, - "CamelGeoCoderLng": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The longitude of the location.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#LNG" }, - "CamelGeoCoderStatus": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": true, "javaType": "org.apache.camel.component.geocoder.GeocoderStatus", "enum": [ "ERROR", "INVALID_REQUEST", "ACCESS_NOT_CONFIGURED", "OK", "OVER_QUERY_LIMIT", "OVER_DAILY_LIMIT", "REQUEST_DENIED", "UNKNOWN_ERROR", "ZERO_RESULTS" ], "deprecated": false, "autowired": false, "secret": false, "description": "Status code from the geocoder library. If status is Geocoder [...] - "CamelGeoCoderRegionCode": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The region code.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#REGION_CODE" }, - "CamelGeoCoderRegionName": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The region name.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#REGION_NAME" }, - "CamelGeoCoderCity": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The city long name.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#CITY" }, - "CamelGeoCoderCountryLong": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The country long name.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#COUNTRY_LONG" }, - "CamelGeoCoderCountryShort": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The country short name.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#COUNTRY_SHORT" }, + "CamelGeoCoderAddress": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The address. The producer reads it as the address to look up, which replaces the address of the endpoint, and sets it to the formatted address of the first result.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#ADDRESS" }, + "CamelGeoCoderLatlng": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The latitude and longitude, separated by a comma. The producer reads it as the location to look up, which replaces the latlng of the endpoint and takes precedence over an address, and sets it to the location of the first result. For Nominatim, it sets a space after [...] + "CamelGeoCoderLat": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The latitude of the first result, with 8 decimals.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#LAT" }, + "CamelGeoCoderLng": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The longitude of the first result, with 8 decimals.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#LNG" }, + "CamelGeoCoderStatus": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": true, "javaType": "org.apache.camel.component.geocoder.GeocoderStatus", "enum": [ "ERROR", "INVALID_REQUEST", "ACCESS_NOT_CONFIGURED", "OK", "OVER_QUERY_LIMIT", "OVER_DAILY_LIMIT", "REQUEST_DENIED", "UNKNOWN_ERROR", "ZERO_RESULTS" ], "deprecated": false, "autowired": false, "secret": false, "description": "The status of the lookup: OK, or ZERO_RESULTS when no place [...] + "CamelGeoCoderRegionCode": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The code of the first-level administrative area, such as a state. With Google, the short name of the administrative_area_level_1 address component, and with Nominatim the state_code of the address in upper case.", "constantName": "org.apache.camel.component.geo [...] + "CamelGeoCoderRegionName": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the first-level administrative area, such as a state. With Google, the long name of the administrative_area_level_1 address component, and with Nominatim the state of the address.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConsta [...] + "CamelGeoCoderCity": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the city. With Google, the long name of the locality address component, and with Nominatim the city of the address.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#CITY" }, + "CamelGeoCoderCountryLong": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the country, such as France.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#COUNTRY_LONG" }, + "CamelGeoCoderCountryShort": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The two-letter country code (ISO 3166-1 alpha-2) in upper case, such as FR.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#COUNTRY_SHORT" }, "CamelGeoCoderPostalCode": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The postal code.", "constantName": "org.apache.camel.component.geocoder.GeoCoderConstants#POSTAL_CODE" } }, "bodyTypes": { @@ -46,22 +46,22 @@ "producerOut": { "carriers": [ "list", "unchanged" ], "byOption": [ { "option": "type", "value": "NOMINATIM", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "headersOnly", "value": "true", "carriers": [ "unchanged" ] } ], "description": "With Google, the array of com.google.maps.model.GeocodingResult, empty for no results; unchanged when Google denies the request, with the status in the CamelGeoCoderStatus header. With Nominatim, its jsonv2 response as text: an [...] }, "properties": { - "address": { "index": 0, "kind": "path", "displayName": "Address", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The geo address which should be prefixed with address:" }, - "latlng": { "index": 1, "kind": "path", "displayName": "Latlng", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The geo latitude and longitude which should be prefixed with latlng:" }, - "headersOnly": { "index": 2, "kind": "parameter", "displayName": "Headers Only", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to only enrich the Exchange with headers, and leave the body as-is." }, + "address": { "index": 0, "kind": "path", "displayName": "Address", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The address to look up the latitude and longitude of, such as Paris, France, written after address: in the URI. With Google, the address current looks up the location of the IP address that the request comes from. The CamelGeoCoderAddress heade [...] + "latlng": { "index": 1, "kind": "path", "displayName": "Latlng", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The latitude and longitude to look up the address of, written after latlng: in the URI as two decimal numbers separated by a comma, such as 48.8566,2.3522. The CamelGeoCoderLatlng header replaces this option. A latitude and longitude, from this o [...] + "headersOnly": { "index": 2, "kind": "parameter", "displayName": "Headers Only", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to leave the message body as it is and only set the headers. If false, the producer sets the body to the result: an array of com.google.maps.model.GeocodingResult for Google, or the JSON response of Nominati [...] "language": { "index": 3, "kind": "parameter", "displayName": "Language", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "en", "description": "The language of the answer (such as the address, the country and the city), as a language code such as en, de or fr. It is sent as the accept-language parameter to Nominatim and as the language parameter to Google." }, - "serverUrl": { "index": 4, "kind": "parameter", "displayName": "Server URL", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "URL to the geocoder server. Mandatory for Nominatim server." }, - "type": { "index": 5, "kind": "parameter", "displayName": "GeoCoding Type", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.component.geocoder.GeoCoderType", "enum": [ "NOMINATIM", "GOOGLE" ], "deprecated": false, "autowired": false, "secret": false, "description": "Type of GeoCoding server. Supported Nominatim and Google." }, + "serverUrl": { "index": 4, "kind": "parameter", "displayName": "Server URL", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The base URL of the Nominatim server, such as https:\/\/nominatim.openstreetmap.org, to which the producer adds \/search or \/reverse. Required when type is NOMINATIM, and not used for Google." }, + "type": { "index": 5, "kind": "parameter", "displayName": "GeoCoding Type", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.component.geocoder.GeoCoderType", "enum": [ "NOMINATIM", "GOOGLE" ], "deprecated": false, "autowired": false, "secret": false, "description": "The geocoding service: GOOGLE for the Google Geocoding API, or NOMINATIM for the Nominatim server at serverUrl. If not set, Google is used." }, "lazyStartProducer": { "index": 6, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 produc [...] - "proxyAuthDomain": { "index": 7, "kind": "parameter", "displayName": "Proxy Auth Domain", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy Authentication Domain to access Google GeoCoding server." }, - "proxyAuthHost": { "index": 8, "kind": "parameter", "displayName": "Proxy Auth Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy Authentication Host to access Google GeoCoding server." }, - "proxyAuthMethod": { "index": 9, "kind": "parameter", "displayName": "Proxy Auth Method", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Authentication Method to Google GeoCoding server." }, - "proxyAuthPassword": { "index": 10, "kind": "parameter", "displayName": "Proxy Auth Password", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Proxy Password to access GeoCoding server." }, - "proxyAuthUsername": { "index": 11, "kind": "parameter", "displayName": "Proxy Auth Username", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy Username to access GeoCoding server." }, - "proxyHost": { "index": 12, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy Host to access GeoCoding server." }, - "proxyPort": { "index": 13, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy Port to access GeoCoding server." }, - "apiKey": { "index": 14, "kind": "parameter", "displayName": "Api Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "API Key to access Google. Mandatory for Google GeoCoding server." }, - "clientId": { "index": 15, "kind": "parameter", "displayName": "Client Id", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Client ID to access Google GeoCoding server." }, - "clientKey": { "index": 16, "kind": "parameter", "displayName": "Client Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Client Key to access Google GeoCoding server." } + "proxyAuthDomain": { "index": 7, "kind": "parameter", "displayName": "Proxy Auth Domain", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The domain for NTLM proxy authentication. The component does not use this option, as proxyAuthMethod accepts only Basic and Digest." }, + "proxyAuthHost": { "index": 8, "kind": "parameter", "displayName": "Proxy Auth Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The host for NTLM proxy authentication. The component does not use this option, as proxyAuthMethod accepts only Basic and Digest." }, + "proxyAuthMethod": { "index": 9, "kind": "parameter", "displayName": "Proxy Auth Method", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The authentication method for the proxy, Basic or Digest. When it is set, the producer authenticates to the proxy with proxyAuthUsername and proxyAuthPassword. Another value fails when the producer starts." }, + "proxyAuthPassword": { "index": 10, "kind": "parameter", "displayName": "Proxy Auth Password", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The password for the proxy authentication, used when proxyAuthMethod is set." }, + "proxyAuthUsername": { "index": 11, "kind": "parameter", "displayName": "Proxy Auth Username", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The user name for the proxy authentication, used when proxyAuthMethod is set." }, + "proxyHost": { "index": 12, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The host name of the HTTP proxy for the requests to Google. The proxy is used only when proxyPort is also set, and not for Nominatim." }, + "proxyPort": { "index": 13, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "The port of the HTTP proxy for the requests to Google. The proxy is used only when proxyHost is also set." }, + "apiKey": { "index": 14, "kind": "parameter", "displayName": "Api Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The API key of the Google Maps Platform, which the producer uses when clientId is not set. Google needs either this key or clientId and clientKey. It is not used for Nominatim." }, + "clientId": { "index": 15, "kind": "parameter", "displayName": "Client Id", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The client ID of the Google Maps Platform Premium Plan. When it is set, the producer signs the requests to Google with it and clientKey instead of using apiKey. The geolocation of the address current does n [...] + "clientKey": { "index": 16, "kind": "parameter", "displayName": "Client Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The URL signing secret (cryptographic key) that belongs to clientId, with which the producer signs the requests to Google." } } } diff --git a/components/camel-geocoder/src/main/docs/geocoder-component.adoc b/components/camel-geocoder/src/main/docs/geocoder-component.adoc index d59b7e832c36..2cafaf03f88e 100644 --- a/components/camel-geocoder/src/main/docs/geocoder-component.adoc +++ b/components/camel-geocoder/src/main/docs/geocoder-component.adoc @@ -2,7 +2,7 @@ :doctitle: Geocoder :shortname: geocoder :artifactid: camel-geocoder -:description: Find geocodes (latitude and longitude) for a given address or the other way round. +:description: Look up the latitude and longitude of an address, or the address of a latitude and longitude, with Google or a Nominatim server. :since: 2.12 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderComponent.java b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderComponent.java index 78332a168f88..9e4b7868f63d 100644 --- a/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderComponent.java +++ b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderComponent.java @@ -30,7 +30,9 @@ import org.apache.camel.support.DefaultComponent; @Component("geocoder") public class GeoCoderComponent extends DefaultComponent { - @Metadata(label = "advanced") + @Metadata(label = "advanced", + description = "To use a custom com.google.maps.GeoApiContext for the requests to Google. When it is set, the" + + " apiKey, clientId, clientKey and proxy options of the endpoints are not used.") private GeoApiContext geoApiContext; public GeoCoderComponent() { @@ -59,11 +61,6 @@ public class GeoCoderComponent extends DefaultComponent { return geoApiContext; } - /** - * Configuration for Google maps API - * - * @param geoApiContext - */ public void setGeoApiContext(GeoApiContext geoApiContext) { this.geoApiContext = geoApiContext; } diff --git a/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderConstants.java b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderConstants.java index 24c93fb03357..f75ceaddc312 100644 --- a/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderConstants.java +++ b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderConstants.java @@ -20,27 +20,43 @@ import org.apache.camel.spi.Metadata; public final class GeoCoderConstants { - @Metadata(description = "The formatted address", javaType = "String") + @Metadata(description = "The address. The producer reads it as the address to look up, which replaces the address of" + + " the endpoint, and sets it to the formatted address of the first result.", + javaType = "String") public static final String ADDRESS = "CamelGeoCoderAddress"; - @Metadata(description = "The latitude and longitude of the location. Separated by comma.", javaType = "String") + @Metadata(description = "The latitude and longitude, separated by a comma. The producer reads it as the location to look" + + " up, which replaces the latlng of the endpoint and takes precedence over an address, and sets it" + + " to the location of the first result. For Nominatim, it sets a space after the comma.", + javaType = "String") public static final String LATLNG = "CamelGeoCoderLatlng"; - @Metadata(description = "The latitude of the location.", javaType = "String") + @Metadata(description = "The latitude of the first result, with 8 decimals.", javaType = "String") public static final String LAT = "CamelGeoCoderLat"; - @Metadata(description = "The longitude of the location.", javaType = "String") + @Metadata(description = "The longitude of the first result, with 8 decimals.", javaType = "String") public static final String LNG = "CamelGeoCoderLng"; - @Metadata(description = "Status code from the geocoder library. If status is\n" + - "`GeocoderStatus.OK` then additional headers is enriched", + @Metadata(description = "The status of the lookup: OK, or ZERO_RESULTS when no place is found. When Google rejects the" + + " request, it is REQUEST_DENIED, OVER_QUERY_LIMIT, OVER_DAILY_LIMIT, INVALID_REQUEST or" + + " UNKNOWN_ERROR, and for an error answer of Nominatim it is ERROR. The producer sets the other" + + " headers only when the status is OK, except that for the address current it sets" + + " CamelGeoCoderLatlng to the geolocated location also when the status is ZERO_RESULTS.", javaType = "org.apache.camel.component.geocoder.GeocoderStatus", required = true) public static final String STATUS = "CamelGeoCoderStatus"; - @Metadata(description = "The region code.", javaType = "String") + @Metadata(description = "The code of the first-level administrative area, such as a state. With Google, the short name" + + " of the administrative_area_level_1 address component, and with Nominatim the state_code of the" + + " address in upper case.", + javaType = "String") public static final String REGION_CODE = "CamelGeoCoderRegionCode"; - @Metadata(description = "The region name.", javaType = "String") + @Metadata(description = "The name of the first-level administrative area, such as a state. With Google, the long name" + + " of the administrative_area_level_1 address component, and with Nominatim the state of the" + + " address.", + javaType = "String") public static final String REGION_NAME = "CamelGeoCoderRegionName"; - @Metadata(description = "The city long name.", javaType = "String") + @Metadata(description = "The name of the city. With Google, the long name of the locality address component, and with" + + " Nominatim the city of the address.", + javaType = "String") public static final String CITY = "CamelGeoCoderCity"; - @Metadata(description = "The country long name.", javaType = "String") + @Metadata(description = "The name of the country, such as France.", javaType = "String") public static final String COUNTRY_LONG = "CamelGeoCoderCountryLong"; - @Metadata(description = "The country short name.", javaType = "String") + @Metadata(description = "The two-letter country code (ISO 3166-1 alpha-2) in upper case, such as FR.", javaType = "String") public static final String COUNTRY_SHORT = "CamelGeoCoderCountryShort"; @Metadata(description = "The postal code.", javaType = "String") public static final String POSTAL_CODE = "CamelGeoCoderPostalCode"; diff --git a/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java index 98ee4ff793a5..e1598d681538 100644 --- a/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java +++ b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java @@ -35,7 +35,8 @@ import org.apache.camel.spi.UriPath; import org.apache.camel.support.DefaultEndpoint; /** - * Find geocodes (latitude and longitude) for a given address or the other way round. + * Look up the latitude and longitude of an address, or the address of a latitude and longitude, with Google or a + * Nominatim server. */ @UriEndpoint(firstVersion = "2.12.0", scheme = "geocoder", title = "Geocoder", syntax = "geocoder:address:latlng", producerOnly = true, category = { Category.API, Category.SEARCH }, headersClass = GeoCoderConstants.class) @@ -55,41 +56,70 @@ import org.apache.camel.support.DefaultEndpoint; + " for a latitude and longitude. The first result is also in the headers")) public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointServiceLocation { - @UriPath + @UriPath(description = "The address to look up the latitude and longitude of, such as Paris, France, written after" + + " address: in the URI. With Google, the address current looks up the location of the IP address" + + " that the request comes from. The CamelGeoCoderAddress header replaces this option.") private String address; - @UriPath + @UriPath(description = "The latitude and longitude to look up the address of, written after latlng: in the URI as two" + + " decimal numbers separated by a comma, such as 48.8566,2.3522. The CamelGeoCoderLatlng header" + + " replaces this option. A latitude and longitude, from this option or the header, takes" + + " precedence over an address.") private String latlng; @UriParam(defaultValue = "en", description = "The language of the answer (such as the address, the country and the city), as a language code" + " such as en, de or fr. It is sent as the accept-language parameter to Nominatim and as the language" + " parameter to Google.") private String language = "en"; - @UriParam(label = "security", security = "secret", description = "Client ID to access Google GeoCoding server.") + @UriParam(label = "security", security = "secret", + description = "The client ID of the Google Maps Platform Premium Plan. When it is set, the producer signs the" + + " requests to Google with it and clientKey instead of using apiKey. The geolocation of the" + + " address current does not accept a client ID.") private String clientId; - @UriParam(label = "security", security = "secret", description = "Client Key to access Google GeoCoding server.") + @UriParam(label = "security", security = "secret", + description = "The URL signing secret (cryptographic key) that belongs to clientId, with which the producer" + + " signs the requests to Google.") private String clientKey; @UriParam(label = "security", security = "secret", - description = "API Key to access Google. Mandatory for Google GeoCoding server.") + description = "The API key of the Google Maps Platform, which the producer uses when clientId is not set." + + " Google needs either this key or clientId and clientKey. It is not used for Nominatim.") private String apiKey; - @UriParam(description = "URL to the geocoder server. Mandatory for Nominatim server.", displayName = "Server URL") + @UriParam(description = "The base URL of the Nominatim server, such as https://nominatim.openstreetmap.org, to which the" + + " producer adds /search or /reverse. Required when type is NOMINATIM, and not used for Google.", + displayName = "Server URL") private String serverUrl; - @UriParam + @UriParam(description = "Whether to leave the message body as it is and only set the headers. If false, the producer" + + " sets the body to the result: an array of com.google.maps.model.GeocodingResult for Google, or" + + " the JSON response of Nominatim as a String.") private boolean headersOnly; - @UriParam(label = "proxy", description = "Proxy Host to access GeoCoding server.") + @UriParam(label = "proxy", + description = "The host name of the HTTP proxy for the requests to Google. The proxy is used only when" + + " proxyPort is also set, and not for Nominatim.") private String proxyHost; - @UriParam(label = "proxy", description = "Proxy Port to access GeoCoding server.") + @UriParam(label = "proxy", + description = "The port of the HTTP proxy for the requests to Google. The proxy is used only when proxyHost is" + + " also set.") private Integer proxyPort; - @UriParam(label = "proxy", description = "Authentication Method to Google GeoCoding server.") + @UriParam(label = "proxy", + description = "The authentication method for the proxy, Basic or Digest. When it is set, the producer" + + " authenticates to the proxy with proxyAuthUsername and proxyAuthPassword. Another value fails" + + " when the producer starts.") private String proxyAuthMethod; - @UriParam(label = "proxy", description = "Proxy Username to access GeoCoding server.") + @UriParam(label = "proxy", description = "The user name for the proxy authentication, used when proxyAuthMethod is set.") private String proxyAuthUsername; - @UriParam(label = "proxy", security = "secret", description = "Proxy Password to access GeoCoding server.") + @UriParam(label = "proxy", security = "secret", + description = "The password for the proxy authentication, used when proxyAuthMethod is set.") private String proxyAuthPassword; - @UriParam(label = "proxy", description = "Proxy Authentication Domain to access Google GeoCoding server.") + @UriParam(label = "proxy", + description = "The domain for NTLM proxy authentication. The component does not use this option, as" + + " proxyAuthMethod accepts only Basic and Digest.") private String proxyAuthDomain; - @UriParam(label = "proxy", description = "Proxy Authentication Host to access Google GeoCoding server.") + @UriParam(label = "proxy", + description = "The host for NTLM proxy authentication. The component does not use this option, as" + + " proxyAuthMethod accepts only Basic and Digest.") private String proxyAuthHost; - @UriParam(displayName = "GeoCoding Type", description = "Type of GeoCoding server. Supported Nominatim and Google.") + @UriParam(displayName = "GeoCoding Type", + description = "The geocoding service: GOOGLE for the Google Geocoding API, or NOMINATIM for the Nominatim" + + " server at serverUrl. If not set, Google is used.") private GeoCoderType type; public GeoCoderEndpoint() { @@ -130,9 +160,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return language; } - /** - * The language of the answer, as a language code such as en, de or fr. - */ public void setLanguage(String language) { this.language = language; } @@ -141,9 +168,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return address; } - /** - * The geo address which should be prefixed with <tt>address:</tt> - */ public void setAddress(String address) { this.address = address; } @@ -152,9 +176,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return latlng; } - /** - * The geo latitude and longitude which should be prefixed with <tt>latlng:</tt> - */ public void setLatlng(String latlng) { this.latlng = latlng; } @@ -163,9 +184,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return headersOnly; } - /** - * Whether to only enrich the Exchange with headers, and leave the body as-is. - */ public void setHeadersOnly(boolean headersOnly) { this.headersOnly = headersOnly; } @@ -174,9 +192,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return clientId; } - /** - * To use google premium with this client id - */ public void setClientId(String clientId) { this.clientId = clientId; } @@ -185,9 +200,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return clientKey; } - /** - * To use google premium with this client key - */ public void setClientKey(String clientKey) { this.clientKey = clientKey; } @@ -196,9 +208,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return apiKey; } - /** - * To use google apiKey - */ public void setApiKey(String apiKey) { this.apiKey = apiKey; } @@ -207,9 +216,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return proxyHost; } - /** - * The proxy host name - */ public void setProxyHost(String proxyHost) { this.proxyHost = proxyHost; } @@ -218,9 +224,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return proxyPort; } - /** - * The proxy port number - */ public void setProxyPort(int proxyPort) { this.proxyPort = proxyPort; } @@ -229,9 +232,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return proxyAuthMethod; } - /** - * Authentication method for proxy, either as Basic, Digest or NTLM. - */ public void setProxyAuthMethod(String proxyAuthMethod) { this.proxyAuthMethod = proxyAuthMethod; } @@ -240,9 +240,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return proxyAuthUsername; } - /** - * Username for proxy authentication - */ public void setProxyAuthUsername(String proxyAuthUsername) { this.proxyAuthUsername = proxyAuthUsername; } @@ -251,9 +248,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return proxyAuthPassword; } - /** - * Password for proxy authentication - */ public void setProxyAuthPassword(String proxyAuthPassword) { this.proxyAuthPassword = proxyAuthPassword; } @@ -262,9 +256,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return proxyAuthDomain; } - /** - * Domain for proxy NTML authentication - */ public void setProxyAuthDomain(String proxyAuthDomain) { this.proxyAuthDomain = proxyAuthDomain; } @@ -273,9 +264,6 @@ public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointService return proxyAuthHost; } - /** - * Optional host for proxy NTML authentication - */ public void setProxyAuthHost(String proxyAuthHost) { this.proxyAuthHost = proxyAuthHost; } diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java index 10ddc9ea5ad3..831dafe42cfa 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java @@ -1961,8 +1961,8 @@ public interface ComponentsBuilderFactory { } /** * Geocoder (camel-geocoder) - * Find geocodes (latitude and longitude) for a given address or the other - * way round. + * Look up the latitude and longitude of an address, or the address of a + * latitude and longitude, with Google or a Nominatim server. * * Category: api,search * Since: 2.12 diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GeocoderComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GeocoderComponentBuilderFactory.java index b2fafe4a8bc2..acb92402406d 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GeocoderComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GeocoderComponentBuilderFactory.java @@ -24,8 +24,8 @@ import org.apache.camel.builder.component.ComponentBuilder; import org.apache.camel.component.geocoder.GeoCoderComponent; /** - * Find geocodes (latitude and longitude) for a given address or the other way - * round. + * Look up the latitude and longitude of an address, or the address of a + * latitude and longitude, with Google or a Nominatim server. * * Generated by camel build tools - do NOT edit this file! */ @@ -34,8 +34,8 @@ public interface GeocoderComponentBuilderFactory { /** * Geocoder (camel-geocoder) - * Find geocodes (latitude and longitude) for a given address or the other - * way round. + * Look up the latitude and longitude of an address, or the address of a + * latitude and longitude, with Google or a Nominatim server. * * Category: api,search * Since: 2.12 @@ -100,7 +100,9 @@ public interface GeocoderComponentBuilderFactory { } /** - * Configuration for Google maps API. + * To use a custom com.google.maps.GeoApiContext for the requests to + * Google. When it is set, the apiKey, clientId, clientKey and proxy + * options of the endpoints are not used. * * The option is a: * <code>com.google.maps.GeoApiContext</code> type. diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java index a81bcf3a6933..3be4ab680989 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java @@ -1551,8 +1551,8 @@ public class EndpointHeaderBuilders { } /** * Geocoder (camel-geocoder) - * Find geocodes (latitude and longitude) for a given address or the other - * way round. + * Look up the latitude and longitude of an address, or the address of a + * latitude and longitude, with Google or a Nominatim server. * * Category: api,search * Since: 2.12 diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index aedda0e86bfd..4fbcb06747da 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -6467,8 +6467,8 @@ public class StaticEndpointBuilders { } /** * Geocoder (camel-geocoder) - * Find geocodes (latitude and longitude) for a given address or the other - * way round. + * Look up the latitude and longitude of an address, or the address of a + * latitude and longitude, with Google or a Nominatim server. * * Category: api,search * Since: 2.12 @@ -6477,10 +6477,17 @@ public class StaticEndpointBuilders { * Syntax: <code>geocoder:address:latlng</code> * * Path parameter: address - * The geo address which should be prefixed with address: + * The address to look up the latitude and longitude of, such as Paris, + * France, written after address: in the URI. With Google, the address + * current looks up the location of the IP address that the request comes + * from. The CamelGeoCoderAddress header replaces this option. * * Path parameter: latlng - * The geo latitude and longitude which should be prefixed with latlng: + * The latitude and longitude to look up the address of, written after + * latlng: in the URI as two decimal numbers separated by a comma, such as + * 48.8566,2.3522. The CamelGeoCoderLatlng header replaces this option. A + * latitude and longitude, from this option or the header, takes precedence + * over an address. * * @param path address:latlng * @return the dsl builder @@ -6490,8 +6497,8 @@ public class StaticEndpointBuilders { } /** * Geocoder (camel-geocoder) - * Find geocodes (latitude and longitude) for a given address or the other - * way round. + * Look up the latitude and longitude of an address, or the address of a + * latitude and longitude, with Google or a Nominatim server. * * Category: api,search * Since: 2.12 @@ -6500,10 +6507,17 @@ public class StaticEndpointBuilders { * Syntax: <code>geocoder:address:latlng</code> * * Path parameter: address - * The geo address which should be prefixed with address: + * The address to look up the latitude and longitude of, such as Paris, + * France, written after address: in the URI. With Google, the address + * current looks up the location of the IP address that the request comes + * from. The CamelGeoCoderAddress header replaces this option. * * Path parameter: latlng - * The geo latitude and longitude which should be prefixed with latlng: + * The latitude and longitude to look up the address of, written after + * latlng: in the URI as two decimal numbers separated by a comma, such as + * 48.8566,2.3522. The CamelGeoCoderLatlng header replaces this option. A + * latitude and longitude, from this option or the header, takes precedence + * over an address. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GeoCoderEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GeoCoderEndpointBuilderFactory.java index 619a17154d1a..58d766203831 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GeoCoderEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GeoCoderEndpointBuilderFactory.java @@ -27,8 +27,8 @@ import org.apache.camel.builder.EndpointProducerBuilder; import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; /** - * Find geocodes (latitude and longitude) for a given address or the other way - * round. + * Look up the latitude and longitude of an address, or the address of a + * latitude and longitude, with Google or a Nominatim server. * * Generated by camel build tools - do NOT edit this file! */ @@ -46,8 +46,10 @@ public interface GeoCoderEndpointBuilderFactory { } /** - * Whether to only enrich the Exchange with headers, and leave the body - * as-is. + * Whether to leave the message body as it is and only set the headers. + * If false, the producer sets the body to the result: an array of + * com.google.maps.model.GeocodingResult for Google, or the JSON + * response of Nominatim as a String. * * The option is a: <code>boolean</code> type. * @@ -62,8 +64,10 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Whether to only enrich the Exchange with headers, and leave the body - * as-is. + * Whether to leave the message body as it is and only set the headers. + * If false, the producer sets the body to the result: an array of + * com.google.maps.model.GeocodingResult for Google, or the JSON + * response of Nominatim as a String. * * The option will be converted to a <code>boolean</code> type. * @@ -96,7 +100,10 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * URL to the geocoder server. Mandatory for Nominatim server. + * The base URL of the Nominatim server, such as + * https://nominatim.openstreetmap.org, to which the producer adds + * /search or /reverse. Required when type is NOMINATIM, and not used + * for Google. * * The option is a: <code>java.lang.String</code> type. * @@ -110,7 +117,9 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Type of GeoCoding server. Supported Nominatim and Google. + * The geocoding service: GOOGLE for the Google Geocoding API, or + * NOMINATIM for the Nominatim server at serverUrl. If not set, Google + * is used. * * The option is a: * <code>org.apache.camel.component.geocoder.GeoCoderType</code> type. @@ -125,7 +134,9 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Type of GeoCoding server. Supported Nominatim and Google. + * The geocoding service: GOOGLE for the Google Geocoding API, or + * NOMINATIM for the Nominatim server at serverUrl. If not set, Google + * is used. * * The option will be converted to a * <code>org.apache.camel.component.geocoder.GeoCoderType</code> type. @@ -140,7 +151,8 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Proxy Authentication Domain to access Google GeoCoding server. + * The domain for NTLM proxy authentication. The component does not use + * this option, as proxyAuthMethod accepts only Basic and Digest. * * The option is a: <code>java.lang.String</code> type. * @@ -154,7 +166,8 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Proxy Authentication Host to access Google GeoCoding server. + * The host for NTLM proxy authentication. The component does not use + * this option, as proxyAuthMethod accepts only Basic and Digest. * * The option is a: <code>java.lang.String</code> type. * @@ -168,7 +181,9 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Authentication Method to Google GeoCoding server. + * The authentication method for the proxy, Basic or Digest. When it is + * set, the producer authenticates to the proxy with proxyAuthUsername + * and proxyAuthPassword. Another value fails when the producer starts. * * The option is a: <code>java.lang.String</code> type. * @@ -182,7 +197,8 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Proxy Password to access GeoCoding server. + * The password for the proxy authentication, used when proxyAuthMethod + * is set. * * The option is a: <code>java.lang.String</code> type. * @@ -196,7 +212,8 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Proxy Username to access GeoCoding server. + * The user name for the proxy authentication, used when proxyAuthMethod + * is set. * * The option is a: <code>java.lang.String</code> type. * @@ -210,7 +227,8 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Proxy Host to access GeoCoding server. + * The host name of the HTTP proxy for the requests to Google. The proxy + * is used only when proxyPort is also set, and not for Nominatim. * * The option is a: <code>java.lang.String</code> type. * @@ -224,7 +242,8 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Proxy Port to access GeoCoding server. + * The port of the HTTP proxy for the requests to Google. The proxy is + * used only when proxyHost is also set. * * The option is a: <code>java.lang.Integer</code> type. * @@ -238,7 +257,8 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Proxy Port to access GeoCoding server. + * The port of the HTTP proxy for the requests to Google. The proxy is + * used only when proxyHost is also set. * * The option will be converted to a <code>java.lang.Integer</code> * type. @@ -253,7 +273,9 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * API Key to access Google. Mandatory for Google GeoCoding server. + * The API key of the Google Maps Platform, which the producer uses when + * clientId is not set. Google needs either this key or clientId and + * clientKey. It is not used for Nominatim. * * The option is a: <code>java.lang.String</code> type. * @@ -267,7 +289,10 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Client ID to access Google GeoCoding server. + * The client ID of the Google Maps Platform Premium Plan. When it is + * set, the producer signs the requests to Google with it and clientKey + * instead of using apiKey. The geolocation of the address current does + * not accept a client ID. * * The option is a: <code>java.lang.String</code> type. * @@ -281,7 +306,8 @@ public interface GeoCoderEndpointBuilderFactory { return this; } /** - * Client Key to access Google GeoCoding server. + * The URL signing secret (cryptographic key) that belongs to clientId, + * with which the producer signs the requests to Google. * * The option is a: <code>java.lang.String</code> type. * @@ -357,8 +383,8 @@ public interface GeoCoderEndpointBuilderFactory { public interface GeoCoderBuilders { /** * Geocoder (camel-geocoder) - * Find geocodes (latitude and longitude) for a given address or the - * other way round. + * Look up the latitude and longitude of an address, or the address of a + * latitude and longitude, with Google or a Nominatim server. * * Category: api,search * Since: 2.12 @@ -371,8 +397,8 @@ public interface GeoCoderEndpointBuilderFactory { } /** * Geocoder (camel-geocoder) - * Find geocodes (latitude and longitude) for a given address or the - * other way round. + * Look up the latitude and longitude of an address, or the address of a + * latitude and longitude, with Google or a Nominatim server. * * Category: api,search * Since: 2.12 @@ -381,10 +407,17 @@ public interface GeoCoderEndpointBuilderFactory { * Syntax: <code>geocoder:address:latlng</code> * * Path parameter: address - * The geo address which should be prefixed with address: + * The address to look up the latitude and longitude of, such as Paris, + * France, written after address: in the URI. With Google, the address + * current looks up the location of the IP address that the request + * comes from. The CamelGeoCoderAddress header replaces this option. * * Path parameter: latlng - * The geo latitude and longitude which should be prefixed with latlng: + * The latitude and longitude to look up the address of, written after + * latlng: in the URI as two decimal numbers separated by a comma, such + * as 48.8566,2.3522. The CamelGeoCoderLatlng header replaces this + * option. A latitude and longitude, from this option or the header, + * takes precedence over an address. * * @param path address:latlng * @return the dsl builder @@ -394,8 +427,8 @@ public interface GeoCoderEndpointBuilderFactory { } /** * Geocoder (camel-geocoder) - * Find geocodes (latitude and longitude) for a given address or the - * other way round. + * Look up the latitude and longitude of an address, or the address of a + * latitude and longitude, with Google or a Nominatim server. * * Category: api,search * Since: 2.12 @@ -404,10 +437,17 @@ public interface GeoCoderEndpointBuilderFactory { * Syntax: <code>geocoder:address:latlng</code> * * Path parameter: address - * The geo address which should be prefixed with address: + * The address to look up the latitude and longitude of, such as Paris, + * France, written after address: in the URI. With Google, the address + * current looks up the location of the IP address that the request + * comes from. The CamelGeoCoderAddress header replaces this option. * * Path parameter: latlng - * The geo latitude and longitude which should be prefixed with latlng: + * The latitude and longitude to look up the address of, written after + * latlng: in the URI as two decimal numbers separated by a comma, such + * as 48.8566,2.3522. The CamelGeoCoderLatlng header replaces this + * option. A latitude and longitude, from this option or the header, + * takes precedence over an address. * * @param componentName to use a custom component name for the endpoint * instead of the default name @@ -430,7 +470,9 @@ public interface GeoCoderEndpointBuilderFactory { public static final GeoCoderHeaderNameBuilder INSTANCE = new GeoCoderHeaderNameBuilder(); /** - * The formatted address. + * The address. The producer reads it as the address to look up, which + * replaces the address of the endpoint, and sets it to the formatted + * address of the first result. * * The option is a: {@code String} type. * @@ -442,7 +484,11 @@ public interface GeoCoderEndpointBuilderFactory { return "CamelGeoCoderAddress"; } /** - * The latitude and longitude of the location. Separated by comma. + * The latitude and longitude, separated by a comma. The producer reads + * it as the location to look up, which replaces the latlng of the + * endpoint and takes precedence over an address, and sets it to the + * location of the first result. For Nominatim, it sets a space after + * the comma. * * The option is a: {@code String} type. * @@ -454,7 +500,7 @@ public interface GeoCoderEndpointBuilderFactory { return "CamelGeoCoderLatlng"; } /** - * The latitude of the location. + * The latitude of the first result, with 8 decimals. * * The option is a: {@code String} type. * @@ -466,7 +512,7 @@ public interface GeoCoderEndpointBuilderFactory { return "CamelGeoCoderLat"; } /** - * The longitude of the location. + * The longitude of the first result, with 8 decimals. * * The option is a: {@code String} type. * @@ -478,8 +524,13 @@ public interface GeoCoderEndpointBuilderFactory { return "CamelGeoCoderLng"; } /** - * Status code from the geocoder library. If status is GeocoderStatus.OK - * then additional headers is enriched. + * The status of the lookup: OK, or ZERO_RESULTS when no place is found. + * When Google rejects the request, it is REQUEST_DENIED, + * OVER_QUERY_LIMIT, OVER_DAILY_LIMIT, INVALID_REQUEST or UNKNOWN_ERROR, + * and for an error answer of Nominatim it is ERROR. The producer sets + * the other headers only when the status is OK, except that for the + * address current it sets CamelGeoCoderLatlng to the geolocated + * location also when the status is ZERO_RESULTS. * * The option is a: {@code * org.apache.camel.component.geocoder.GeocoderStatus} type. @@ -493,7 +544,10 @@ public interface GeoCoderEndpointBuilderFactory { return "CamelGeoCoderStatus"; } /** - * The region code. + * The code of the first-level administrative area, such as a state. + * With Google, the short name of the administrative_area_level_1 + * address component, and with Nominatim the state_code of the address + * in upper case. * * The option is a: {@code String} type. * @@ -505,7 +559,9 @@ public interface GeoCoderEndpointBuilderFactory { return "CamelGeoCoderRegionCode"; } /** - * The region name. + * The name of the first-level administrative area, such as a state. + * With Google, the long name of the administrative_area_level_1 address + * component, and with Nominatim the state of the address. * * The option is a: {@code String} type. * @@ -517,7 +573,8 @@ public interface GeoCoderEndpointBuilderFactory { return "CamelGeoCoderRegionName"; } /** - * The city long name. + * The name of the city. With Google, the long name of the locality + * address component, and with Nominatim the city of the address. * * The option is a: {@code String} type. * @@ -529,7 +586,7 @@ public interface GeoCoderEndpointBuilderFactory { return "CamelGeoCoderCity"; } /** - * The country long name. + * The name of the country, such as France. * * The option is a: {@code String} type. * @@ -541,7 +598,8 @@ public interface GeoCoderEndpointBuilderFactory { return "CamelGeoCoderCountryLong"; } /** - * The country short name. + * The two-letter country code (ISO 3166-1 alpha-2) in upper case, such + * as FR. * * The option is a: {@code String} type. * diff --git a/tasks/component-descriptions.md b/tasks/component-descriptions.md index e31de4ce07a9..c436dc7feafa 100644 --- a/tasks/component-descriptions.md +++ b/tasks/component-descriptions.md @@ -180,7 +180,7 @@ or removes its row. | camel-fop | fop | | | camel-freemarker | freemarker | | | camel-ftp | ftp, ftps, sftp | | -| camel-geocoder | geocoder | | +| camel-geocoder | geocoder | yes | | camel-git | git | | | camel-github2 | github2 | | | camel-google-bigquery | google-bigquery, google-bigquery-sql | |
