diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/elasticsearch-rest-client.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/elasticsearch-rest-client.json index a5cf948bfd9d9..b084c06118066 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/elasticsearch-rest-client.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/elasticsearch-rest-client.json @@ -38,11 +38,11 @@ "user": { "index": 11, "kind": "property", "displayName": "User", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Username" } }, "headers": { - "ID": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "ID of the object to index or retrieve or delete", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#ID" }, - "SEARCH_QUERY": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JSON Query to perform for search", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#SEARCH_QUERY" }, - "INDEX_SETTINGS": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Advanced - The JSON Index Settings and\/or Mappings Query to perform to create an index", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_SETTINGS" }, - "INDEX_NAME": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Index name", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_NAME" }, - "OPERATION": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.elasticsearch.rest.client.ElasticsearchRestClientOperation", "enum": [ "INDEX_OR_UPDATE", "GET_BY_ID", "DELETE", "CREATE_INDEX", "DELETE_INDEX", "SEARCH" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#OPERATION" } + "CamelElasticsearchId": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "ID of the object to index or retrieve or delete", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#ID" }, + "CamelElasticsearchSearchQuery": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JSON Query to perform for search", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#SEARCH_QUERY" }, + "CamelElasticsearchIndexSettings": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Advanced - The JSON Index Settings and\/or Mappings Query to perform to create an index", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_SETTINGS" }, + "CamelElasticsearchIndexName": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Index name", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_NAME" }, + "CamelElasticsearchOperation": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.elasticsearch.rest.client.ElasticsearchRestClientOperation", "enum": [ "INDEX_OR_UPDATE", "GET_BY_ID", "DELETE", "CREATE_INDEX", "DELETE_INDEX", "SEARCH" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#OPERATION" } }, "properties": { "clusterName": { "index": 0, "kind": "path", "displayName": "Cluster Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Cluster Name" }, diff --git a/components/camel-elasticsearch-rest-client/src/generated/resources/META-INF/org/apache/camel/component/elasticsearch/rest/client/elasticsearch-rest-client.json b/components/camel-elasticsearch-rest-client/src/generated/resources/META-INF/org/apache/camel/component/elasticsearch/rest/client/elasticsearch-rest-client.json index a5cf948bfd9d9..b084c06118066 100644 --- a/components/camel-elasticsearch-rest-client/src/generated/resources/META-INF/org/apache/camel/component/elasticsearch/rest/client/elasticsearch-rest-client.json +++ b/components/camel-elasticsearch-rest-client/src/generated/resources/META-INF/org/apache/camel/component/elasticsearch/rest/client/elasticsearch-rest-client.json @@ -38,11 +38,11 @@ "user": { "index": 11, "kind": "property", "displayName": "User", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Username" } }, "headers": { - "ID": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "ID of the object to index or retrieve or delete", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#ID" }, - "SEARCH_QUERY": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JSON Query to perform for search", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#SEARCH_QUERY" }, - "INDEX_SETTINGS": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Advanced - The JSON Index Settings and\/or Mappings Query to perform to create an index", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_SETTINGS" }, - "INDEX_NAME": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Index name", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_NAME" }, - "OPERATION": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.elasticsearch.rest.client.ElasticsearchRestClientOperation", "enum": [ "INDEX_OR_UPDATE", "GET_BY_ID", "DELETE", "CREATE_INDEX", "DELETE_INDEX", "SEARCH" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#OPERATION" } + "CamelElasticsearchId": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "ID of the object to index or retrieve or delete", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#ID" }, + "CamelElasticsearchSearchQuery": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JSON Query to perform for search", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#SEARCH_QUERY" }, + "CamelElasticsearchIndexSettings": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Advanced - The JSON Index Settings and\/or Mappings Query to perform to create an index", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_SETTINGS" }, + "CamelElasticsearchIndexName": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Index name", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_NAME" }, + "CamelElasticsearchOperation": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.elasticsearch.rest.client.ElasticsearchRestClientOperation", "enum": [ "INDEX_OR_UPDATE", "GET_BY_ID", "DELETE", "CREATE_INDEX", "DELETE_INDEX", "SEARCH" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#OPERATION" } }, "properties": { "clusterName": { "index": 0, "kind": "path", "displayName": "Cluster Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Cluster Name" }, diff --git a/components/camel-elasticsearch-rest-client/src/main/docs/elasticsearch-rest-client-component.adoc b/components/camel-elasticsearch-rest-client/src/main/docs/elasticsearch-rest-client-component.adoc index ef10bccd473dd..7edde332bf8b1 100644 --- a/components/camel-elasticsearch-rest-client/src/main/docs/elasticsearch-rest-client-component.adoc +++ b/components/camel-elasticsearch-rest-client/src/main/docs/elasticsearch-rest-client-component.adoc @@ -63,14 +63,14 @@ You can set the name of the target index from the `indexName` URI parameter opti You must provide the index id of the content to delete either in the message body, or via a message header with the key `ID` . |`CREATE_INDEX` | |Creates the specified `indexName` and returns a `boolean` value as the message exchange body, indicating whether the operation was successful. -You can set the name of the target index to create from the `indexName` URI parameter option, or by providing a message header with the key `INDEX_NAME`. -You may also provide a header with the key `INDEX_SETTINGS` where the value is a JSON String representation of the index settings. +You can set the name of the target index to create from the `indexName` URI parameter option, or by providing a message header with the key `CamelElasticsearchIndexName`. +You may also provide a header with the key `CamelElasticsearchIndexSettings` where the value is a JSON String representation of the index settings. |`DELETE_INDEX` | |Deletes the specified `indexName` and returns a `boolean` value as the message exchange body, indicating whether the operation was successful. -You can set the name of the target index to create from the `indexName` URI parameter option, or by providing a message header with the key `INDEX_NAME`. +You can set the name of the target index to create from the `indexName` URI parameter option, or by providing a message header with the key `CamelElasticsearchIndexName`. |`SEARCH` |`Map` (optional) |Search for content with either a `Map` of `String` keys & values of query criteria. Or a JSON string representation of the query. Matching documents are returned as a JSON string set on the message exchange body. -You can set the JSON query String by providing a message header with the key `SEARCH_QUERY`. +You can set the JSON query String by providing a message header with the key `CamelElasticsearchSearchQuery`. You can set the message exchange body to a `Map` of `String` keys & values for the query criteria. |=== @@ -93,7 +93,7 @@ To update existing indexed content, provide the `ID` message header and the mess [source,java] ---- from("direct:index") - .setHeader("ID").constant("1") + .setHeader("CamelElasticsearchId").constant("1") .setBody().constant("{\"content\": \"ElasticSearch REST Client With Camel\"}") .to("elasticsearch-rest-client://myCluster?operation=INDEX_OR_UPDATE&indexName=myIndex"); ---- @@ -103,7 +103,7 @@ from("direct:index") [source,java] ---- from("direct:getById") - .setHeader("ID").constant("1") + .setHeader("CamelElasticsearchId").constant("1") .to("elasticsearch-rest-client://myCluster?operation=GET_BY_ID&indexName=myIndex"); ---- @@ -114,7 +114,7 @@ To delete indexed content, provide the `ID` message header. [source,java] ---- from("direct:getById") - .setHeader("ID").constant("1") + .setHeader("CamelElasticsearchId").constant("1") .to("elasticsearch-rest-client://myCluster?operation=DELETE&indexName=myIndex"); ---- @@ -138,7 +138,7 @@ String indexSettings = "{\"settings\":{\"number_of_replicas\": 1,\"number_of_sha [source,java] ---- from("direct:createIndex") - .setHeader("INDEX_SETTINGS").constant(indexSettings) + .setHeader("CamelElasticsearchIndexSettings").constant(indexSettings) .to("elasticsearch-rest-client://myCluster?operation=CREATE_INDEX&indexName=myIndex"); ---- @@ -159,7 +159,7 @@ Search with a JSON query. [source,java] ---- from("direct:search") - .setHeader("SEARCH_QUERY").constant("{\"query\":{\"match\":{\"content\":\"ElasticSearch With Camel\"}}}") + .setHeader("CamelElasticsearchSearchQuery").constant("{\"query\":{\"match\":{\"content\":\"ElasticSearch With Camel\"}}}") .to("elasticsearch-rest-client://myCluster?operation=SEARCH&indexName=myIndex"); ---- diff --git a/components/camel-elasticsearch-rest-client/src/main/java/org/apache/camel/component/elasticsearch/rest/client/ElasticSearchRestClientConstant.java b/components/camel-elasticsearch-rest-client/src/main/java/org/apache/camel/component/elasticsearch/rest/client/ElasticSearchRestClientConstant.java index c5a4623f3160d..d1ebaf42a72d9 100644 --- a/components/camel-elasticsearch-rest-client/src/main/java/org/apache/camel/component/elasticsearch/rest/client/ElasticSearchRestClientConstant.java +++ b/components/camel-elasticsearch-rest-client/src/main/java/org/apache/camel/component/elasticsearch/rest/client/ElasticSearchRestClientConstant.java @@ -21,21 +21,21 @@ public class ElasticSearchRestClientConstant { @Metadata(description = " ID of the object to index or retrieve or delete", javaType = "String") - public static final String ID = "ID"; + public static final String ID = "CamelElasticsearchId"; @Metadata(description = "The JSON Query to perform for search", javaType = "String") - public static final String SEARCH_QUERY = "SEARCH_QUERY"; + public static final String SEARCH_QUERY = "CamelElasticsearchSearchQuery"; @Metadata(description = "Advanced - The JSON Index Settings and/or Mappings Query to perform to create an index", javaType = "String") - public static final String INDEX_SETTINGS = "INDEX_SETTINGS"; + public static final String INDEX_SETTINGS = "CamelElasticsearchIndexSettings"; @Metadata(description = "The Index name", javaType = "String") - public static final String INDEX_NAME = "INDEX_NAME"; + public static final String INDEX_NAME = "CamelElasticsearchIndexName"; @Metadata(description = "The operation to perform", javaType = "org.apache.camel.component.elasticsearch.rest.client.ElasticsearchRestClientOperation") - public static final String OPERATION = "OPERATION"; + public static final String OPERATION = "CamelElasticsearchOperation"; public static final int SOCKET_CONNECTION_TIMEOUT = 30000; public static final int SNIFFER_INTERVAL_AND_FAILURE_DELAY = 60000; diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc index 5274a99639465..7b24ff12e0e3c 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc @@ -328,6 +328,29 @@ without changes. Routes that set the header by its literal string value (for example `setHeader("JGROUPS_DEST", ...)`) must be updated to use the new value (`setHeader("CamelJGroupsDest", ...)`). +=== camel-elasticsearch-rest-client + +The Exchange header constants in `ElasticSearchRestClientConstant` have been +renamed to follow the Camel naming convention used across the rest of the +component catalog. The Java field names are unchanged; only the header string +values have changed: + +[options="header"] +|=== +| Constant | Previous value | New value +| `ElasticSearchRestClientConstant.ID` | `ID` | `CamelElasticsearchId` +| `ElasticSearchRestClientConstant.SEARCH_QUERY` | `SEARCH_QUERY` | `CamelElasticsearchSearchQuery` +| `ElasticSearchRestClientConstant.INDEX_SETTINGS` | `INDEX_SETTINGS` | `CamelElasticsearchIndexSettings` +| `ElasticSearchRestClientConstant.INDEX_NAME` | `INDEX_NAME` | `CamelElasticsearchIndexName` +| `ElasticSearchRestClientConstant.OPERATION` | `OPERATION` | `CamelElasticsearchOperation` +|=== + +Routes that reference the constant symbolically (for example +`setHeader(ElasticSearchRestClientConstant.SEARCH_QUERY, ...)`) continue to +work without changes. Routes that set the header by its literal string value +(for example `setHeader("SEARCH_QUERY", ...)`) must be updated to use the +new value (`setHeader("CamelElasticsearchSearchQuery", ...)`). + === camel-aws2-s3 The `listObjects` operation now uses the `ListObjectsV2` AWS API instead of the deprecated `ListObjects` API. diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ElasticsearchRestClientEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ElasticsearchRestClientEndpointBuilderFactory.java index 7f20c6a328dda..2fb262566a8db 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ElasticsearchRestClientEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ElasticsearchRestClientEndpointBuilderFactory.java @@ -466,10 +466,10 @@ public static class ElasticsearchRestClientHeaderNameBuilder { * * Group: producer * - * @return the name of the header {@code ID}. + * @return the name of the header {@code ElasticsearchId}. */ - public String iD() { - return "ID"; + public String elasticsearchId() { + return "CamelElasticsearchId"; } /** * The JSON Query to perform for search. @@ -478,10 +478,10 @@ public String iD() { * * Group: producer * - * @return the name of the header {@code SEARCH_QUERY}. + * @return the name of the header {@code ElasticsearchSearchQuery}. */ - public String searchQuery() { - return "SEARCH_QUERY"; + public String elasticsearchSearchQuery() { + return "CamelElasticsearchSearchQuery"; } /** * Advanced - The JSON Index Settings and/or Mappings Query to perform @@ -491,10 +491,10 @@ public String searchQuery() { * * Group: producer * - * @return the name of the header {@code INDEX_SETTINGS}. + * @return the name of the header {@code ElasticsearchIndexSettings}. */ - public String indexSettings() { - return "INDEX_SETTINGS"; + public String elasticsearchIndexSettings() { + return "CamelElasticsearchIndexSettings"; } /** * The Index name. @@ -503,10 +503,10 @@ public String indexSettings() { * * Group: producer * - * @return the name of the header {@code INDEX_NAME}. + * @return the name of the header {@code ElasticsearchIndexName}. */ - public String indexName() { - return "INDEX_NAME"; + public String elasticsearchIndexName() { + return "CamelElasticsearchIndexName"; } /** * The operation to perform. @@ -516,10 +516,10 @@ public String indexName() { * * Group: producer * - * @return the name of the header {@code OPERATION}. + * @return the name of the header {@code ElasticsearchOperation}. */ - public String oPERATION() { - return "OPERATION"; + public String elasticsearchOperation() { + return "CamelElasticsearchOperation"; } } static ElasticsearchRestClientEndpointBuilder endpointBuilder(String componentName, String path) {