This is an automated email from the ASF dual-hosted git repository. nfilotto pushed a commit to branch CAMEL-17792/doc-message-headers in repository https://gitbox.apache.org/repos/asf/camel.git
commit 847474a2f8f6ea63f836da8f2e0b029232ba874e Author: Nicolas Filotto <[email protected]> AuthorDate: Wed Mar 16 09:11:22 2022 +0100 CAMEL-17792: Add doc about the message headers of camel-aws2-ddb --- .../apache/camel/component/aws2/ddb/aws2-ddb.json | 34 ++++ .../src/main/docs/aws2-ddb-component.adoc | 192 +-------------------- .../camel/component/aws2/ddb/Ddb2Constants.java | 75 ++++++++ .../camel/component/aws2/ddb/Ddb2Endpoint.java | 3 +- 4 files changed, 114 insertions(+), 190 deletions(-) diff --git a/components/camel-aws/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json b/components/camel-aws/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json index 85dd9f4..f239175 100644 --- a/components/camel-aws/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json +++ b/components/camel-aws/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json @@ -45,6 +45,40 @@ "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" }, "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" } }, + "headers": { + "CamelAwsDdbAttributes": { "kind": "header", "displayName": "", "group": "DeleteItem GetItem PutItem UpdateItem", "label": "DeleteItem GetItem PutItem UpdateItem", "required": false, "javaType": "Map<String, AttributeValue>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The list of attributes returned by the operation." }, + "CamelAwsDdbAttributeNames": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Collection<String>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "If attribute names are not specified then all attributes will be\nreturned." }, + "CamelAwsDdbBatchItems": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Map<String, KeysAndAttributes>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A map of the table name and corresponding items to get by primary key." }, + "CamelAwsDdbBatchResponse": { "kind": "header", "displayName": "", "group": "BatchGetItems", "label": "BatchGetItems", "required": false, "javaType": "Map<String, BatchResponse>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Table names and the respective item attributes from the tables." }, + "CamelAwsDdbConsistentRead": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "If set to true, then a consistent read is issued, otherwise eventually\nconsistent is used." }, + "CamelAwsDdbConsumedCapacity": { "kind": "header", "displayName": "", "group": "Query Scan", "label": "Query Scan", "required": false, "javaType": "Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of Capacity Units of the provisioned throughput of the table\nconsumed during the operation." }, + "CamelAwsDdbCount": { "kind": "header", "displayName": "", "group": "Query Scan", "label": "Query Scan", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Number of items in the response." }, + "CamelAwsDdbCreationDate": { "kind": "header", "displayName": "", "group": "DeleteTable DescribeTable", "label": "DeleteTable DescribeTable", "required": false, "javaType": "Date", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Creation DateTime of this table." }, + "CamelAwsDdbIndexName": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "If set will be used as Secondary Index for Query operation." }, + "CamelAwsDdbItem": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Map<String, AttributeValue>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A map of the attributes for the item, and must include the primary key\nvalues that define the item." }, + "CamelAwsDdbItems": { "kind": "header", "displayName": "", "group": "Query Scan", "label": "Query Scan", "required": false, "javaType": "List<Map<String,AttributeValue>>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The list of attributes returned by the operation." }, + "CamelAwsDdbTableItemCount": { "kind": "header", "displayName": "", "group": "DeleteTable DescribeTable", "label": "DeleteTable DescribeTable", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Item count for this table." }, + "CamelAwsDdbKey": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Map<String, AttributeValue>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The primary key that uniquely identifies each item in a table." }, + "CamelAwsDdbKeyConditions": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Map<String, Condition>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "This header specify the selection criteria for the\nquery, and merge together the two old headers *CamelAwsDdbHashKeyValue*\nand *CamelAwsDdbScanRangeKeyCondition*" }, + "CamelAwsDdbKeySchema": { "kind": "header", "displayName": "", "group": "DeleteTable DescribeTable", "label": "DeleteTable DescribeTable", "required": false, "javaType": "List<KeySchemaElement>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The KeySchema that identifies the primary key for this table.\n*From Camel 2.16.0 the type of this header is List<KeySchemaElement> and not KeySchema*" }, + "CamelAwsDdbLastEvaluatedKey": { "kind": "header", "displayName": "", "group": "Query Scan", "label": "Query Scan", "required": false, "javaType": "Key", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Primary key of the item where the query operation stopped, inclusive of\nthe previous result set." }, + "CamelAwsDdbLimit": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The maximum number of items to return." }, + "CamelAwsDdbOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.aws2.ddb.Ddb2Operations", "enum": [ "BatchGetItems", "DeleteItem", "DeleteTable", "DescribeTable", "GetItem", "PutItem", "Query", "Scan", "UpdateItem", "UpdateTable" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform." }, + "CamelAwsDdbProvisionedThroughput": { "kind": "header", "displayName": "", "group": "DeleteTable DescribeTable", "label": "DeleteTable DescribeTable", "required": false, "javaType": "software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughputDescription", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The value of the ProvisionedThroughput property for this table" }, + "CamelAwsDdbReadCapacity": { "kind": "header", "displayName": "", "group": "UpdateTable DescribeTable", "label": "UpdateTable DescribeTable", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "ReadCapacityUnits property of this table." }, + "CamelAwsDdbReturnValues": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Use this parameter if you want to get the attribute name-value pairs\nbefore or after they are modified(NONE, ALL_OLD, UPDATED_OLD, ALL_NEW,\nUPDATED_NEW)." }, + "CamelAwsDdbScannedCount": { "kind": "header", "displayName": "", "group": "Scan", "label": "Scan", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Number of items in the complete scan before any filters are applied." }, + "CamelAwsDdbScanIndexForward": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Specifies forward or backward traversal of the index." }, + "CamelAwsDdbScanFilter": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Map<String, Condition>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Evaluates the scan results and returns only the desired values." }, + "CamelAwsDdbStartKey": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Map<String, AttributeValue>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Primary key of the item from which to continue an earlier query." }, + "CamelAwsDdbTableName": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Table Name for this operation." }, + "CamelAwsDdbTableSize": { "kind": "header", "displayName": "", "group": "DeleteTable DescribeTable", "label": "DeleteTable DescribeTable", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The table size in bytes." }, + "CamelAwsDdbTableStatus": { "kind": "header", "displayName": "", "group": "DeleteTable DescribeTable", "label": "DeleteTable DescribeTable", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The status of the table: CREATING, UPDATING, DELETING, ACTIVE" }, + "CamelAwsDdbUpdateCondition": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Map<String, ExpectedAttributeValue>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Designates an attribute for a conditional modification." }, + "CamelAwsDdbUpdateValues": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Map<String, AttributeValueUpdate>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Map of attribute name to the new value and action for the update." }, + "CamelAwsDdbUnprocessedKeys": { "kind": "header", "displayName": "", "group": "BatchGetItems", "label": "BatchGetItems", "required": false, "javaType": "Map<String,KeysAndAttributes>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Contains a map of tables and their respective keys that were not\nprocessed with the current response." }, + "CamelAwsDdbWriteCapacity": { "kind": "header", "displayName": "", "group": "UpdateTable DescribeTable", "label": "UpdateTable DescribeTable", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "WriteCapacityUnits property of this table." } + }, "properties": { "tableName": { "kind": "path", "displayName": "Table Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The name of the table currently worked with." }, "amazonDDBClient": { "kind": "parameter", "displayName": "Amazon DDBClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.DynamoDbClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To use the AmazonDynamoDB as the client" }, diff --git a/components/camel-aws/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc b/components/camel-aws/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc index 3956a12..ceced4a 100644 --- a/components/camel-aws/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc +++ b/components/camel-aws/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc @@ -68,195 +68,9 @@ You have the possibility of avoiding the usage of explicit static credentials, b For more information about this you can look at https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html[AWS credentials documentation] -=== Message headers evaluated by the DDB producer - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Header |Type |Description - -|`CamelAwsDdbBatchItems` |`Map<String, KeysAndAttributes>` |A map of the table name and corresponding items to get by primary key. - -|`CamelAwsDdbTableName` |`String` |Table Name for this operation. - -|`CamelAwsDdbKey` |`Key` |The primary key that uniquely identifies each item in a table. - -|`CamelAwsDdbReturnValues` |`String` |Use this parameter if you want to get the attribute name-value pairs -before or after they are modified(NONE, ALL_OLD, UPDATED_OLD, ALL_NEW, -UPDATED_NEW). - -|`CamelAwsDdbUpdateCondition` |`Map<String, ExpectedAttributeValue>` |Designates an attribute for a conditional modification. - -|`CamelAwsDdbAttributeNames` |`Collection<String>` |If attribute names are not specified then all attributes will be -returned. - -|`CamelAwsDdbConsistentRead` |`Boolean` |If set to true, then a consistent read is issued, otherwise eventually -consistent is used. - -|`CamelAwsDdbIndexName` |`String` |If set will be used as Secondary Index for Query operation. - -|`CamelAwsDdbItem` |`Map<String, AttributeValue>` |A map of the attributes for the item, and must include the primary key -values that define the item. - -|`CamelAwsDdbExactCount` |`Boolean` |If set to true, Amazon DynamoDB returns a total number of items that -match the query parameters, instead of a list of the matching items and -their attributes. - -|`CamelAwsDdbKeyConditions` |`Map<String, Condition>` |This header specify the selection criteria for the -query, and merge together the two old headers *CamelAwsDdbHashKeyValue* -and *CamelAwsDdbScanRangeKeyCondition* - -|`CamelAwsDdbStartKey` |`Key` |Primary key of the item from which to continue an earlier query. - -|`CamelAwsDdbHashKeyValue` |`AttributeValue` |Value of the hash component of the composite primary key. - -|`CamelAwsDdbLimit` |`Integer` |The maximum number of items to return. - -|`CamelAwsDdbScanRangeKeyCondition` |`Condition` |A container for the attribute values and comparison operators to use for -the query. - -|`CamelAwsDdbScanIndexForward` |`Boolean` |Specifies forward or backward traversal of the index. - -|`CamelAwsDdbScanFilter` |`Map<String, Condition>` |Evaluates the scan results and returns only the desired values. - -|`CamelAwsDdbUpdateValues` |`Map<String, AttributeValueUpdate>` |Map of attribute name to the new value and action for the update. -|======================================================================= - -=== Message headers set during BatchGetItems operation - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Header |Type |Description - -|`CamelAwsDdbBatchResponse` |`Map<String,BatchResponse>` |Table names and the respective item attributes from the tables. - -|`CamelAwsDdbUnprocessedKeys` |`Map<String,KeysAndAttributes>` |Contains a map of tables and their respective keys that were not -processed with the current response. -|======================================================================= - -=== Message headers set during DeleteItem operation - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Header |Type |Description - -|`CamelAwsDdbAttributes` |`Map<String, AttributeValue>` |The list of attributes returned by the operation. -|======================================================================= - -=== Message headers set during DeleteTable operation - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Header |Type |Description - -|`CamelAwsDdbProvisionedThroughput`| | - -|`ProvisionedThroughputDescription` | |The value of the ProvisionedThroughput property for this table - -|`CamelAwsDdbCreationDate` |`Date` |Creation DateTime of this table. - -|`CamelAwsDdbTableItemCount` |`Long` |Item count for this table. - -|`CamelAwsDdbKeySchema` |`KeySchema` |The KeySchema that identifies the primary key for this table. -*From Camel 2.16.0 the type of this header is List<KeySchemaElement> and not KeySchema* - -|`CamelAwsDdbTableName` |`String` |The table name. - -|`CamelAwsDdbTableSize` |`Long` |The table size in bytes. - -|`CamelAwsDdbTableStatus` |`String` |The status of the table: CREATING, UPDATING, DELETING, ACTIVE -|======================================================================= - -=== Message headers set during DescribeTable operation - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Header |Type |Description - -|`CamelAwsDdbProvisionedThroughput` |{\{ProvisionedThroughputDescription}} |The value of the ProvisionedThroughput property for this table - -|`CamelAwsDdbCreationDate` |`Date` |Creation DateTime of this table. - -|`CamelAwsDdbTableItemCount` |`Long` |Item count for this table. - -|`CamelAwsDdbKeySchema` |{\{KeySchema}} |The KeySchema that identifies the primary key for this table. - - -|`CamelAwsDdbTableName` |`String` |The table name. - -|`CamelAwsDdbTableSize` |`Long` |The table size in bytes. - -|`CamelAwsDdbTableStatus` |`String` |The status of the table: CREATING, UPDATING, DELETING, ACTIVE - -|`CamelAwsDdbReadCapacity` |`Long` |ReadCapacityUnits property of this table. - -|`CamelAwsDdbWriteCapacity` |`Long` |WriteCapacityUnits property of this table. -|======================================================================= - -=== Message headers set during GetItem operation - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Header |Type |Description - -|`CamelAwsDdbAttributes` |`Map<String, AttributeValue>` |The list of attributes returned by the operation. - -|======================================================================= - -=== Message headers set during PutItem operation - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Header |Type |Description - -|`CamelAwsDdbAttributes` |`Map<String, AttributeValue>` |The list of attributes returned by the operation. - -|======================================================================= - -=== Message headers set during Query operation - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Header |Type |Description - -|`CamelAwsDdbItems` |`List<java.util.Map<String,AttributeValue>>` |The list of attributes returned by the operation. - -|`CamelAwsDdbLastEvaluatedKey` |`Key` |Primary key of the item where the query operation stopped, inclusive of -the previous result set. - -|`CamelAwsDdbConsumedCapacity` |`Double` |The number of Capacity Units of the provisioned throughput of the table -consumed during the operation. - -|`CamelAwsDdbCount` |`Integer` |Number of items in the response. -|======================================================================= - -=== Message headers set during Scan operation - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Header |Type |Description - -|`CamelAwsDdbItems` |`List<java.util.Map<String,AttributeValue>>` |The list of attributes returned by the operation. - -|`CamelAwsDdbLastEvaluatedKey` |`Key` |Primary key of the item where the query operation stopped, inclusive of -the previous result set. - -|`CamelAwsDdbConsumedCapacity` |`Double` |The number of Capacity Units of the provisioned throughput of the table -consumed during the operation. - -|`CamelAwsDdbCount` |`Integer` |Number of items in the response. - -|`CamelAwsDdbScannedCount` |`Integer` |Number of items in the complete scan before any filters are applied. -|======================================================================= - -=== Message headers set during UpdateItem operation - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Header |Type |Description - -|`CamelAwsDdbAttributes` |`Map<String, AttributeValue>` |The list of attributes returned by the operation. - -|======================================================================= +// component headers: START +include::partial$component-endpoint-headers.adoc[] +// component headers: END === Advanced AmazonDynamoDB configuration diff --git a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Constants.java b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Constants.java index dc0eb3c..10d6cc8 100644 --- a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Constants.java +++ b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Constants.java @@ -16,51 +16,126 @@ */ package org.apache.camel.component.aws2.ddb; +import org.apache.camel.spi.Metadata; + /** * Constants used in Camel AWS DynamoDB component */ public interface Ddb2Constants { + @Metadata(label = "DeleteItem GetItem PutItem UpdateItem", + description = "The list of attributes returned by the operation.", javaType = "Map<String, AttributeValue>") String ATTRIBUTES = "CamelAwsDdbAttributes"; + @Metadata(description = "If attribute names are not specified then all attributes will be\n" + + "returned.", + javaType = "Collection<String>") String ATTRIBUTE_NAMES = "CamelAwsDdbAttributeNames"; + @Metadata(description = "A map of the table name and corresponding items to get by primary key.", + javaType = "Map<String, KeysAndAttributes>") String BATCH_ITEMS = "CamelAwsDdbBatchItems"; + @Metadata(label = "BatchGetItems", description = "Table names and the respective item attributes from the tables.", + javaType = "Map<String, BatchResponse>") String BATCH_RESPONSE = "CamelAwsDdbBatchResponse"; + @Metadata(description = "If set to true, then a consistent read is issued, otherwise eventually\n" + + "consistent is used.", + javaType = "Boolean") String CONSISTENT_READ = "CamelAwsDdbConsistentRead"; + @Metadata(label = "Query Scan", description = "The number of Capacity Units of the provisioned throughput of the table\n" + + "consumed during the operation.", + javaType = "Double") String CONSUMED_CAPACITY = "CamelAwsDdbConsumedCapacity"; + @Metadata(label = "Query Scan", description = "Number of items in the response.", javaType = "Integer") String COUNT = "CamelAwsDdbCount"; + @Metadata(label = "DeleteTable DescribeTable", description = "Creation DateTime of this table.", javaType = "Date") String CREATION_DATE = "CamelAwsDdbCreationDate"; // Removed from DynamoDB v1 to v2 + // @Metadata(description = "If set to true, Amazon DynamoDB returns a total number of items that\n" + + // "match the query parameters, instead of a list of the matching items and\n" + + // "their attributes.", javaType = "Boolean") // String EXACT_COUNT = "CamelAwsDdbExactCount"; // Removed from DynamoDB v1 to v2 + // @Metadata(description = "Value of the hash component of the composite primary key.", javaType = "AttributeValue") // String HASH_KEY_VALUE = "CamelAwsDdbHashKeyValue"; // Added INDEX_NAME for querying secondary indexes + @Metadata(description = "If set will be used as Secondary Index for Query operation.", javaType = "String") String INDEX_NAME = "CamelAwsDdbIndexName"; + @Metadata(description = "A map of the attributes for the item, and must include the primary key\n" + + "values that define the item.", + javaType = "Map<String, AttributeValue>") String ITEM = "CamelAwsDdbItem"; + @Metadata(label = "Query Scan", description = "The list of attributes returned by the operation.", + javaType = "List<Map<String,AttributeValue>>") String ITEMS = "CamelAwsDdbItems"; + @Metadata(label = "DeleteTable DescribeTable", description = "Item count for this table.", javaType = "Long") String ITEM_COUNT = "CamelAwsDdbTableItemCount"; String ITEM_NAME = "CamelAwsDdbItemName"; String MESSAGE_ID = "CamelAwsDdbMessageId"; String NEXT_TOKEN = "CamelAwsDdbNextToken"; + @Metadata(description = "The primary key that uniquely identifies each item in a table.", + javaType = "Map<String, AttributeValue>") String KEY = "CamelAwsDdbKey"; // Added from DynamoDB v1 to v2 + @Metadata(description = "This header specify the selection criteria for the\n" + + "query, and merge together the two old headers *CamelAwsDdbHashKeyValue*\n" + + "and *CamelAwsDdbScanRangeKeyCondition*", + javaType = "Map<String, Condition>") String KEY_CONDITIONS = "CamelAwsDdbKeyConditions"; + @Metadata(label = "DeleteTable DescribeTable", + description = "The KeySchema that identifies the primary key for this table.\n" + + "*From Camel 2.16.0 the type of this header is List<KeySchemaElement> and not KeySchema*", + javaType = "List<KeySchemaElement>") String KEY_SCHEMA = "CamelAwsDdbKeySchema"; + @Metadata(label = "Query Scan", description = "Primary key of the item where the query operation stopped, inclusive of\n" + + "the previous result set.", + javaType = "Key") String LAST_EVALUATED_KEY = "CamelAwsDdbLastEvaluatedKey"; + @Metadata(description = "The maximum number of items to return.", javaType = "Integer") String LIMIT = "CamelAwsDdbLimit"; + @Metadata(description = "The operation to perform.", javaType = "org.apache.camel.component.aws2.ddb.Ddb2Operations") String OPERATION = "CamelAwsDdbOperation"; + @Metadata(label = "DeleteTable DescribeTable", + description = "The value of the ProvisionedThroughput property for this table", + javaType = "software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughputDescription") String PROVISIONED_THROUGHPUT = "CamelAwsDdbProvisionedThroughput"; + @Metadata(label = "UpdateTable DescribeTable", description = "ReadCapacityUnits property of this table.", javaType = "Long") String READ_CAPACITY = "CamelAwsDdbReadCapacity"; + @Metadata(description = "Use this parameter if you want to get the attribute name-value pairs\n" + + "before or after they are modified(NONE, ALL_OLD, UPDATED_OLD, ALL_NEW,\n" + + "UPDATED_NEW).", + javaType = "String") String RETURN_VALUES = "CamelAwsDdbReturnValues"; + @Metadata(label = "Scan", description = "Number of items in the complete scan before any filters are applied.", + javaType = "Integer") String SCANNED_COUNT = "CamelAwsDdbScannedCount"; + @Metadata(description = "Specifies forward or backward traversal of the index.", javaType = "Boolean") String SCAN_INDEX_FORWARD = "CamelAwsDdbScanIndexForward"; // Removed from DynamoDB v1 to v2 + // @Metadata(description = "A container for the attribute values and comparison operators to use for\n" + + // "the query.", javaType = "Condition") // String SCAN_RANGE_KEY_CONDITION = "CamelAwsDdbScanRangeKeyCondition"; + @Metadata(description = "Evaluates the scan results and returns only the desired values.", + javaType = "Map<String, Condition>") String SCAN_FILTER = "CamelAwsDdbScanFilter"; + @Metadata(description = "Primary key of the item from which to continue an earlier query.", + javaType = "Map<String, AttributeValue>") String START_KEY = "CamelAwsDdbStartKey"; + @Metadata(description = "Table Name for this operation.", javaType = "String") String TABLE_NAME = "CamelAwsDdbTableName"; + @Metadata(label = "DeleteTable DescribeTable", description = "The table size in bytes.", javaType = "Long") String TABLE_SIZE = "CamelAwsDdbTableSize"; + @Metadata(label = "DeleteTable DescribeTable", + description = "The status of the table: CREATING, UPDATING, DELETING, ACTIVE", javaType = "String") String TABLE_STATUS = "CamelAwsDdbTableStatus"; + @Metadata(description = "Designates an attribute for a conditional modification.", + javaType = "Map<String, ExpectedAttributeValue>") String UPDATE_CONDITION = "CamelAwsDdbUpdateCondition"; + @Metadata(description = "Map of attribute name to the new value and action for the update.", + javaType = "Map<String, AttributeValueUpdate>") String UPDATE_VALUES = "CamelAwsDdbUpdateValues"; + @Metadata(label = "BatchGetItems", description = "Contains a map of tables and their respective keys that were not\n" + + "processed with the current response.", + javaType = "Map<String,KeysAndAttributes>") String UNPROCESSED_KEYS = "CamelAwsDdbUnprocessedKeys"; + @Metadata(label = "UpdateTable DescribeTable", description = "WriteCapacityUnits property of this table.", + javaType = "Long") String WRITE_CAPACITY = "CamelAwsDdbWriteCapacity"; } diff --git a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Endpoint.java b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Endpoint.java index caec89d..cace6fc 100644 --- a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Endpoint.java +++ b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Endpoint.java @@ -50,7 +50,8 @@ import software.amazon.awssdk.services.dynamodb.model.TableStatus; * Store and retrieve data from AWS DynamoDB service using AWS SDK version 2.x. */ @UriEndpoint(firstVersion = "3.1.0", scheme = "aws2-ddb", title = "AWS DynamoDB", syntax = "aws2-ddb:tableName", - producerOnly = true, category = { Category.CLOUD, Category.DATABASE, Category.NOSQL }) + producerOnly = true, category = { Category.CLOUD, Category.DATABASE, Category.NOSQL }, + headersClass = Ddb2Constants.class) public class Ddb2Endpoint extends ScheduledPollEndpoint { private static final Logger LOG = LoggerFactory.getLogger(Ddb2Endpoint.class);
