From 18992960e0893f079e51b401013a7b69ce26580b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 14 Aug 2026 06:32:04 +0000 Subject: [PATCH 1/9] CAMEL-24373: Add camel-alibaba-ots Tablestore component (Phase 3) Implement producer-only alibaba-ots component using the native Tablestore SyncClient SDK with putRow, getRow, updateRow, deleteRow and listTables operations. Includes unit tests with Mockito, component documentation, and parent POM registrations. Co-authored-by: Omar Atie --- bom/camel-bom/pom.xml | 5 + catalog/camel-allcomponents/pom.xml | 5 + .../camel-alibaba/camel-alibaba-ots/pom.xml | 76 +++++++ .../alibaba/ots/OTSComponentConfigurer.java | 69 +++++++ .../alibaba/ots/OTSEndpointConfigurer.java | 89 +++++++++ .../alibaba/ots/OTSEndpointUriFactory.java | 88 ++++++++ .../component/alibaba/ots/alibaba-ots.json | 46 +++++ .../org/apache/camel/component.properties | 7 + .../org/apache/camel/component/alibaba-ots | 2 + .../camel/configurer/alibaba-ots-component | 2 + .../camel/configurer/alibaba-ots-endpoint | 2 + .../camel/urifactory/alibaba-ots-endpoint | 2 + .../src/main/docs/alibaba-ots-component.adoc | 73 +++++++ .../component/alibaba/ots/OTSComponent.java | 34 ++++ .../component/alibaba/ots/OTSEndpoint.java | 163 +++++++++++++++ .../component/alibaba/ots/OTSProducer.java | 106 ++++++++++ .../camel/component/alibaba/ots/OTSUtils.java | 189 ++++++++++++++++++ .../alibaba/ots/constants/OTSHeaders.java | 31 +++ .../alibaba/ots/constants/OTSOperations.java | 29 +++ .../alibaba/ots/constants/OTSProperties.java | 31 +++ .../ots/models/ClientConfigurations.java | 30 +++ .../component/alibaba/ots/DeleteRowTest.java | 88 ++++++++ .../component/alibaba/ots/GetRowTest.java | 103 ++++++++++ .../component/alibaba/ots/ListTablesTest.java | 80 ++++++++ .../alibaba/ots/OTSEndpointTest.java | 73 +++++++ .../component/alibaba/ots/PutRowTest.java | 88 ++++++++ .../alibaba/ots/TestConfiguration.java | 57 ++++++ .../component/alibaba/ots/UpdateRowTest.java | 88 ++++++++ .../ots/constants/OTSOperationsTest.java | 33 +++ .../src/test/resources/log4j2.properties | 29 +++ .../resources/testconfiguration.properties | 21 ++ components/camel-alibaba/pom.xml | 2 + coverage/pom.xml | 5 + parent/pom.xml | 17 ++ .../camel/maven/packaging/MojoHelper.java | 4 +- 35 files changed, 1766 insertions(+), 1 deletion(-) create mode 100644 components/camel-alibaba/camel-alibaba-ots/pom.xml create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSComponentConfigurer.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointConfigurer.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointUriFactory.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/org/apache/camel/component/alibaba/ots/alibaba-ots.json create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/component.properties create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-ots create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-component create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-endpoint create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-ots-endpoint create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/main/docs/alibaba-ots-component.adoc create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSComponent.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSEndpoint.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSProducer.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSUtils.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSHeaders.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSOperations.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSProperties.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/models/ClientConfigurations.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/DeleteRowTest.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/GetRowTest.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/ListTablesTest.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSEndpointTest.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/PutRowTest.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/TestConfiguration.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/UpdateRowTest.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/constants/OTSOperationsTest.java create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/test/resources/log4j2.properties create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/test/resources/testconfiguration.properties diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml index 5cacaac528582..919dd419ce909 100644 --- a/bom/camel-bom/pom.xml +++ b/bom/camel-bom/pom.xml @@ -106,6 +106,11 @@ camel-alibaba-oss 4.23.0-SNAPSHOT + + org.apache.camel + camel-alibaba-ots + 4.23.0-SNAPSHOT + org.apache.camel camel-alibaba-sms diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml index eb2ab055416e2..991470ba9cb03 100644 --- a/catalog/camel-allcomponents/pom.xml +++ b/catalog/camel-allcomponents/pom.xml @@ -112,6 +112,11 @@ camel-alibaba-oss ${project.version} + + org.apache.camel + camel-alibaba-ots + ${project.version} + org.apache.camel camel-alibaba-sms diff --git a/components/camel-alibaba/camel-alibaba-ots/pom.xml b/components/camel-alibaba/camel-alibaba-ots/pom.xml new file mode 100644 index 0000000000000..f9f45430bb0c0 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/pom.xml @@ -0,0 +1,76 @@ + + + + + 4.0.0 + + + org.apache.camel + camel-alibaba-parent + 4.23.0-SNAPSHOT + + + + 4.23.0 + + + camel-alibaba-ots + jar + Camel :: Alibaba Cloud :: Tablestore (OTS) + Camel Alibaba Cloud Tablestore (OTS) component + + + + org.apache.camel + camel-support + + + + org.apache.camel + camel-alibaba-common + ${project.version} + + + + com.aliyun.openservices + tablestore + + + + org.apache.camel + camel-test-junit6 + test + + + + org.assertj + assertj-core + test + + + + org.mockito + mockito-core + ${mockito-version} + test + + + + diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSComponentConfigurer.java b/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSComponentConfigurer.java new file mode 100644 index 0000000000000..cb5775e6bf4b5 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSComponentConfigurer.java @@ -0,0 +1,69 @@ +/* Generated by camel build tools - do NOT edit this file! */ +package org.apache.camel.component.alibaba.ots; + +import javax.annotation.processing.Generated; +import java.util.Map; + +import org.apache.camel.CamelContext; +import org.apache.camel.spi.ExtendedPropertyConfigurerGetter; +import org.apache.camel.spi.PropertyConfigurerGetter; +import org.apache.camel.spi.ConfigurerStrategy; +import org.apache.camel.spi.GeneratedPropertyConfigurer; +import org.apache.camel.util.CaseInsensitiveMap; +import org.apache.camel.support.component.PropertyConfigurerSupport; + +/** + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo") +@SuppressWarnings("unchecked") +public class OTSComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { + + @Override + public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { + OTSComponent target = (OTSComponent) obj; + switch (ignoreCase ? name.toLowerCase() : name) { + case "autowiredenabled": + case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true; + case "healthcheckconsumerenabled": + case "healthCheckConsumerEnabled": target.setHealthCheckConsumerEnabled(property(camelContext, boolean.class, value)); return true; + case "healthcheckproducerenabled": + case "healthCheckProducerEnabled": target.setHealthCheckProducerEnabled(property(camelContext, boolean.class, value)); return true; + case "lazystartproducer": + case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; + default: return false; + } + } + + @Override + public Class getOptionType(String name, boolean ignoreCase) { + switch (ignoreCase ? name.toLowerCase() : name) { + case "autowiredenabled": + case "autowiredEnabled": return boolean.class; + case "healthcheckconsumerenabled": + case "healthCheckConsumerEnabled": return boolean.class; + case "healthcheckproducerenabled": + case "healthCheckProducerEnabled": return boolean.class; + case "lazystartproducer": + case "lazyStartProducer": return boolean.class; + default: return null; + } + } + + @Override + public Object getOptionValue(Object obj, String name, boolean ignoreCase) { + OTSComponent target = (OTSComponent) obj; + switch (ignoreCase ? name.toLowerCase() : name) { + case "autowiredenabled": + case "autowiredEnabled": return target.isAutowiredEnabled(); + case "healthcheckconsumerenabled": + case "healthCheckConsumerEnabled": return target.isHealthCheckConsumerEnabled(); + case "healthcheckproducerenabled": + case "healthCheckProducerEnabled": return target.isHealthCheckProducerEnabled(); + case "lazystartproducer": + case "lazyStartProducer": return target.isLazyStartProducer(); + default: return null; + } + } +} + diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointConfigurer.java b/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointConfigurer.java new file mode 100644 index 0000000000000..cb1e536a01307 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointConfigurer.java @@ -0,0 +1,89 @@ +/* Generated by camel build tools - do NOT edit this file! */ +package org.apache.camel.component.alibaba.ots; + +import javax.annotation.processing.Generated; +import java.util.Map; + +import org.apache.camel.CamelContext; +import org.apache.camel.spi.ExtendedPropertyConfigurerGetter; +import org.apache.camel.spi.PropertyConfigurerGetter; +import org.apache.camel.spi.ConfigurerStrategy; +import org.apache.camel.spi.GeneratedPropertyConfigurer; +import org.apache.camel.util.CaseInsensitiveMap; +import org.apache.camel.support.component.PropertyConfigurerSupport; + +/** + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo") +@SuppressWarnings("unchecked") +public class OTSEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { + + @Override + public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { + OTSEndpoint target = (OTSEndpoint) obj; + switch (ignoreCase ? name.toLowerCase() : name) { + case "accesskey": + case "accessKey": target.setAccessKey(property(camelContext, java.lang.String.class, value)); return true; + case "endpoint": target.setEndpoint(property(camelContext, java.lang.String.class, value)); return true; + case "instancename": + case "instanceName": target.setInstanceName(property(camelContext, java.lang.String.class, value)); return true; + case "lazystartproducer": + case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; + case "otsclient": + case "otsClient": target.setOtsClient(property(camelContext, com.alicloud.openservices.tablestore.SyncClient.class, value)); return true; + case "secretkey": + case "secretKey": target.setSecretKey(property(camelContext, java.lang.String.class, value)); return true; + case "servicekeys": + case "serviceKeys": target.setServiceKeys(property(camelContext, org.apache.camel.component.alibaba.common.models.ServiceKeys.class, value)); return true; + default: return false; + } + } + + @Override + public String[] getAutowiredNames() { + return new String[]{"otsClient"}; + } + + @Override + public Class getOptionType(String name, boolean ignoreCase) { + switch (ignoreCase ? name.toLowerCase() : name) { + case "accesskey": + case "accessKey": return java.lang.String.class; + case "endpoint": return java.lang.String.class; + case "instancename": + case "instanceName": return java.lang.String.class; + case "lazystartproducer": + case "lazyStartProducer": return boolean.class; + case "otsclient": + case "otsClient": return com.alicloud.openservices.tablestore.SyncClient.class; + case "secretkey": + case "secretKey": return java.lang.String.class; + case "servicekeys": + case "serviceKeys": return org.apache.camel.component.alibaba.common.models.ServiceKeys.class; + default: return null; + } + } + + @Override + public Object getOptionValue(Object obj, String name, boolean ignoreCase) { + OTSEndpoint target = (OTSEndpoint) obj; + switch (ignoreCase ? name.toLowerCase() : name) { + case "accesskey": + case "accessKey": return target.getAccessKey(); + case "endpoint": return target.getEndpoint(); + case "instancename": + case "instanceName": return target.getInstanceName(); + case "lazystartproducer": + case "lazyStartProducer": return target.isLazyStartProducer(); + case "otsclient": + case "otsClient": return target.getOtsClient(); + case "secretkey": + case "secretKey": return target.getSecretKey(); + case "servicekeys": + case "serviceKeys": return target.getServiceKeys(); + default: return null; + } + } +} + diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointUriFactory.java b/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointUriFactory.java new file mode 100644 index 0000000000000..85f5a1221d3e0 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointUriFactory.java @@ -0,0 +1,88 @@ +/* Generated by camel build tools - do NOT edit this file! */ +package org.apache.camel.component.alibaba.ots; + +import javax.annotation.processing.Generated; +import java.net.URISyntaxException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.apache.camel.spi.EndpointUriFactory; + +/** + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.GenerateEndpointUriFactoryMojo") +public class OTSEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory { + + private static final String BASE = ":operation"; + + private static final Set PROPERTY_NAMES; + private static final Set SECRET_PROPERTY_NAMES; + private static final Set ENDPOINT_IDENTITY_PROPERTY_NAMES; + private static final Map MULTI_VALUE_PREFIXES; + static { + Set props = new HashSet<>(8); + props.add("accessKey"); + props.add("endpoint"); + props.add("instanceName"); + props.add("lazyStartProducer"); + props.add("operation"); + props.add("otsClient"); + props.add("secretKey"); + props.add("serviceKeys"); + PROPERTY_NAMES = Collections.unmodifiableSet(props); + Set secretProps = new HashSet<>(3); + secretProps.add("accessKey"); + secretProps.add("secretKey"); + secretProps.add("serviceKeys"); + SECRET_PROPERTY_NAMES = Collections.unmodifiableSet(secretProps); + ENDPOINT_IDENTITY_PROPERTY_NAMES = Collections.emptySet(); + MULTI_VALUE_PREFIXES = Collections.emptyMap(); + } + + @Override + public boolean isEnabled(String scheme) { + return "alibaba-ots".equals(scheme); + } + + @Override + public String buildUri(String scheme, Map properties, boolean encode) throws URISyntaxException { + String syntax = scheme + BASE; + String uri = syntax; + + Map copy = new HashMap<>(properties); + + uri = buildPathParameter(syntax, uri, "operation", null, true, copy); + uri = buildQueryParameters(uri, copy, encode); + return uri; + } + + @Override + public Set propertyNames() { + return PROPERTY_NAMES; + } + + @Override + public Set secretPropertyNames() { + return SECRET_PROPERTY_NAMES; + } + + @Override + public Set endpointIdentityPropertyNames() { + return ENDPOINT_IDENTITY_PROPERTY_NAMES; + } + + @Override + public Map multiValuePrefixes() { + return MULTI_VALUE_PREFIXES; + } + + @Override + public boolean isLenientProperties() { + return false; + } +} + diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/org/apache/camel/component/alibaba/ots/alibaba-ots.json b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/org/apache/camel/component/alibaba/ots/alibaba-ots.json new file mode 100644 index 0000000000000..442b35c56bb3f --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/org/apache/camel/component/alibaba/ots/alibaba-ots.json @@ -0,0 +1,46 @@ +{ + "component": { + "kind": "component", + "name": "alibaba-ots", + "title": "Alibaba Tablestore (OTS)", + "description": "Perform row operations on Alibaba Cloud Tablestore (OTS).", + "deprecated": false, + "firstVersion": "4.23.0", + "label": "cloud,database", + "javaType": "org.apache.camel.component.alibaba.ots.OTSComponent", + "supportLevel": "Preview", + "groupId": "org.apache.camel", + "artifactId": "camel-alibaba-ots", + "version": "4.23.0-SNAPSHOT", + "scheme": "alibaba-ots", + "extendsScheme": "", + "syntax": "alibaba-ots:operation", + "async": false, + "api": false, + "consumerOnly": false, + "producerOnly": true, + "lenientProperties": false, + "browsable": false, + "remote": true + }, + "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 during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "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 type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, + "healthCheckConsumerEnabled": { "index": 2, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, + "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } + }, + "headers": { + "CamelAlibabaOtsOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation override", "constantName": "org.apache.camel.component.alibaba.ots.constants.OTSHeaders#OPERATION" }, + "CamelAlibabaOtsRequestId": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore request id", "constantName": "org.apache.camel.component.alibaba.ots.constants.OTSHeaders#REQUEST_ID" } + }, + "properties": { + "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putRow", "getRow", "updateRow", "deleteRow", "listTables" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, + "endpoint": { "index": 1, "kind": "parameter", "displayName": "Endpoint", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore endpoint URL" }, + "instanceName": { "index": 2, "kind": "parameter", "displayName": "Instance Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore instance name" }, + "lazyStartProducer": { "index": 3, "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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "otsClient": { "index": 4, "kind": "parameter", "displayName": "OTS Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.alicloud.openservices.tablestore.SyncClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "description": "Autowire an existing Tablestore client instance" }, + "accessKey": { "index": 5, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Access key for the cloud user" }, + "secretKey": { "index": 6, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Secret key for the cloud user" }, + "serviceKeys": { "index": 7, "kind": "parameter", "displayName": "Service Keys", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.component.alibaba.common.models.ServiceKeys", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Configuration object for cloud service authentication" } + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/component.properties b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/component.properties new file mode 100644 index 0000000000000..00c62b232eecf --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/component.properties @@ -0,0 +1,7 @@ +# Generated by camel build tools - do NOT edit this file! +components=alibaba-ots +groupId=org.apache.camel +artifactId=camel-alibaba-ots +version=4.23.0-SNAPSHOT +projectName=Camel :: Alibaba Cloud :: Tablestore (OTS) +projectDescription=Camel Alibaba Cloud Tablestore (OTS) component diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-ots b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-ots new file mode 100644 index 0000000000000..91c7212fe1865 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-ots @@ -0,0 +1,2 @@ +# Generated by camel build tools - do NOT edit this file! +class=org.apache.camel.component.alibaba.ots.OTSComponent diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-component b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-component new file mode 100644 index 0000000000000..08d76a28352ef --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-component @@ -0,0 +1,2 @@ +# Generated by camel build tools - do NOT edit this file! +class=org.apache.camel.component.alibaba.ots.OTSComponentConfigurer diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-endpoint b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-endpoint new file mode 100644 index 0000000000000..915b9a8d6a443 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-endpoint @@ -0,0 +1,2 @@ +# Generated by camel build tools - do NOT edit this file! +class=org.apache.camel.component.alibaba.ots.OTSEndpointConfigurer diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-ots-endpoint b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-ots-endpoint new file mode 100644 index 0000000000000..d0c9ffcbf7828 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-ots-endpoint @@ -0,0 +1,2 @@ +# Generated by camel build tools - do NOT edit this file! +class=org.apache.camel.component.alibaba.ots.OTSEndpointUriFactory diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/docs/alibaba-ots-component.adoc b/components/camel-alibaba/camel-alibaba-ots/src/main/docs/alibaba-ots-component.adoc new file mode 100644 index 0000000000000..083d4e2558cca --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/docs/alibaba-ots-component.adoc @@ -0,0 +1,73 @@ += Alibaba Tablestore (OTS) Component +:doctitle: Alibaba Tablestore (OTS) +:shortname: alibaba-ots +:artifactid: camel-alibaba-ots +:description: Perform row operations on Alibaba Cloud Tablestore (OTS). +:since: 4.23 +:supportlevel: Preview +:tabs-sync-option: +:component-header: Only producer is supported +//Manually maintained attributes +:group: Alibaba Cloud + +*Since Camel {since}* + +*{component-header}* + +The Alibaba Cloud Tablestore (OTS) component allows you to perform row operations against a Tablestore instance using the native Tablestore SDK. + +Maven users will need to add the following dependency to their `pom.xml` +for this component: + +[source,xml] +---- + + org.apache.camel + camel-alibaba-ots + x.x.x + + +---- + +== URI format + +[source] +---- +alibaba-ots:operation[?options] +---- + +// component options: START +include::partial$component-configure-options.adoc[] +include::partial$component-endpoint-options.adoc[] +include::partial$component-endpoint-headers.adoc[] +// component options: END + +== Usage + +=== Operations + +The component supports the following operations: + +* `putRow` - insert a row (producer) +* `getRow` - read a row (producer) +* `updateRow` - update a row (producer) +* `deleteRow` - delete a row (producer) +* `listTables` - list tables in the instance (producer) + +For row operations, the exchange body must be the corresponding Tablestore SDK request type (`PutRowRequest`, `GetRowRequest`, `UpdateRowRequest`, or `DeleteRowRequest`). The `listTables` operation does not require a message body. + +=== Producer example + +[source,java] +---- +from("direct:start") + .process(exchange -> { + PutRowRequest request = new PutRowRequest(new RowPutChange("my-table", primaryKey)); + exchange.getMessage().setBody(request); + }) + .to("alibaba-ots:putRow?endpoint=https://my-instance.cn-hangzhou.ots.aliyuncs.com&instanceName=my-instance&accessKey=RAW(accessKey)&secretKey=RAW(secretKey)"); +---- + +== Examples + +For more examples, see the unit tests in the `camel-alibaba-ots` module. diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSComponent.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSComponent.java new file mode 100644 index 0000000000000..9efad6bc92dd0 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSComponent.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots; + +import java.util.Map; + +import org.apache.camel.Endpoint; +import org.apache.camel.spi.annotations.Component; +import org.apache.camel.support.HealthCheckComponent; + +@Component("alibaba-ots") +public class OTSComponent extends HealthCheckComponent { + + @Override + protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception { + OTSEndpoint endpoint = new OTSEndpoint(uri, remaining, this); + setProperties(endpoint, parameters); + return endpoint; + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSEndpoint.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSEndpoint.java new file mode 100644 index 0000000000000..9f1c78e530c4b --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSEndpoint.java @@ -0,0 +1,163 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots; + +import com.alicloud.openservices.tablestore.SyncClient; +import org.apache.camel.Category; +import org.apache.camel.Consumer; +import org.apache.camel.Processor; +import org.apache.camel.Producer; +import org.apache.camel.component.alibaba.common.models.ServiceKeys; +import org.apache.camel.component.alibaba.ots.constants.OTSHeaders; +import org.apache.camel.spi.Metadata; +import org.apache.camel.spi.UriEndpoint; +import org.apache.camel.spi.UriParam; +import org.apache.camel.spi.UriPath; +import org.apache.camel.support.DefaultEndpoint; + +/** + * Perform row operations on Alibaba Cloud Tablestore (OTS). + */ +@UriEndpoint(firstVersion = "4.23.0", scheme = "alibaba-ots", title = "Alibaba Tablestore (OTS)", + syntax = "alibaba-ots:operation", category = { Category.CLOUD, Category.DATABASE }, + headersClass = OTSHeaders.class, producerOnly = true) +public class OTSEndpoint extends DefaultEndpoint { + + @UriPath(description = "Operation to perform", displayName = "Operation", label = "producer", + enums = "putRow,getRow,updateRow,deleteRow,listTables") + @Metadata(required = true) + private String operation; + + @UriParam(description = "Tablestore endpoint URL", displayName = "Endpoint") + @Metadata(required = true) + private String endpoint; + + @UriParam(description = "Tablestore instance name", displayName = "Instance Name") + @Metadata(required = true) + private String instanceName; + + @UriParam(description = "Access key for the cloud user", displayName = "Access Key", + secret = true, security = "secret", label = "security") + private String accessKey; + + @UriParam(description = "Secret key for the cloud user", displayName = "Secret Key", + secret = true, security = "secret", label = "security") + private String secretKey; + + @UriParam(description = "Configuration object for cloud service authentication", displayName = "Service Keys", + secret = true, security = "secret", label = "security") + private ServiceKeys serviceKeys; + + @UriParam(description = "Autowire an existing Tablestore client instance", displayName = "OTS Client", + label = "advanced") + @Metadata(autowired = true) + private SyncClient otsClient; + + private boolean autowiredOtsClient; + + public OTSEndpoint() { + } + + public OTSEndpoint(String uri, String operation, OTSComponent component) { + super(uri, component); + this.operation = operation; + } + + @Override + public Producer createProducer() throws Exception { + return new OTSProducer(this); + } + + @Override + public Consumer createConsumer(Processor processor) throws Exception { + throw new UnsupportedOperationException("You cannot consume from this endpoint"); + } + + public SyncClient initClient() throws Exception { + if (otsClient != null) { + return otsClient; + } + otsClient = OTSUtils.createClient(this); + return otsClient; + } + + @Override + protected void doStop() throws Exception { + if (otsClient != null && !autowiredOtsClient) { + otsClient.shutdown(); + otsClient = null; + } + super.doStop(); + } + + public String getOperation() { + return operation; + } + + public void setOperation(String operation) { + this.operation = operation; + } + + public String getEndpoint() { + return endpoint; + } + + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public String getInstanceName() { + return instanceName; + } + + public void setInstanceName(String instanceName) { + this.instanceName = instanceName; + } + + public String getAccessKey() { + return accessKey; + } + + public void setAccessKey(String accessKey) { + this.accessKey = accessKey; + } + + public String getSecretKey() { + return secretKey; + } + + public void setSecretKey(String secretKey) { + this.secretKey = secretKey; + } + + public ServiceKeys getServiceKeys() { + return serviceKeys; + } + + public void setServiceKeys(ServiceKeys serviceKeys) { + this.serviceKeys = serviceKeys; + } + + public SyncClient getOtsClient() { + return otsClient; + } + + public void setOtsClient(SyncClient otsClient) { + this.otsClient = otsClient; + this.autowiredOtsClient = otsClient != null; + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSProducer.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSProducer.java new file mode 100644 index 0000000000000..a547395257c12 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSProducer.java @@ -0,0 +1,106 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots; + +import com.alicloud.openservices.tablestore.SyncClient; +import com.alicloud.openservices.tablestore.model.DeleteRowRequest; +import com.alicloud.openservices.tablestore.model.GetRowRequest; +import com.alicloud.openservices.tablestore.model.PutRowRequest; +import com.alicloud.openservices.tablestore.model.UpdateRowRequest; +import org.apache.camel.Exchange; +import org.apache.camel.component.alibaba.ots.constants.OTSHeaders; +import org.apache.camel.component.alibaba.ots.constants.OTSOperations; +import org.apache.camel.component.alibaba.ots.models.ClientConfigurations; +import org.apache.camel.support.DefaultProducer; +import org.apache.camel.util.ObjectHelper; + +public class OTSProducer extends DefaultProducer { + + private SyncClient otsClient; + + public OTSProducer(OTSEndpoint endpoint) { + super(endpoint); + } + + @Override + public void process(Exchange exchange) throws Exception { + OTSEndpoint endpoint = getEndpoint(); + ClientConfigurations configuration = OTSUtils.createClientConfigurations(endpoint, exchange); + + if (ObjectHelper.isEmpty(configuration.getOperation())) { + throw new IllegalArgumentException("Operation name not found"); + } + + if (otsClient == null) { + otsClient = endpoint.initClient(); + } + + switch (configuration.getOperation()) { + case OTSOperations.PUT_ROW -> putRow(exchange); + case OTSOperations.GET_ROW -> getRow(exchange); + case OTSOperations.UPDATE_ROW -> updateRow(exchange); + case OTSOperations.DELETE_ROW -> deleteRow(exchange); + case OTSOperations.LIST_TABLES -> listTables(exchange); + default -> throw new UnsupportedOperationException("Unsupported operation: " + configuration.getOperation()); + } + } + + private void putRow(Exchange exchange) throws Exception { + PutRowRequest request = exchange.getMessage().getMandatoryBody(PutRowRequest.class); + var response = otsClient.putRow(request); + exchange.getMessage().setBody(OTSUtils.toPutRowMap(response)); + setResponseHeaders(exchange, response.getRequestId()); + } + + private void getRow(Exchange exchange) throws Exception { + GetRowRequest request = exchange.getMessage().getMandatoryBody(GetRowRequest.class); + var response = otsClient.getRow(request); + exchange.getMessage().setBody(OTSUtils.toGetRowMap(response)); + setResponseHeaders(exchange, response.getRequestId()); + } + + private void updateRow(Exchange exchange) throws Exception { + UpdateRowRequest request = exchange.getMessage().getMandatoryBody(UpdateRowRequest.class); + var response = otsClient.updateRow(request); + exchange.getMessage().setBody(OTSUtils.toUpdateRowMap(response)); + setResponseHeaders(exchange, response.getRequestId()); + } + + private void deleteRow(Exchange exchange) throws Exception { + DeleteRowRequest request = exchange.getMessage().getMandatoryBody(DeleteRowRequest.class); + var response = otsClient.deleteRow(request); + exchange.getMessage().setBody(OTSUtils.toDeleteRowMap(response)); + setResponseHeaders(exchange, response.getRequestId()); + } + + private void listTables(Exchange exchange) throws Exception { + var response = otsClient.listTable(); + exchange.getMessage().setBody(OTSUtils.toListTablesBody(response)); + setResponseHeaders(exchange, response.getRequestId()); + } + + private void setResponseHeaders(Exchange exchange, String requestId) { + if (ObjectHelper.isNotEmpty(requestId)) { + exchange.getMessage().setHeader(OTSHeaders.REQUEST_ID, requestId); + } + } + + @Override + public OTSEndpoint getEndpoint() { + return (OTSEndpoint) super.getEndpoint(); + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSUtils.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSUtils.java new file mode 100644 index 0000000000000..1d20b76176de3 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSUtils.java @@ -0,0 +1,189 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots; + +import java.util.ArrayList; +import java.util.Base64; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.alicloud.openservices.tablestore.SyncClient; +import com.alicloud.openservices.tablestore.model.CapacityUnit; +import com.alicloud.openservices.tablestore.model.Column; +import com.alicloud.openservices.tablestore.model.ConsumedCapacity; +import com.alicloud.openservices.tablestore.model.DeleteRowResponse; +import com.alicloud.openservices.tablestore.model.GetRowResponse; +import com.alicloud.openservices.tablestore.model.ListTableResponse; +import com.alicloud.openservices.tablestore.model.PrimaryKey; +import com.alicloud.openservices.tablestore.model.PrimaryKeyColumn; +import com.alicloud.openservices.tablestore.model.PutRowResponse; +import com.alicloud.openservices.tablestore.model.Response; +import com.alicloud.openservices.tablestore.model.Row; +import com.alicloud.openservices.tablestore.model.UpdateRowResponse; +import org.apache.camel.Exchange; +import org.apache.camel.component.alibaba.common.OpenApiClientSupport; +import org.apache.camel.component.alibaba.common.models.ServiceKeys; +import org.apache.camel.component.alibaba.ots.constants.OTSProperties; +import org.apache.camel.component.alibaba.ots.models.ClientConfigurations; +import org.apache.camel.util.ObjectHelper; + +public final class OTSUtils { + + private OTSUtils() { + } + + public static SyncClient createClient(OTSEndpoint endpoint) { + if (ObjectHelper.isEmpty(endpoint.getEndpoint())) { + throw new IllegalArgumentException("Endpoint is required"); + } + if (ObjectHelper.isEmpty(endpoint.getInstanceName())) { + throw new IllegalArgumentException("Instance name is required"); + } + + return new SyncClient( + endpoint.getEndpoint(), + resolveAccessKey(endpoint.getAccessKey(), endpoint.getServiceKeys()), + resolveSecretKey(endpoint.getSecretKey(), endpoint.getServiceKeys()), + endpoint.getInstanceName()); + } + + public static String resolveAccessKey(String accessKey, ServiceKeys serviceKeys) { + if (ObjectHelper.isNotEmpty(accessKey)) { + return accessKey; + } + if (serviceKeys != null && ObjectHelper.isNotEmpty(serviceKeys.getAccessKey())) { + return serviceKeys.getAccessKey(); + } + throw new IllegalArgumentException("Authentication parameter 'access key (AK)' not found"); + } + + public static String resolveSecretKey(String secretKey, ServiceKeys serviceKeys) { + if (ObjectHelper.isNotEmpty(secretKey)) { + return secretKey; + } + if (serviceKeys != null && ObjectHelper.isNotEmpty(serviceKeys.getSecretKey())) { + return serviceKeys.getSecretKey(); + } + throw new IllegalArgumentException("Authentication parameter 'secret key (SK)' not found"); + } + + public static ClientConfigurations createClientConfigurations(OTSEndpoint endpoint, Exchange exchange) { + ClientConfigurations configuration = new ClientConfigurations(); + configuration.setOperation( + OpenApiClientSupport.resolveString(exchange, OTSProperties.OPERATION, endpoint.getOperation())); + return configuration; + } + + public static List toListTablesBody(ListTableResponse response) { + if (response.getTableNames() == null) { + return List.of(); + } + return new ArrayList<>(response.getTableNames()); + } + + public static Map toPutRowMap(PutRowResponse response) { + Map map = new HashMap<>(); + addCommonResponseFields(map, response); + addConsumedCapacity(map, response.getConsumedCapacity()); + addRow(map, response.getRow()); + return map; + } + + public static Map toGetRowMap(GetRowResponse response) { + Map map = new HashMap<>(); + addCommonResponseFields(map, response); + addConsumedCapacity(map, response.getConsumedCapacity()); + addRow(map, response.getRow()); + if (response.hasNextToken()) { + map.put("nextToken", Base64.getEncoder().encodeToString(response.getNextToken())); + } + return map; + } + + public static Map toUpdateRowMap(UpdateRowResponse response) { + Map map = new HashMap<>(); + addCommonResponseFields(map, response); + addConsumedCapacity(map, response.getConsumedCapacity()); + addRow(map, response.getRow()); + return map; + } + + public static Map toDeleteRowMap(DeleteRowResponse response) { + Map map = new HashMap<>(); + addCommonResponseFields(map, response); + addConsumedCapacity(map, response.getConsumedCapacity()); + addRow(map, response.getRow()); + return map; + } + + private static void addCommonResponseFields(Map map, Response response) { + map.put("requestId", response.getRequestId()); + map.put("traceId", response.getTraceId()); + } + + private static void addConsumedCapacity(Map map, ConsumedCapacity consumedCapacity) { + if (consumedCapacity == null) { + return; + } + Map capacityMap = new HashMap<>(); + CapacityUnit capacityUnit = consumedCapacity.getCapacityUnit(); + if (capacityUnit != null) { + capacityMap.put("readCapacityUnit", capacityUnit.getReadCapacityUnit()); + capacityMap.put("writeCapacityUnit", capacityUnit.getWriteCapacityUnit()); + } + map.put("consumedCapacity", capacityMap); + } + + private static void addRow(Map map, Row row) { + if (row == null) { + return; + } + Map rowMap = new HashMap<>(); + rowMap.put("primaryKey", toPrimaryKeyMap(row.getPrimaryKey())); + rowMap.put("columns", toColumnsList(row.getColumns())); + map.put("row", rowMap); + } + + private static Map toPrimaryKeyMap(PrimaryKey primaryKey) { + Map primaryKeyMap = new HashMap<>(); + if (primaryKey == null || primaryKey.isEmpty()) { + return primaryKeyMap; + } + for (PrimaryKeyColumn column : primaryKey.getPrimaryKeyColumns()) { + primaryKeyMap.put(column.getName(), column.getValue().toString()); + } + return primaryKeyMap; + } + + private static List> toColumnsList(Column[] columns) { + List> columnsList = new ArrayList<>(); + if (columns == null) { + return columnsList; + } + for (Column column : columns) { + Map columnMap = new HashMap<>(); + columnMap.put("name", column.getName()); + columnMap.put("value", column.getValue().toString()); + if (column.hasSetTimestamp()) { + columnMap.put("timestamp", column.getTimestamp()); + } + columnsList.add(columnMap); + } + return columnsList; + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSHeaders.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSHeaders.java new file mode 100644 index 0000000000000..5588f46272e4a --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSHeaders.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots.constants; + +import org.apache.camel.spi.Metadata; + +public final class OTSHeaders { + + @Metadata(label = "producer", description = "Operation override", javaType = "String") + public static final String OPERATION = OTSProperties.OPERATION; + + @Metadata(label = "producer", description = "Tablestore request id", javaType = "String") + public static final String REQUEST_ID = OTSProperties.REQUEST_ID; + + private OTSHeaders() { + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSOperations.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSOperations.java new file mode 100644 index 0000000000000..6ebdde5200f58 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSOperations.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots.constants; + +public final class OTSOperations { + + public static final String PUT_ROW = "putRow"; + public static final String GET_ROW = "getRow"; + public static final String UPDATE_ROW = "updateRow"; + public static final String DELETE_ROW = "deleteRow"; + public static final String LIST_TABLES = "listTables"; + + private OTSOperations() { + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSProperties.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSProperties.java new file mode 100644 index 0000000000000..c8abcf0ac1f86 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSProperties.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots.constants; + +import org.apache.camel.spi.Metadata; + +public final class OTSProperties { + + @Metadata(label = "producer", description = "Operation to perform", javaType = "String") + public static final String OPERATION = "CamelAlibabaOtsOperation"; + + @Metadata(label = "producer", description = "Request id returned by Tablestore", javaType = "String") + public static final String REQUEST_ID = "CamelAlibabaOtsRequestId"; + + private OTSProperties() { + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/models/ClientConfigurations.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/models/ClientConfigurations.java new file mode 100644 index 0000000000000..ab33bd55df825 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/models/ClientConfigurations.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots.models; + +public class ClientConfigurations { + + private String operation; + + public String getOperation() { + return operation; + } + + public void setOperation(String operation) { + this.operation = operation; + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/DeleteRowTest.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/DeleteRowTest.java new file mode 100644 index 0000000000000..28b39e86f297e --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/DeleteRowTest.java @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots; + +import java.util.Map; + +import com.alicloud.openservices.tablestore.SyncClient; +import com.alicloud.openservices.tablestore.model.CapacityUnit; +import com.alicloud.openservices.tablestore.model.ConsumedCapacity; +import com.alicloud.openservices.tablestore.model.DeleteRowRequest; +import com.alicloud.openservices.tablestore.model.DeleteRowResponse; +import com.alicloud.openservices.tablestore.model.Response; +import org.apache.camel.BindToRegistry; +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.junit6.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +class DeleteRowTest extends CamelTestSupport { + + private final TestConfiguration testConfiguration = new TestConfiguration(); + + @BindToRegistry("otsClient") + SyncClient otsClient = mock(SyncClient.class); + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + @Override + public void configure() { + from("direct:deleteRow") + .to("alibaba-ots:deleteRow" + + "?endpoint=" + testConfiguration.getProperty("endpoint") + + "&instanceName=" + testConfiguration.getProperty("instanceName") + + "&accessKey=" + testConfiguration.getProperty("accessKey") + + "&secretKey=" + testConfiguration.getProperty("secretKey") + + "&otsClient=#otsClient") + .to("mock:result"); + } + }; + } + + @Test + void testDeleteRow() throws Exception { + DeleteRowResponse response = new DeleteRowResponse( + new Response("req-delete-row"), + null, + new ConsumedCapacity(new CapacityUnit(0, 1))); + + when(otsClient.deleteRow(any(DeleteRowRequest.class))).thenReturn(response); + + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedMinimumMessageCount(1); + + DeleteRowRequest request = new DeleteRowRequest(); + template.sendBody("direct:deleteRow", request); + + mock.assertIsSatisfied(); + + Exchange exchange = mock.getExchanges().get(0); + assertThat(exchange.getMessage().getBody(Map.class)) + .containsEntry("requestId", "req-delete-row") + .containsKey("consumedCapacity"); + + verify(otsClient).deleteRow(any(DeleteRowRequest.class)); + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/GetRowTest.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/GetRowTest.java new file mode 100644 index 0000000000000..e07e365c758a6 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/GetRowTest.java @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots; + +import java.util.Map; + +import com.alicloud.openservices.tablestore.SyncClient; +import com.alicloud.openservices.tablestore.model.CapacityUnit; +import com.alicloud.openservices.tablestore.model.Column; +import com.alicloud.openservices.tablestore.model.ColumnValue; +import com.alicloud.openservices.tablestore.model.ConsumedCapacity; +import com.alicloud.openservices.tablestore.model.GetRowRequest; +import com.alicloud.openservices.tablestore.model.GetRowResponse; +import com.alicloud.openservices.tablestore.model.PrimaryKey; +import com.alicloud.openservices.tablestore.model.PrimaryKeyColumn; +import com.alicloud.openservices.tablestore.model.PrimaryKeyValue; +import com.alicloud.openservices.tablestore.model.Response; +import com.alicloud.openservices.tablestore.model.Row; +import org.apache.camel.BindToRegistry; +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.junit6.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +class GetRowTest extends CamelTestSupport { + + private final TestConfiguration testConfiguration = new TestConfiguration(); + + @BindToRegistry("otsClient") + SyncClient otsClient = mock(SyncClient.class); + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + @Override + public void configure() { + from("direct:getRow") + .to("alibaba-ots:getRow" + + "?endpoint=" + testConfiguration.getProperty("endpoint") + + "&instanceName=" + testConfiguration.getProperty("instanceName") + + "&accessKey=" + testConfiguration.getProperty("accessKey") + + "&secretKey=" + testConfiguration.getProperty("secretKey") + + "&otsClient=#otsClient") + .to("mock:result"); + } + }; + } + + @Test + void testGetRow() throws Exception { + PrimaryKey primaryKey = new PrimaryKey( + new PrimaryKeyColumn[] { + new PrimaryKeyColumn("pk", PrimaryKeyValue.fromString("id-1")) + }); + Column[] columns = new Column[] { + new Column("name", ColumnValue.fromString("camel")) + }; + Row row = new Row(primaryKey, columns); + GetRowResponse response = new GetRowResponse( + new Response("req-get-row"), + row, + new ConsumedCapacity(new CapacityUnit(1, 0))); + + when(otsClient.getRow(any(GetRowRequest.class))).thenReturn(response); + + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedMinimumMessageCount(1); + + GetRowRequest request = new GetRowRequest(); + template.sendBody("direct:getRow", request); + + mock.assertIsSatisfied(); + + Exchange exchange = mock.getExchanges().get(0); + assertThat(exchange.getMessage().getBody(Map.class)) + .containsEntry("requestId", "req-get-row") + .containsKey("row") + .containsKey("consumedCapacity"); + + verify(otsClient).getRow(any(GetRowRequest.class)); + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/ListTablesTest.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/ListTablesTest.java new file mode 100644 index 0000000000000..a17d235bba0d8 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/ListTablesTest.java @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots; + +import java.util.List; + +import com.alicloud.openservices.tablestore.SyncClient; +import com.alicloud.openservices.tablestore.model.ListTableResponse; +import com.alicloud.openservices.tablestore.model.Response; +import org.apache.camel.BindToRegistry; +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.junit6.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +class ListTablesTest extends CamelTestSupport { + + private final TestConfiguration testConfiguration = new TestConfiguration(); + + @BindToRegistry("otsClient") + SyncClient otsClient = mock(SyncClient.class); + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + @Override + public void configure() { + from("direct:listTables") + .to("alibaba-ots:listTables" + + "?endpoint=" + testConfiguration.getProperty("endpoint") + + "&instanceName=" + testConfiguration.getProperty("instanceName") + + "&accessKey=" + testConfiguration.getProperty("accessKey") + + "&secretKey=" + testConfiguration.getProperty("secretKey") + + "&otsClient=#otsClient") + .to("mock:result"); + } + }; + } + + @Test + void testListTables() throws Exception { + ListTableResponse response = new ListTableResponse(new Response("req-list-tables")); + response.setTableNames(List.of("table-a", "table-b")); + + when(otsClient.listTable()).thenReturn(response); + + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedMinimumMessageCount(1); + + template.sendBody("direct:listTables", null); + + mock.assertIsSatisfied(); + + Exchange exchange = mock.getExchanges().get(0); + assertThat(exchange.getMessage().getBody(List.class)) + .containsExactly("table-a", "table-b"); + + verify(otsClient).listTable(); + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSEndpointTest.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSEndpointTest.java new file mode 100644 index 0000000000000..f96ec835de7ae --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSEndpointTest.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots; + +import com.alicloud.openservices.tablestore.SyncClient; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; + +class OTSEndpointTest { + + @Test + void initClientReturnsCachedInstance() throws Exception { + OTSEndpoint endpoint = new OTSEndpoint(); + endpoint.setAccessKey("ak"); + endpoint.setSecretKey("sk"); + endpoint.setEndpoint("https://test-instance.cn-hangzhou.ots.aliyuncs.com"); + endpoint.setInstanceName("test-instance"); + + SyncClient first = endpoint.initClient(); + SyncClient second = endpoint.initClient(); + + assertThat(first).isSameAs(second); + first.shutdown(); + } + + @Test + void doStopSkipsShutdownForAutowiredClient() throws Exception { + OTSEndpoint endpoint = new OTSEndpoint(); + SyncClient client = mock(SyncClient.class); + endpoint.setOtsClient(client); + + endpoint.doStop(); + + verify(client, never()).shutdown(); + } + + @Test + void doStopShutsDownOwnedClient() throws Exception { + OTSEndpoint endpoint = new OTSEndpoint(); + SyncClient client = mock(SyncClient.class); + + var clientField = OTSEndpoint.class.getDeclaredField("otsClient"); + clientField.setAccessible(true); + clientField.set(endpoint, client); + + var autowiredField = OTSEndpoint.class.getDeclaredField("autowiredOtsClient"); + autowiredField.setAccessible(true); + autowiredField.setBoolean(endpoint, false); + + endpoint.doStop(); + + verify(client).shutdown(); + assertThat(endpoint.getOtsClient()).isNull(); + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/PutRowTest.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/PutRowTest.java new file mode 100644 index 0000000000000..625435008e0c9 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/PutRowTest.java @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots; + +import java.util.Map; + +import com.alicloud.openservices.tablestore.SyncClient; +import com.alicloud.openservices.tablestore.model.CapacityUnit; +import com.alicloud.openservices.tablestore.model.ConsumedCapacity; +import com.alicloud.openservices.tablestore.model.PutRowRequest; +import com.alicloud.openservices.tablestore.model.PutRowResponse; +import com.alicloud.openservices.tablestore.model.Response; +import org.apache.camel.BindToRegistry; +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.junit6.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +class PutRowTest extends CamelTestSupport { + + private final TestConfiguration testConfiguration = new TestConfiguration(); + + @BindToRegistry("otsClient") + SyncClient otsClient = mock(SyncClient.class); + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + @Override + public void configure() { + from("direct:putRow") + .to("alibaba-ots:putRow" + + "?endpoint=" + testConfiguration.getProperty("endpoint") + + "&instanceName=" + testConfiguration.getProperty("instanceName") + + "&accessKey=" + testConfiguration.getProperty("accessKey") + + "&secretKey=" + testConfiguration.getProperty("secretKey") + + "&otsClient=#otsClient") + .to("mock:result"); + } + }; + } + + @Test + void testPutRow() throws Exception { + PutRowResponse response = new PutRowResponse( + new Response("req-put-row"), + null, + new ConsumedCapacity(new CapacityUnit(0, 1))); + + when(otsClient.putRow(any(PutRowRequest.class))).thenReturn(response); + + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedMinimumMessageCount(1); + + PutRowRequest request = new PutRowRequest(); + template.sendBody("direct:putRow", request); + + mock.assertIsSatisfied(); + + Exchange exchange = mock.getExchanges().get(0); + assertThat(exchange.getMessage().getBody(Map.class)) + .containsEntry("requestId", "req-put-row") + .containsKey("consumedCapacity"); + + verify(otsClient).putRow(any(PutRowRequest.class)); + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/TestConfiguration.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/TestConfiguration.java new file mode 100644 index 0000000000000..f06eaa142e93f --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/TestConfiguration.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots; + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import org.apache.camel.test.junit6.TestSupport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class TestConfiguration { + + private static final Logger LOGGER = LoggerFactory.getLogger(TestConfiguration.class); + private static Map propertyMap; + + TestConfiguration() { + initPropertyMap(); + } + + void initPropertyMap() { + if (propertyMap == null) { + propertyMap = new HashMap<>(); + String propertyFileName = "testconfiguration.properties"; + try { + Properties properties = TestSupport.loadExternalProperties(getClass().getClassLoader(), propertyFileName); + for (String key : properties.stringPropertyNames()) { + propertyMap.put(key, properties.getProperty(key)); + } + } catch (Exception e) { + LOGGER.error("Cannot load property file {}, reason {}", propertyFileName, e.getMessage()); + } + } + } + + String getProperty(String key) { + if (propertyMap == null) { + initPropertyMap(); + } + return propertyMap.get(key); + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/UpdateRowTest.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/UpdateRowTest.java new file mode 100644 index 0000000000000..b48966e3dcd30 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/UpdateRowTest.java @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots; + +import java.util.Map; + +import com.alicloud.openservices.tablestore.SyncClient; +import com.alicloud.openservices.tablestore.model.CapacityUnit; +import com.alicloud.openservices.tablestore.model.ConsumedCapacity; +import com.alicloud.openservices.tablestore.model.Response; +import com.alicloud.openservices.tablestore.model.UpdateRowRequest; +import com.alicloud.openservices.tablestore.model.UpdateRowResponse; +import org.apache.camel.BindToRegistry; +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.junit6.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +class UpdateRowTest extends CamelTestSupport { + + private final TestConfiguration testConfiguration = new TestConfiguration(); + + @BindToRegistry("otsClient") + SyncClient otsClient = mock(SyncClient.class); + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + @Override + public void configure() { + from("direct:updateRow") + .to("alibaba-ots:updateRow" + + "?endpoint=" + testConfiguration.getProperty("endpoint") + + "&instanceName=" + testConfiguration.getProperty("instanceName") + + "&accessKey=" + testConfiguration.getProperty("accessKey") + + "&secretKey=" + testConfiguration.getProperty("secretKey") + + "&otsClient=#otsClient") + .to("mock:result"); + } + }; + } + + @Test + void testUpdateRow() throws Exception { + UpdateRowResponse response = new UpdateRowResponse( + new Response("req-update-row"), + null, + new ConsumedCapacity(new CapacityUnit(0, 1))); + + when(otsClient.updateRow(any(UpdateRowRequest.class))).thenReturn(response); + + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedMinimumMessageCount(1); + + UpdateRowRequest request = new UpdateRowRequest(); + template.sendBody("direct:updateRow", request); + + mock.assertIsSatisfied(); + + Exchange exchange = mock.getExchanges().get(0); + assertThat(exchange.getMessage().getBody(Map.class)) + .containsEntry("requestId", "req-update-row") + .containsKey("consumedCapacity"); + + verify(otsClient).updateRow(any(UpdateRowRequest.class)); + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/constants/OTSOperationsTest.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/constants/OTSOperationsTest.java new file mode 100644 index 0000000000000..8fcdf1fe35be5 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/constants/OTSOperationsTest.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots.constants; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +class OTSOperationsTest { + + @Test + void testOperations() { + assertThat(OTSOperations.PUT_ROW).isEqualTo("putRow"); + assertThat(OTSOperations.GET_ROW).isEqualTo("getRow"); + assertThat(OTSOperations.UPDATE_ROW).isEqualTo("updateRow"); + assertThat(OTSOperations.DELETE_ROW).isEqualTo("deleteRow"); + assertThat(OTSOperations.LIST_TABLES).isEqualTo("listTables"); + } +} diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/resources/log4j2.properties b/components/camel-alibaba/camel-alibaba-ots/src/test/resources/log4j2.properties new file mode 100644 index 0000000000000..b7a3f221972a8 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/resources/log4j2.properties @@ -0,0 +1,29 @@ +## --------------------------------------------------------------------------- +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You under the Apache License, Version 2.0 +## (the "License"); you may not use this file except in compliance with +## the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## --------------------------------------------------------------------------- + +appender.file.type = File +appender.file.name = file +appender.file.fileName = target/camel-alibaba-ots-test.log +appender.file.layout.type = PatternLayout +appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n +appender.out.type = Console +appender.out.name = out +appender.out.layout.type = PatternLayout +appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n + +rootLogger.level = INFO +rootLogger.appenderRef.file.ref = file diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/resources/testconfiguration.properties b/components/camel-alibaba/camel-alibaba-ots/src/test/resources/testconfiguration.properties new file mode 100644 index 0000000000000..07cbdd08cd0b5 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/resources/testconfiguration.properties @@ -0,0 +1,21 @@ +## --------------------------------------------------------------------------- +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You under the Apache License, Version 2.0 +## (the "License"); you may not use this file except in compliance with +## the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## --------------------------------------------------------------------------- + +accessKey=dummy_access_key +secretKey=dummy_secret_key +endpoint=https://test-instance.cn-hangzhou.ots.aliyuncs.com +instanceName=test-instance diff --git a/components/camel-alibaba/pom.xml b/components/camel-alibaba/pom.xml index a29e2459fc41e..147c44c66c3dc 100644 --- a/components/camel-alibaba/pom.xml +++ b/components/camel-alibaba/pom.xml @@ -39,7 +39,9 @@ camel-alibaba-fc camel-alibaba-sms camel-alibaba-kms + camel-alibaba-sls camel-alibaba-eventbridge + camel-alibaba-ots diff --git a/coverage/pom.xml b/coverage/pom.xml index 4c258f5b1653f..4ffc6430221a8 100644 --- a/coverage/pom.xml +++ b/coverage/pom.xml @@ -251,6 +251,11 @@ camel-alibaba-oss ${project.version} + + org.apache.camel + camel-alibaba-ots + ${project.version} + org.apache.camel camel-alibaba-sms diff --git a/parent/pom.xml b/parent/pom.xml index 0664bce21e6b0..27fd8b3850352 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -69,8 +69,10 @@ 2.1.0 4.1.1 2.2.0 + 5.9.0 5.2.2 1.2.6 + 5.17.11 0.3.8 3.5.1 2.0.5 @@ -736,11 +738,21 @@ kms20160120 ${aliyun-kms-version} + + com.aliyun + sls20201230 + ${aliyun-sls-version} + com.aliyun tea-openapi ${tea-openapi-version} + + com.aliyun.openservices + tablestore + ${aliyun-tablestore-version} + org.apache.camel camel-a2a @@ -801,6 +813,11 @@ camel-alibaba-oss ${project.version} + + org.apache.camel + camel-alibaba-ots + ${project.version} + org.apache.camel camel-alibaba-sms diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java index 4d798e49d2b05..fd54baeaccbfc 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java @@ -149,7 +149,9 @@ public static List getComponentPath(Path dir) { dir.resolve("camel-alibaba-fc"), dir.resolve("camel-alibaba-sms"), dir.resolve("camel-alibaba-kms"), - dir.resolve("camel-alibaba-eventbridge")); + dir.resolve("camel-alibaba-sls"), + dir.resolve("camel-alibaba-eventbridge"), + dir.resolve("camel-alibaba-ots")); case "camel-huawei": return Arrays.asList(dir.resolve("camel-huaweicloud-frs"), dir.resolve("camel-huaweicloud-dms"), From 3ca0db853019e1dd11250390e466c1370dd6d065 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 14 Aug 2026 06:35:34 +0000 Subject: [PATCH 2/9] CAMEL-24373: Add camel-alibaba-sls component (Phase 3) Implement producer-only Alibaba Cloud Simple Log Service (SLS) component with putLogs, getLogs and listLogStores operations using sls20201230 SDK. Co-authored-by: Cursor --- catalog/camel-allcomponents/pom.xml | 5 + .../camel-alibaba/camel-alibaba-sls/pom.xml | 86 ++++++ .../alibaba/sls/SLSComponentConfigurer.java | 69 +++++ .../alibaba/sls/SLSEndpointConfigurer.java | 116 ++++++++ .../alibaba/sls/SLSEndpointUriFactory.java | 97 +++++++ .../component/alibaba/sls/alibaba-sls.json | 68 +++++ .../org/apache/camel/component.properties | 7 + .../org/apache/camel/component/alibaba-sls | 2 + .../camel/configurer/alibaba-sls-component | 2 + .../camel/configurer/alibaba-sls-endpoint | 2 + .../camel/urifactory/alibaba-sls-endpoint | 2 + .../src/main/docs/alibaba-sls-component.adoc | 87 ++++++ .../component/alibaba/sls/SLSComponent.java | 34 +++ .../component/alibaba/sls/SLSEndpoint.java | 265 ++++++++++++++++++ .../component/alibaba/sls/SLSProducer.java | 126 +++++++++ .../camel/component/alibaba/sls/SLSUtils.java | 214 ++++++++++++++ .../alibaba/sls/constants/SLSHeaders.java | 70 +++++ .../alibaba/sls/constants/SLSOperations.java | 27 ++ .../alibaba/sls/constants/SLSProperties.java | 70 +++++ .../sls/models/ClientConfigurations.java | 156 +++++++++++ .../component/alibaba/sls/GetLogsTest.java | 102 +++++++ .../alibaba/sls/ListLogStoresTest.java | 101 +++++++ .../component/alibaba/sls/PutLogsTest.java | 104 +++++++ .../alibaba/sls/SLSEndpointTest.java | 55 ++++ .../alibaba/sls/TestConfiguration.java | 57 ++++ .../sls/constants/SLSOperationsTest.java | 31 ++ .../src/test/resources/log4j2.properties | 29 ++ .../resources/testconfiguration.properties | 23 ++ parent/pom.xml | 5 + 29 files changed, 2012 insertions(+) create mode 100644 components/camel-alibaba/camel-alibaba-sls/pom.xml create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSComponentConfigurer.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointConfigurer.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointUriFactory.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/component.properties create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-sls create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-component create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-endpoint create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-sls-endpoint create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/main/docs/alibaba-sls-component.adoc create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSComponent.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSEndpoint.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSProducer.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSUtils.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSHeaders.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSOperations.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSProperties.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/models/ClientConfigurations.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/GetLogsTest.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/ListLogStoresTest.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/PutLogsTest.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSEndpointTest.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/TestConfiguration.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/constants/SLSOperationsTest.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/test/resources/log4j2.properties create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/test/resources/testconfiguration.properties diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml index 991470ba9cb03..031d7a092972b 100644 --- a/catalog/camel-allcomponents/pom.xml +++ b/catalog/camel-allcomponents/pom.xml @@ -117,6 +117,11 @@ camel-alibaba-ots ${project.version} + + org.apache.camel + camel-alibaba-sls + ${project.version} + org.apache.camel camel-alibaba-sms diff --git a/components/camel-alibaba/camel-alibaba-sls/pom.xml b/components/camel-alibaba/camel-alibaba-sls/pom.xml new file mode 100644 index 0000000000000..391a6f38ef69d --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/pom.xml @@ -0,0 +1,86 @@ + + + + + 4.0.0 + + + org.apache.camel + camel-alibaba-parent + 4.23.0-SNAPSHOT + + + + 4.23.0 + + + camel-alibaba-sls + jar + Camel :: Alibaba Cloud :: Simple Log Service (SLS) + Camel Alibaba Cloud Simple Log Service (SLS) component + + + + org.apache.camel + camel-support + + + + org.apache.camel + camel-alibaba-common + ${project.version} + + + + com.aliyun + sls20201230 + + + com.sun.xml.bind + jaxb-core + + + com.sun.xml.bind + jaxb-impl + + + + + + org.apache.camel + camel-test-junit6 + test + + + + org.assertj + assertj-core + test + + + + org.mockito + mockito-core + ${mockito-version} + test + + + + diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSComponentConfigurer.java b/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSComponentConfigurer.java new file mode 100644 index 0000000000000..9f0e7d236b2fb --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSComponentConfigurer.java @@ -0,0 +1,69 @@ +/* Generated by camel build tools - do NOT edit this file! */ +package org.apache.camel.component.alibaba.sls; + +import javax.annotation.processing.Generated; +import java.util.Map; + +import org.apache.camel.CamelContext; +import org.apache.camel.spi.ExtendedPropertyConfigurerGetter; +import org.apache.camel.spi.PropertyConfigurerGetter; +import org.apache.camel.spi.ConfigurerStrategy; +import org.apache.camel.spi.GeneratedPropertyConfigurer; +import org.apache.camel.util.CaseInsensitiveMap; +import org.apache.camel.support.component.PropertyConfigurerSupport; + +/** + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo") +@SuppressWarnings("unchecked") +public class SLSComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { + + @Override + public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { + SLSComponent target = (SLSComponent) obj; + switch (ignoreCase ? name.toLowerCase() : name) { + case "autowiredenabled": + case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true; + case "healthcheckconsumerenabled": + case "healthCheckConsumerEnabled": target.setHealthCheckConsumerEnabled(property(camelContext, boolean.class, value)); return true; + case "healthcheckproducerenabled": + case "healthCheckProducerEnabled": target.setHealthCheckProducerEnabled(property(camelContext, boolean.class, value)); return true; + case "lazystartproducer": + case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; + default: return false; + } + } + + @Override + public Class getOptionType(String name, boolean ignoreCase) { + switch (ignoreCase ? name.toLowerCase() : name) { + case "autowiredenabled": + case "autowiredEnabled": return boolean.class; + case "healthcheckconsumerenabled": + case "healthCheckConsumerEnabled": return boolean.class; + case "healthcheckproducerenabled": + case "healthCheckProducerEnabled": return boolean.class; + case "lazystartproducer": + case "lazyStartProducer": return boolean.class; + default: return null; + } + } + + @Override + public Object getOptionValue(Object obj, String name, boolean ignoreCase) { + SLSComponent target = (SLSComponent) obj; + switch (ignoreCase ? name.toLowerCase() : name) { + case "autowiredenabled": + case "autowiredEnabled": return target.isAutowiredEnabled(); + case "healthcheckconsumerenabled": + case "healthCheckConsumerEnabled": return target.isHealthCheckConsumerEnabled(); + case "healthcheckproducerenabled": + case "healthCheckProducerEnabled": return target.isHealthCheckProducerEnabled(); + case "lazystartproducer": + case "lazyStartProducer": return target.isLazyStartProducer(); + default: return null; + } + } +} + diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointConfigurer.java b/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointConfigurer.java new file mode 100644 index 0000000000000..37b7eaf3bc950 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointConfigurer.java @@ -0,0 +1,116 @@ +/* Generated by camel build tools - do NOT edit this file! */ +package org.apache.camel.component.alibaba.sls; + +import javax.annotation.processing.Generated; +import java.util.Map; + +import org.apache.camel.CamelContext; +import org.apache.camel.spi.ExtendedPropertyConfigurerGetter; +import org.apache.camel.spi.PropertyConfigurerGetter; +import org.apache.camel.spi.ConfigurerStrategy; +import org.apache.camel.spi.GeneratedPropertyConfigurer; +import org.apache.camel.util.CaseInsensitiveMap; +import org.apache.camel.support.component.PropertyConfigurerSupport; + +/** + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo") +@SuppressWarnings("unchecked") +public class SLSEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { + + @Override + public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { + SLSEndpoint target = (SLSEndpoint) obj; + switch (ignoreCase ? name.toLowerCase() : name) { + case "accesskey": + case "accessKey": target.setAccessKey(property(camelContext, java.lang.String.class, value)); return true; + case "endpoint": target.setEndpoint(property(camelContext, java.lang.String.class, value)); return true; + case "from": target.setFrom(property(camelContext, java.lang.Integer.class, value)); return true; + case "lazystartproducer": + case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; + case "line": target.setLine(property(camelContext, java.lang.Long.class, value)); return true; + case "logstorename": + case "logStoreName": target.setLogStoreName(property(camelContext, java.lang.String.class, value)); return true; + case "offset": target.setOffset(property(camelContext, java.lang.Long.class, value)); return true; + case "project": target.setProject(property(camelContext, java.lang.String.class, value)); return true; + case "query": target.setQuery(property(camelContext, java.lang.String.class, value)); return true; + case "region": target.setRegion(property(camelContext, java.lang.String.class, value)); return true; + case "reverse": target.setReverse(property(camelContext, java.lang.Boolean.class, value)); return true; + case "secretkey": + case "secretKey": target.setSecretKey(property(camelContext, java.lang.String.class, value)); return true; + case "servicekeys": + case "serviceKeys": target.setServiceKeys(property(camelContext, org.apache.camel.component.alibaba.common.models.ServiceKeys.class, value)); return true; + case "slsclient": + case "slsClient": target.setSlsClient(property(camelContext, com.aliyun.sls20201230.Client.class, value)); return true; + case "to": target.setTo(property(camelContext, java.lang.Integer.class, value)); return true; + case "topic": target.setTopic(property(camelContext, java.lang.String.class, value)); return true; + default: return false; + } + } + + @Override + public String[] getAutowiredNames() { + return new String[]{"slsClient"}; + } + + @Override + public Class getOptionType(String name, boolean ignoreCase) { + switch (ignoreCase ? name.toLowerCase() : name) { + case "accesskey": + case "accessKey": return java.lang.String.class; + case "endpoint": return java.lang.String.class; + case "from": return java.lang.Integer.class; + case "lazystartproducer": + case "lazyStartProducer": return boolean.class; + case "line": return java.lang.Long.class; + case "logstorename": + case "logStoreName": return java.lang.String.class; + case "offset": return java.lang.Long.class; + case "project": return java.lang.String.class; + case "query": return java.lang.String.class; + case "region": return java.lang.String.class; + case "reverse": return java.lang.Boolean.class; + case "secretkey": + case "secretKey": return java.lang.String.class; + case "servicekeys": + case "serviceKeys": return org.apache.camel.component.alibaba.common.models.ServiceKeys.class; + case "slsclient": + case "slsClient": return com.aliyun.sls20201230.Client.class; + case "to": return java.lang.Integer.class; + case "topic": return java.lang.String.class; + default: return null; + } + } + + @Override + public Object getOptionValue(Object obj, String name, boolean ignoreCase) { + SLSEndpoint target = (SLSEndpoint) obj; + switch (ignoreCase ? name.toLowerCase() : name) { + case "accesskey": + case "accessKey": return target.getAccessKey(); + case "endpoint": return target.getEndpoint(); + case "from": return target.getFrom(); + case "lazystartproducer": + case "lazyStartProducer": return target.isLazyStartProducer(); + case "line": return target.getLine(); + case "logstorename": + case "logStoreName": return target.getLogStoreName(); + case "offset": return target.getOffset(); + case "project": return target.getProject(); + case "query": return target.getQuery(); + case "region": return target.getRegion(); + case "reverse": return target.getReverse(); + case "secretkey": + case "secretKey": return target.getSecretKey(); + case "servicekeys": + case "serviceKeys": return target.getServiceKeys(); + case "slsclient": + case "slsClient": return target.getSlsClient(); + case "to": return target.getTo(); + case "topic": return target.getTopic(); + default: return null; + } + } +} + diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointUriFactory.java b/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointUriFactory.java new file mode 100644 index 0000000000000..28c82498a3d10 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointUriFactory.java @@ -0,0 +1,97 @@ +/* Generated by camel build tools - do NOT edit this file! */ +package org.apache.camel.component.alibaba.sls; + +import javax.annotation.processing.Generated; +import java.net.URISyntaxException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.apache.camel.spi.EndpointUriFactory; + +/** + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.GenerateEndpointUriFactoryMojo") +public class SLSEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory { + + private static final String BASE = ":operation"; + + private static final Set PROPERTY_NAMES; + private static final Set SECRET_PROPERTY_NAMES; + private static final Set ENDPOINT_IDENTITY_PROPERTY_NAMES; + private static final Map MULTI_VALUE_PREFIXES; + static { + Set props = new HashSet<>(17); + props.add("accessKey"); + props.add("endpoint"); + props.add("from"); + props.add("lazyStartProducer"); + props.add("line"); + props.add("logStoreName"); + props.add("offset"); + props.add("operation"); + props.add("project"); + props.add("query"); + props.add("region"); + props.add("reverse"); + props.add("secretKey"); + props.add("serviceKeys"); + props.add("slsClient"); + props.add("to"); + props.add("topic"); + PROPERTY_NAMES = Collections.unmodifiableSet(props); + Set secretProps = new HashSet<>(3); + secretProps.add("accessKey"); + secretProps.add("secretKey"); + secretProps.add("serviceKeys"); + SECRET_PROPERTY_NAMES = Collections.unmodifiableSet(secretProps); + ENDPOINT_IDENTITY_PROPERTY_NAMES = Collections.emptySet(); + MULTI_VALUE_PREFIXES = Collections.emptyMap(); + } + + @Override + public boolean isEnabled(String scheme) { + return "alibaba-sls".equals(scheme); + } + + @Override + public String buildUri(String scheme, Map properties, boolean encode) throws URISyntaxException { + String syntax = scheme + BASE; + String uri = syntax; + + Map copy = new HashMap<>(properties); + + uri = buildPathParameter(syntax, uri, "operation", null, true, copy); + uri = buildQueryParameters(uri, copy, encode); + return uri; + } + + @Override + public Set propertyNames() { + return PROPERTY_NAMES; + } + + @Override + public Set secretPropertyNames() { + return SECRET_PROPERTY_NAMES; + } + + @Override + public Set endpointIdentityPropertyNames() { + return ENDPOINT_IDENTITY_PROPERTY_NAMES; + } + + @Override + public Map multiValuePrefixes() { + return MULTI_VALUE_PREFIXES; + } + + @Override + public boolean isLenientProperties() { + return false; + } +} + diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json new file mode 100644 index 0000000000000..940a63a6242a7 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json @@ -0,0 +1,68 @@ +{ + "component": { + "kind": "component", + "name": "alibaba-sls", + "title": "Alibaba Simple Log Service (SLS)", + "description": "Manage logs on Alibaba Cloud Simple Log Service (SLS).", + "deprecated": false, + "firstVersion": "4.23.0", + "label": "cloud,monitoring", + "javaType": "org.apache.camel.component.alibaba.sls.SLSComponent", + "supportLevel": "Preview", + "groupId": "org.apache.camel", + "artifactId": "camel-alibaba-sls", + "version": "4.23.0-SNAPSHOT", + "scheme": "alibaba-sls", + "extendsScheme": "", + "syntax": "alibaba-sls:operation", + "async": false, + "api": false, + "consumerOnly": false, + "producerOnly": true, + "lenientProperties": false, + "browsable": false, + "remote": true + }, + "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 during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "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 type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, + "healthCheckConsumerEnabled": { "index": 2, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, + "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } + }, + "headers": { + "CamelAlibabaSlsProject": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS project name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#PROJECT" }, + "CamelAlibabaSlsLogStoreName": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS log store name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LOG_STORE_NAME" }, + "CamelAlibabaSlsQuery": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query string override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#QUERY" }, + "CamelAlibabaSlsFrom": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query start time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#FROM" }, + "CamelAlibabaSlsTo": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query end time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TO" }, + "CamelAlibabaSlsLine": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Maximum number of log lines to return", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LINE" }, + "CamelAlibabaSlsOffset": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query offset", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#OFFSET" }, + "CamelAlibabaSlsTopic": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log topic filter override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TOPIC" }, + "CamelAlibabaSlsReverse": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether to return logs in reverse order", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#REVERSE" }, + "CamelAlibabaSlsLogstoreName": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log store name prefix filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LOGSTORE_NAME" }, + "CamelAlibabaSlsMode": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List mode for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#MODE" }, + "CamelAlibabaSlsSize": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Page size for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#SIZE" }, + "CamelAlibabaSlsTelemetryType": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Telemetry type filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TELEMETRY_TYPE" }, + "CamelAlibabaSlsRequestId": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud request id", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#REQUEST_ID" }, + "CamelAlibabaSlsStatusCode": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "HTTP status code from SLS response", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#STATUS_CODE" } + }, + "properties": { + "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putLogs", "getLogs", "listLogStores" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, + "endpoint": { "index": 1, "kind": "parameter", "displayName": "Endpoint", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS endpoint URL (e.g. cn-hangzhou.log.aliyuncs.com). Carries higher precedence than region based client initialization" }, + "logStoreName": { "index": 2, "kind": "parameter", "displayName": "Log Store Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS log store name" }, + "project": { "index": 3, "kind": "parameter", "displayName": "Project", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS project name" }, + "region": { "index": 4, "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud region" }, + "lazyStartProducer": { "index": 5, "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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "slsClient": { "index": 6, "kind": "parameter", "displayName": "SLS Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.aliyun.sls20201230.Client", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "description": "Autowire an existing SLS client instance" }, + "from": { "index": 7, "kind": "parameter", "displayName": "From", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Query start time for getLogs (Unix timestamp in seconds)" }, + "line": { "index": 8, "kind": "parameter", "displayName": "Line", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "Maximum number of log lines to return for getLogs" }, + "offset": { "index": 9, "kind": "parameter", "displayName": "Offset", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "Log query offset for getLogs" }, + "query": { "index": 10, "kind": "parameter", "displayName": "Query", "group": "getLogs", "label": "getLogs", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Log query string for getLogs" }, + "reverse": { "index": 11, "kind": "parameter", "displayName": "Reverse", "group": "getLogs", "label": "getLogs", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to return logs in reverse order for getLogs" }, + "to": { "index": 12, "kind": "parameter", "displayName": "To", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Query end time for getLogs (Unix timestamp in seconds)" }, + "topic": { "index": 13, "kind": "parameter", "displayName": "Topic", "group": "getLogs", "label": "getLogs", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Log topic filter for getLogs" }, + "accessKey": { "index": 14, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Access key for the cloud user" }, + "secretKey": { "index": 15, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Secret key for the cloud user" }, + "serviceKeys": { "index": 16, "kind": "parameter", "displayName": "Service Keys", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.component.alibaba.common.models.ServiceKeys", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Configuration object for cloud service authentication" } + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/component.properties b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/component.properties new file mode 100644 index 0000000000000..25e09c13ee1f6 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/component.properties @@ -0,0 +1,7 @@ +# Generated by camel build tools - do NOT edit this file! +components=alibaba-sls +groupId=org.apache.camel +artifactId=camel-alibaba-sls +version=4.23.0-SNAPSHOT +projectName=Camel :: Alibaba Cloud :: Simple Log Service (SLS) +projectDescription=Camel Alibaba Cloud Simple Log Service (SLS) component diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-sls b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-sls new file mode 100644 index 0000000000000..1e4c99d9c5cc6 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-sls @@ -0,0 +1,2 @@ +# Generated by camel build tools - do NOT edit this file! +class=org.apache.camel.component.alibaba.sls.SLSComponent diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-component b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-component new file mode 100644 index 0000000000000..d2b52268d9dd5 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-component @@ -0,0 +1,2 @@ +# Generated by camel build tools - do NOT edit this file! +class=org.apache.camel.component.alibaba.sls.SLSComponentConfigurer diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-endpoint b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-endpoint new file mode 100644 index 0000000000000..c1574849c73f2 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-endpoint @@ -0,0 +1,2 @@ +# Generated by camel build tools - do NOT edit this file! +class=org.apache.camel.component.alibaba.sls.SLSEndpointConfigurer diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-sls-endpoint b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-sls-endpoint new file mode 100644 index 0000000000000..3a310ec42d8bc --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-sls-endpoint @@ -0,0 +1,2 @@ +# Generated by camel build tools - do NOT edit this file! +class=org.apache.camel.component.alibaba.sls.SLSEndpointUriFactory diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/docs/alibaba-sls-component.adoc b/components/camel-alibaba/camel-alibaba-sls/src/main/docs/alibaba-sls-component.adoc new file mode 100644 index 0000000000000..267b8d77c1152 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/docs/alibaba-sls-component.adoc @@ -0,0 +1,87 @@ += Alibaba Simple Log Service (SLS) Component +:doctitle: Alibaba Simple Log Service (SLS) +:shortname: alibaba-sls +:artifactid: camel-alibaba-sls +:description: Manage logs on Alibaba Cloud Simple Log Service (SLS). +:since: 4.23 +:supportlevel: Preview +:tabs-sync-option: +:component-header: Only producer is supported +//Manually maintained attributes +:group: Alibaba Cloud + +*Since Camel {since}* + +*{component-header}* + +The Alibaba Cloud Simple Log Service (SLS) component allows you to write logs, query logs and list log stores. + +Maven users will need to add the following dependency to their `pom.xml` +for this component: + +[source,xml] +---- + + org.apache.camel + camel-alibaba-sls + x.x.x + + +---- + +== URI format + +[source] +---- +alibaba-sls:operation[?options] +---- + +// component options: START +include::partial$component-configure-options.adoc[] +include::partial$component-endpoint-options.adoc[] +include::partial$component-endpoint-headers.adoc[] +// component options: END + +== Usage + +=== Operations + +The component supports the following operations: + +* `putLogs` - write a log group to a log store (producer) +* `getLogs` - query logs from a log store (producer) +* `listLogStores` - list log stores in a project (producer) + +=== Producer examples + +Put logs: + +[source,java] +---- +from("direct:start") + .setBody(simple("${body}")) + .to("alibaba-sls:putLogs?project=my-project&logStoreName=my-logstore®ion=cn-hangzhou&endpoint=cn-hangzhou.log.aliyuncs.com&accessKey=RAW(accessKey)&secretKey=RAW(secretKey)"); +---- + +Query logs: + +[source,java] +---- +from("direct:start") + .setHeader("CamelAlibabaSlsQuery", constant("*")) + .setHeader("CamelAlibabaSlsFrom", constant(1700000000)) + .setHeader("CamelAlibabaSlsTo", constant(1700003600)) + .to("alibaba-sls:getLogs?project=my-project&logStoreName=my-logstore®ion=cn-hangzhou&accessKey=RAW(accessKey)&secretKey=RAW(secretKey)"); +---- + +List log stores: + +[source,java] +---- +from("direct:start") + .to("alibaba-sls:listLogStores?project=my-project®ion=cn-hangzhou&accessKey=RAW(accessKey)&secretKey=RAW(secretKey)"); +---- + +== Examples + +For more examples, see the unit tests in the `camel-alibaba-sls` module. diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSComponent.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSComponent.java new file mode 100644 index 0000000000000..405e74af156a4 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSComponent.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls; + +import java.util.Map; + +import org.apache.camel.Endpoint; +import org.apache.camel.spi.annotations.Component; +import org.apache.camel.support.HealthCheckComponent; + +@Component("alibaba-sls") +public class SLSComponent extends HealthCheckComponent { + + @Override + protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception { + SLSEndpoint endpoint = new SLSEndpoint(uri, remaining, this); + setProperties(endpoint, parameters); + return endpoint; + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSEndpoint.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSEndpoint.java new file mode 100644 index 0000000000000..393da0c3cda1a --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSEndpoint.java @@ -0,0 +1,265 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls; + +import com.aliyun.sls20201230.Client; +import org.apache.camel.Category; +import org.apache.camel.Consumer; +import org.apache.camel.Processor; +import org.apache.camel.Producer; +import org.apache.camel.component.alibaba.common.models.ServiceKeys; +import org.apache.camel.component.alibaba.sls.constants.SLSHeaders; +import org.apache.camel.spi.Metadata; +import org.apache.camel.spi.UriEndpoint; +import org.apache.camel.spi.UriParam; +import org.apache.camel.spi.UriPath; +import org.apache.camel.support.DefaultEndpoint; + +/** + * Manage logs on Alibaba Cloud Simple Log Service (SLS). + */ +@UriEndpoint(firstVersion = "4.23.0", scheme = "alibaba-sls", title = "Alibaba Simple Log Service (SLS)", + syntax = "alibaba-sls:operation", category = { Category.CLOUD, Category.MONITORING }, + headersClass = SLSHeaders.class, producerOnly = true) +public class SLSEndpoint extends DefaultEndpoint { + + @UriPath(description = "Operation to perform", displayName = "Operation", label = "producer", + enums = "putLogs,getLogs,listLogStores") + @Metadata(required = true) + private String operation; + + @UriParam(description = "Alibaba Cloud region", displayName = "Region") + @Metadata(required = true) + private String region; + + @UriParam(description = "SLS endpoint URL (e.g. cn-hangzhou.log.aliyuncs.com). " + + "Carries higher precedence than region based client initialization", + displayName = "Endpoint") + private String endpoint; + + @UriParam(description = "Access key for the cloud user", displayName = "Access Key", + secret = true, security = "secret", label = "security") + private String accessKey; + + @UriParam(description = "Secret key for the cloud user", displayName = "Secret Key", + secret = true, security = "secret", label = "security") + private String secretKey; + + @UriParam(description = "Configuration object for cloud service authentication", displayName = "Service Keys", + secret = true, security = "secret", label = "security") + private ServiceKeys serviceKeys; + + @UriParam(description = "SLS project name", displayName = "Project") + private String project; + + @UriParam(description = "SLS log store name", displayName = "Log Store Name") + private String logStoreName; + + @UriParam(description = "Log query string for getLogs", displayName = "Query", label = "getLogs") + private String query; + + @UriParam(description = "Query start time for getLogs (Unix timestamp in seconds)", displayName = "From", + label = "getLogs") + private Integer from; + + @UriParam(description = "Query end time for getLogs (Unix timestamp in seconds)", displayName = "To", + label = "getLogs") + private Integer to; + + @UriParam(description = "Maximum number of log lines to return for getLogs", displayName = "Line", + label = "getLogs") + private Long line; + + @UriParam(description = "Log query offset for getLogs", displayName = "Offset", label = "getLogs") + private Long offset; + + @UriParam(description = "Log topic filter for getLogs", displayName = "Topic", label = "getLogs") + private String topic; + + @UriParam(description = "Whether to return logs in reverse order for getLogs", displayName = "Reverse", + label = "getLogs") + private Boolean reverse; + + @UriParam(description = "Autowire an existing SLS client instance", displayName = "SLS Client", label = "advanced") + @Metadata(autowired = true) + private Client slsClient; + + private boolean autowiredSlsClient; + + public SLSEndpoint() { + } + + public SLSEndpoint(String uri, String operation, SLSComponent component) { + super(uri, component); + this.operation = operation; + } + + @Override + public Producer createProducer() throws Exception { + return new SLSProducer(this); + } + + @Override + public Consumer createConsumer(Processor processor) throws Exception { + throw new UnsupportedOperationException("You cannot consume from this endpoint"); + } + + public Client initClient() throws Exception { + if (slsClient != null) { + return slsClient; + } + slsClient = SLSUtils.createClient(this); + return slsClient; + } + + @Override + protected void doStop() throws Exception { + if (slsClient != null && !autowiredSlsClient) { + slsClient = null; + } + super.doStop(); + } + + public String getOperation() { + return operation; + } + + public void setOperation(String operation) { + this.operation = operation; + } + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getEndpoint() { + return endpoint; + } + + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public String getAccessKey() { + return accessKey; + } + + public void setAccessKey(String accessKey) { + this.accessKey = accessKey; + } + + public String getSecretKey() { + return secretKey; + } + + public void setSecretKey(String secretKey) { + this.secretKey = secretKey; + } + + public ServiceKeys getServiceKeys() { + return serviceKeys; + } + + public void setServiceKeys(ServiceKeys serviceKeys) { + this.serviceKeys = serviceKeys; + } + + public String getProject() { + return project; + } + + public void setProject(String project) { + this.project = project; + } + + public String getLogStoreName() { + return logStoreName; + } + + public void setLogStoreName(String logStoreName) { + this.logStoreName = logStoreName; + } + + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public Integer getFrom() { + return from; + } + + public void setFrom(Integer from) { + this.from = from; + } + + public Integer getTo() { + return to; + } + + public void setTo(Integer to) { + this.to = to; + } + + public Long getLine() { + return line; + } + + public void setLine(Long line) { + this.line = line; + } + + public Long getOffset() { + return offset; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public String getTopic() { + return topic; + } + + public void setTopic(String topic) { + this.topic = topic; + } + + public Boolean getReverse() { + return reverse; + } + + public void setReverse(Boolean reverse) { + this.reverse = reverse; + } + + public Client getSlsClient() { + return slsClient; + } + + public void setSlsClient(Client slsClient) { + this.slsClient = slsClient; + this.autowiredSlsClient = slsClient != null; + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSProducer.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSProducer.java new file mode 100644 index 0000000000000..0e658da079bb9 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSProducer.java @@ -0,0 +1,126 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls; + +import java.util.Map; + +import com.aliyun.sls20201230.Client; +import com.aliyun.sls20201230.models.GetLogsRequest; +import com.aliyun.sls20201230.models.GetLogsResponse; +import com.aliyun.sls20201230.models.ListLogStoresRequest; +import com.aliyun.sls20201230.models.ListLogStoresResponse; +import com.aliyun.sls20201230.models.PutLogsRequest; +import com.aliyun.sls20201230.models.PutLogsResponse; +import org.apache.camel.Exchange; +import org.apache.camel.component.alibaba.sls.constants.SLSHeaders; +import org.apache.camel.component.alibaba.sls.constants.SLSOperations; +import org.apache.camel.component.alibaba.sls.models.ClientConfigurations; +import org.apache.camel.support.DefaultProducer; +import org.apache.camel.util.ObjectHelper; + +public class SLSProducer extends DefaultProducer { + + private Client slsClient; + + public SLSProducer(SLSEndpoint endpoint) { + super(endpoint); + } + + @Override + public void process(Exchange exchange) throws Exception { + SLSEndpoint endpoint = getEndpoint(); + ClientConfigurations configuration = SLSUtils.createClientConfigurations(endpoint, exchange); + + if (ObjectHelper.isEmpty(configuration.getOperation())) { + throw new IllegalArgumentException("Operation name not found"); + } + + if (slsClient == null) { + slsClient = endpoint.initClient(); + } + + switch (configuration.getOperation()) { + case SLSOperations.PUT_LOGS -> putLogs(exchange, configuration); + case SLSOperations.GET_LOGS -> getLogs(exchange, configuration); + case SLSOperations.LIST_LOG_STORES -> listLogStores(exchange, configuration); + default -> throw new UnsupportedOperationException("Unsupported operation: " + configuration.getOperation()); + } + } + + private void putLogs(Exchange exchange, ClientConfigurations configuration) throws Exception { + validateProjectAndLogStore(configuration); + + PutLogsRequest request = SLSUtils.resolvePutLogsRequest(exchange); + PutLogsResponse response = slsClient.putLogs( + configuration.getProject(), + configuration.getLogStoreName(), + request); + + exchange.getMessage().setBody(SLSUtils.toPutLogsMap(response)); + setResponseHeaders(exchange, response.getStatusCode(), response.getHeaders()); + } + + private void getLogs(Exchange exchange, ClientConfigurations configuration) throws Exception { + validateProjectAndLogStore(configuration); + + GetLogsRequest request = SLSUtils.buildGetLogsRequest(configuration); + GetLogsResponse response = slsClient.getLogs( + configuration.getProject(), + configuration.getLogStoreName(), + request); + + exchange.getMessage().setBody(SLSUtils.toGetLogsMap(response)); + setResponseHeaders(exchange, response.getStatusCode(), response.getHeaders()); + } + + private void listLogStores(Exchange exchange, ClientConfigurations configuration) throws Exception { + validateProject(configuration); + + ListLogStoresRequest request = SLSUtils.buildListLogStoresRequest(configuration); + ListLogStoresResponse response = slsClient.listLogStores(configuration.getProject(), request); + + exchange.getMessage().setBody(SLSUtils.toListLogStoresMap(response)); + setResponseHeaders(exchange, response.getStatusCode(), response.getHeaders()); + } + + private void validateProjectAndLogStore(ClientConfigurations configuration) { + if (ObjectHelper.isEmpty(configuration.getProject()) || ObjectHelper.isEmpty(configuration.getLogStoreName())) { + throw new IllegalArgumentException("Project and log store name are required"); + } + } + + private void validateProject(ClientConfigurations configuration) { + if (ObjectHelper.isEmpty(configuration.getProject())) { + throw new IllegalArgumentException("Project is required"); + } + } + + private void setResponseHeaders(Exchange exchange, Integer statusCode, Map headers) { + if (statusCode != null) { + exchange.getMessage().setHeader(SLSHeaders.STATUS_CODE, statusCode); + } + String requestId = SLSUtils.extractRequestId(headers); + if (ObjectHelper.isNotEmpty(requestId)) { + exchange.getMessage().setHeader(SLSHeaders.REQUEST_ID, requestId); + } + } + + @Override + public SLSEndpoint getEndpoint() { + return (SLSEndpoint) super.getEndpoint(); + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSUtils.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSUtils.java new file mode 100644 index 0000000000000..6dbbf1081be01 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSUtils.java @@ -0,0 +1,214 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls; + +import java.util.HashMap; +import java.util.Map; + +import com.aliyun.sls20201230.Client; +import com.aliyun.sls20201230.models.GetLogsRequest; +import com.aliyun.sls20201230.models.GetLogsResponse; +import com.aliyun.sls20201230.models.ListLogStoresRequest; +import com.aliyun.sls20201230.models.ListLogStoresResponse; +import com.aliyun.sls20201230.models.ListLogStoresResponseBody; +import com.aliyun.sls20201230.models.LogGroup; +import com.aliyun.sls20201230.models.PutLogsRequest; +import com.aliyun.sls20201230.models.PutLogsResponse; +import com.aliyun.teaopenapi.models.Config; +import org.apache.camel.Exchange; +import org.apache.camel.component.alibaba.common.OpenApiClientSupport; +import org.apache.camel.component.alibaba.common.models.ServiceKeys; +import org.apache.camel.component.alibaba.sls.constants.SLSProperties; +import org.apache.camel.component.alibaba.sls.models.ClientConfigurations; +import org.apache.camel.util.ObjectHelper; + +public final class SLSUtils { + + private SLSUtils() { + } + + public static Client createClient(SLSEndpoint endpoint) throws Exception { + if (ObjectHelper.isEmpty(endpoint.getRegion()) && ObjectHelper.isEmpty(endpoint.getEndpoint())) { + throw new IllegalArgumentException("Region or endpoint is required"); + } + + return new Client( + createTeaConfig( + endpoint.getAccessKey(), + endpoint.getSecretKey(), + endpoint.getServiceKeys(), + endpoint.getRegion(), + endpoint.getEndpoint())); + } + + private static Config createTeaConfig( + String accessKey, String secretKey, ServiceKeys serviceKeys, String region, String endpoint) { + Config config = new Config(); + config.setAccessKeyId(OpenApiClientSupport.resolveAccessKey(accessKey, serviceKeys)); + config.setAccessKeySecret(OpenApiClientSupport.resolveSecretKey(secretKey, serviceKeys)); + if (ObjectHelper.isNotEmpty(region)) { + config.setRegionId(region); + } + if (ObjectHelper.isNotEmpty(endpoint)) { + config.setEndpoint(endpoint); + } + return config; + } + + public static ClientConfigurations createClientConfigurations(SLSEndpoint endpoint, Exchange exchange) { + ClientConfigurations configuration = new ClientConfigurations(); + configuration + .setOperation(OpenApiClientSupport.resolveString(exchange, SLSProperties.OPERATION, endpoint.getOperation())); + configuration.setProject( + OpenApiClientSupport.resolveString(exchange, SLSProperties.PROJECT, endpoint.getProject())); + configuration.setLogStoreName( + OpenApiClientSupport.resolveString(exchange, SLSProperties.LOG_STORE_NAME, endpoint.getLogStoreName())); + configuration.setQuery(OpenApiClientSupport.resolveString(exchange, SLSProperties.QUERY, endpoint.getQuery())); + configuration.setFrom(OpenApiClientSupport.resolveInteger(exchange, SLSProperties.FROM, endpoint.getFrom())); + configuration.setTo(OpenApiClientSupport.resolveInteger(exchange, SLSProperties.TO, endpoint.getTo())); + configuration.setLine(resolveLong(exchange, SLSProperties.LINE, endpoint.getLine())); + configuration.setOffset(resolveLong(exchange, SLSProperties.OFFSET, endpoint.getOffset())); + configuration.setTopic(OpenApiClientSupport.resolveString(exchange, SLSProperties.TOPIC, endpoint.getTopic())); + configuration.setReverse(resolveBoolean(exchange, SLSProperties.REVERSE, endpoint.getReverse())); + configuration.setLogstoreName( + OpenApiClientSupport.resolveString(exchange, SLSProperties.LOGSTORE_NAME, null)); + configuration.setMode(OpenApiClientSupport.resolveString(exchange, SLSProperties.MODE, null)); + configuration.setListOffset(OpenApiClientSupport.resolveInteger(exchange, SLSProperties.OFFSET, null)); + configuration.setSize(OpenApiClientSupport.resolveInteger(exchange, SLSProperties.SIZE, null)); + configuration.setTelemetryType( + OpenApiClientSupport.resolveString(exchange, SLSProperties.TELEMETRY_TYPE, null)); + return configuration; + } + + public static PutLogsRequest resolvePutLogsRequest(Exchange exchange) { + Object body = exchange.getMessage().getBody(); + if (body instanceof PutLogsRequest putLogsRequest) { + return putLogsRequest; + } + if (body instanceof LogGroup logGroup) { + return new PutLogsRequest().setBody(logGroup); + } + throw new IllegalArgumentException("Body must be LogGroup or PutLogsRequest for putLogs"); + } + + public static GetLogsRequest buildGetLogsRequest(ClientConfigurations configuration) { + GetLogsRequest request = new GetLogsRequest(); + if (ObjectHelper.isNotEmpty(configuration.getQuery())) { + request.setQuery(configuration.getQuery()); + } + if (configuration.getFrom() != null) { + request.setFrom(configuration.getFrom()); + } + if (configuration.getTo() != null) { + request.setTo(configuration.getTo()); + } + if (configuration.getLine() != null) { + request.setLine(configuration.getLine()); + } + if (configuration.getOffset() != null) { + request.setOffset(configuration.getOffset()); + } + if (ObjectHelper.isNotEmpty(configuration.getTopic())) { + request.setTopic(configuration.getTopic()); + } + if (configuration.getReverse() != null) { + request.setReverse(configuration.getReverse()); + } + return request; + } + + public static ListLogStoresRequest buildListLogStoresRequest(ClientConfigurations configuration) { + ListLogStoresRequest request = new ListLogStoresRequest(); + if (ObjectHelper.isNotEmpty(configuration.getLogstoreName())) { + request.setLogstoreName(configuration.getLogstoreName()); + } + if (ObjectHelper.isNotEmpty(configuration.getMode())) { + request.setMode(configuration.getMode()); + } + if (configuration.getListOffset() != null) { + request.setOffset(configuration.getListOffset()); + } + if (configuration.getSize() != null) { + request.setSize(configuration.getSize()); + } + if (ObjectHelper.isNotEmpty(configuration.getTelemetryType())) { + request.setTelemetryType(configuration.getTelemetryType()); + } + return request; + } + + public static Map toPutLogsMap(PutLogsResponse response) { + Map map = new HashMap<>(); + map.put("statusCode", response.getStatusCode()); + map.put("headers", response.getHeaders()); + return map; + } + + public static Map toGetLogsMap(GetLogsResponse response) { + Map map = new HashMap<>(); + map.put("statusCode", response.getStatusCode()); + map.put("headers", response.getHeaders()); + map.put("body", response.getBody()); + return map; + } + + public static Map toListLogStoresMap(ListLogStoresResponse response) { + Map map = new HashMap<>(); + map.put("statusCode", response.getStatusCode()); + map.put("headers", response.getHeaders()); + ListLogStoresResponseBody body = response.getBody(); + if (body != null) { + map.put("count", body.getCount()); + map.put("logstores", body.getLogstores()); + map.put("total", body.getTotal()); + } + return map; + } + + public static String extractRequestId(Map headers) { + if (headers == null) { + return null; + } + String requestId = headers.get("x-log-requestid"); + if (ObjectHelper.isEmpty(requestId)) { + requestId = headers.get("x-log-requestId"); + } + return requestId; + } + + private static Long resolveLong(Exchange exchange, String name, Long endpointValue) { + Long value = exchange.getIn().getHeader(name, Long.class); + if (value == null) { + value = exchange.getProperty(name, Long.class); + } + if (value == null) { + value = endpointValue; + } + return value; + } + + private static Boolean resolveBoolean(Exchange exchange, String name, Boolean endpointValue) { + Boolean value = exchange.getIn().getHeader(name, Boolean.class); + if (value == null) { + value = exchange.getProperty(name, Boolean.class); + } + if (value == null) { + value = endpointValue; + } + return value; + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSHeaders.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSHeaders.java new file mode 100644 index 0000000000000..dfe149d724402 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSHeaders.java @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls.constants; + +import org.apache.camel.spi.Metadata; + +public final class SLSHeaders { + + @Metadata(label = "producer", description = "SLS project name override", javaType = "String") + public static final String PROJECT = SLSProperties.PROJECT; + + @Metadata(label = "producer", description = "SLS log store name override", javaType = "String") + public static final String LOG_STORE_NAME = SLSProperties.LOG_STORE_NAME; + + @Metadata(label = "producer", description = "Log query string override", javaType = "String") + public static final String QUERY = SLSProperties.QUERY; + + @Metadata(label = "producer", description = "Query start time override (Unix timestamp in seconds)", javaType = "Integer") + public static final String FROM = SLSProperties.FROM; + + @Metadata(label = "producer", description = "Query end time override (Unix timestamp in seconds)", javaType = "Integer") + public static final String TO = SLSProperties.TO; + + @Metadata(label = "producer", description = "Maximum number of log lines to return", javaType = "Long") + public static final String LINE = SLSProperties.LINE; + + @Metadata(label = "producer", description = "Log query offset", javaType = "Long") + public static final String OFFSET = SLSProperties.OFFSET; + + @Metadata(label = "producer", description = "Log topic filter override", javaType = "String") + public static final String TOPIC = SLSProperties.TOPIC; + + @Metadata(label = "producer", description = "Whether to return logs in reverse order", javaType = "Boolean") + public static final String REVERSE = SLSProperties.REVERSE; + + @Metadata(label = "producer", description = "Log store name prefix filter for listLogStores", javaType = "String") + public static final String LOGSTORE_NAME = SLSProperties.LOGSTORE_NAME; + + @Metadata(label = "producer", description = "List mode for listLogStores", javaType = "String") + public static final String MODE = SLSProperties.MODE; + + @Metadata(label = "producer", description = "Page size for listLogStores", javaType = "Integer") + public static final String SIZE = SLSProperties.SIZE; + + @Metadata(label = "producer", description = "Telemetry type filter for listLogStores", javaType = "String") + public static final String TELEMETRY_TYPE = SLSProperties.TELEMETRY_TYPE; + + @Metadata(label = "producer", description = "Alibaba Cloud request id", javaType = "String") + public static final String REQUEST_ID = SLSProperties.REQUEST_ID; + + @Metadata(label = "producer", description = "HTTP status code from SLS response", javaType = "Integer") + public static final String STATUS_CODE = "CamelAlibabaSlsStatusCode"; + + private SLSHeaders() { + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSOperations.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSOperations.java new file mode 100644 index 0000000000000..312f81bbb4eee --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSOperations.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls.constants; + +public final class SLSOperations { + + public static final String PUT_LOGS = "putLogs"; + public static final String GET_LOGS = "getLogs"; + public static final String LIST_LOG_STORES = "listLogStores"; + + private SLSOperations() { + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSProperties.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSProperties.java new file mode 100644 index 0000000000000..47c673ca7db95 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSProperties.java @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls.constants; + +import org.apache.camel.spi.Metadata; + +public final class SLSProperties { + + @Metadata(label = "producer", description = "Operation to perform", javaType = "String") + public static final String OPERATION = "CamelAlibabaSlsOperation"; + + @Metadata(label = "producer", description = "SLS project name override", javaType = "String") + public static final String PROJECT = "CamelAlibabaSlsProject"; + + @Metadata(label = "producer", description = "SLS log store name override", javaType = "String") + public static final String LOG_STORE_NAME = "CamelAlibabaSlsLogStoreName"; + + @Metadata(label = "producer", description = "Log query string override", javaType = "String") + public static final String QUERY = "CamelAlibabaSlsQuery"; + + @Metadata(label = "producer", description = "Query start time override (Unix timestamp in seconds)", javaType = "Integer") + public static final String FROM = "CamelAlibabaSlsFrom"; + + @Metadata(label = "producer", description = "Query end time override (Unix timestamp in seconds)", javaType = "Integer") + public static final String TO = "CamelAlibabaSlsTo"; + + @Metadata(label = "producer", description = "Maximum number of log lines to return", javaType = "Long") + public static final String LINE = "CamelAlibabaSlsLine"; + + @Metadata(label = "producer", description = "Log query offset", javaType = "Long") + public static final String OFFSET = "CamelAlibabaSlsOffset"; + + @Metadata(label = "producer", description = "Log topic filter override", javaType = "String") + public static final String TOPIC = "CamelAlibabaSlsTopic"; + + @Metadata(label = "producer", description = "Whether to return logs in reverse order", javaType = "Boolean") + public static final String REVERSE = "CamelAlibabaSlsReverse"; + + @Metadata(label = "producer", description = "Log store name prefix filter for listLogStores", javaType = "String") + public static final String LOGSTORE_NAME = "CamelAlibabaSlsLogstoreName"; + + @Metadata(label = "producer", description = "List mode for listLogStores", javaType = "String") + public static final String MODE = "CamelAlibabaSlsMode"; + + @Metadata(label = "producer", description = "Page size for listLogStores", javaType = "Integer") + public static final String SIZE = "CamelAlibabaSlsSize"; + + @Metadata(label = "producer", description = "Telemetry type filter for listLogStores", javaType = "String") + public static final String TELEMETRY_TYPE = "CamelAlibabaSlsTelemetryType"; + + @Metadata(label = "producer", description = "Request id returned by SLS", javaType = "String") + public static final String REQUEST_ID = "CamelAlibabaSlsRequestId"; + + private SLSProperties() { + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/models/ClientConfigurations.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/models/ClientConfigurations.java new file mode 100644 index 0000000000000..4353002a1ee48 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/models/ClientConfigurations.java @@ -0,0 +1,156 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls.models; + +public class ClientConfigurations { + + private String operation; + private String project; + private String logStoreName; + private String query; + private Integer from; + private Integer to; + private Long line; + private Long offset; + private String topic; + private Boolean reverse; + private String logstoreName; + private String mode; + private Integer listOffset; + private Integer size; + private String telemetryType; + + public String getOperation() { + return operation; + } + + public void setOperation(String operation) { + this.operation = operation; + } + + public String getProject() { + return project; + } + + public void setProject(String project) { + this.project = project; + } + + public String getLogStoreName() { + return logStoreName; + } + + public void setLogStoreName(String logStoreName) { + this.logStoreName = logStoreName; + } + + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public Integer getFrom() { + return from; + } + + public void setFrom(Integer from) { + this.from = from; + } + + public Integer getTo() { + return to; + } + + public void setTo(Integer to) { + this.to = to; + } + + public Long getLine() { + return line; + } + + public void setLine(Long line) { + this.line = line; + } + + public Long getOffset() { + return offset; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public String getTopic() { + return topic; + } + + public void setTopic(String topic) { + this.topic = topic; + } + + public Boolean getReverse() { + return reverse; + } + + public void setReverse(Boolean reverse) { + this.reverse = reverse; + } + + public String getLogstoreName() { + return logstoreName; + } + + public void setLogstoreName(String logstoreName) { + this.logstoreName = logstoreName; + } + + public String getMode() { + return mode; + } + + public void setMode(String mode) { + this.mode = mode; + } + + public Integer getListOffset() { + return listOffset; + } + + public void setListOffset(Integer listOffset) { + this.listOffset = listOffset; + } + + public Integer getSize() { + return size; + } + + public void setSize(Integer size) { + this.size = size; + } + + public String getTelemetryType() { + return telemetryType; + } + + public void setTelemetryType(String telemetryType) { + this.telemetryType = telemetryType; + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/GetLogsTest.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/GetLogsTest.java new file mode 100644 index 0000000000000..9c04615e95a92 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/GetLogsTest.java @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import com.aliyun.sls20201230.Client; +import com.aliyun.sls20201230.models.GetLogsRequest; +import com.aliyun.sls20201230.models.GetLogsResponse; +import org.apache.camel.BindToRegistry; +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.alibaba.sls.constants.SLSHeaders; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.junit6.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +class GetLogsTest extends CamelTestSupport { + + private final TestConfiguration testConfiguration = new TestConfiguration(); + + @BindToRegistry("slsClient") + Client slsClient = mock(Client.class); + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + @Override + public void configure() { + from("direct:getLogs") + .to("alibaba-sls:getLogs" + + "?project=" + testConfiguration.getProperty("project") + + "&logStoreName=" + testConfiguration.getProperty("logStoreName") + + "®ion=" + testConfiguration.getProperty("region") + + "&endpoint=" + testConfiguration.getProperty("endpoint") + + "&accessKey=" + testConfiguration.getProperty("accessKey") + + "&secretKey=" + testConfiguration.getProperty("secretKey") + + "&query=*" + + "&from=1700000000" + + "&to=1700003600" + + "&line=100" + + "&slsClient=#slsClient") + .to("mock:result"); + } + }; + } + + @Test + void testGetLogs() throws Exception { + GetLogsResponse response = new GetLogsResponse(); + response.setStatusCode(200); + response.setHeaders(Collections.singletonMap("x-log-requestid", "req-456")); + response.setBody(List.of(Map.of("message", "log line"))); + + when(slsClient.getLogs( + eq(testConfiguration.getProperty("project")), + eq(testConfiguration.getProperty("logStoreName")), + any(GetLogsRequest.class))).thenReturn(response); + + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedMinimumMessageCount(1); + + template.sendBody("direct:getLogs", null); + + mock.assertIsSatisfied(); + + Exchange exchange = mock.getExchanges().get(0); + assertThat(exchange.getMessage().getBody(Map.class)) + .containsEntry("statusCode", 200) + .containsEntry("body", List.of(Map.of("message", "log line"))); + assertThat(exchange.getMessage().getHeader(SLSHeaders.STATUS_CODE)).isEqualTo(200); + assertThat(exchange.getMessage().getHeader(SLSHeaders.REQUEST_ID)).isEqualTo("req-456"); + + verify(slsClient).getLogs( + eq(testConfiguration.getProperty("project")), + eq(testConfiguration.getProperty("logStoreName")), + any(GetLogsRequest.class)); + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/ListLogStoresTest.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/ListLogStoresTest.java new file mode 100644 index 0000000000000..8be8844f71fa8 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/ListLogStoresTest.java @@ -0,0 +1,101 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import com.aliyun.sls20201230.Client; +import com.aliyun.sls20201230.models.ListLogStoresRequest; +import com.aliyun.sls20201230.models.ListLogStoresResponse; +import com.aliyun.sls20201230.models.ListLogStoresResponseBody; +import org.apache.camel.BindToRegistry; +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.alibaba.sls.constants.SLSHeaders; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.junit6.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +class ListLogStoresTest extends CamelTestSupport { + + private final TestConfiguration testConfiguration = new TestConfiguration(); + + @BindToRegistry("slsClient") + Client slsClient = mock(Client.class); + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + @Override + public void configure() { + from("direct:listLogStores") + .to("alibaba-sls:listLogStores" + + "?project=" + testConfiguration.getProperty("project") + + "®ion=" + testConfiguration.getProperty("region") + + "&endpoint=" + testConfiguration.getProperty("endpoint") + + "&accessKey=" + testConfiguration.getProperty("accessKey") + + "&secretKey=" + testConfiguration.getProperty("secretKey") + + "&slsClient=#slsClient") + .to("mock:result"); + } + }; + } + + @Test + void testListLogStores() throws Exception { + ListLogStoresResponse response = new ListLogStoresResponse(); + response.setStatusCode(200); + response.setHeaders(Collections.singletonMap("x-log-requestid", "req-789")); + response.setBody(new ListLogStoresResponseBody() + .setCount(2) + .setTotal(2) + .setLogstores(List.of("logstore-a", "logstore-b"))); + + when(slsClient.listLogStores( + eq(testConfiguration.getProperty("project")), + any(ListLogStoresRequest.class))).thenReturn(response); + + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedMinimumMessageCount(1); + + template.sendBody("direct:listLogStores", null); + + mock.assertIsSatisfied(); + + Exchange exchange = mock.getExchanges().get(0); + assertThat(exchange.getMessage().getBody(Map.class)) + .containsEntry("statusCode", 200) + .containsEntry("count", 2) + .containsEntry("total", 2) + .containsEntry("logstores", List.of("logstore-a", "logstore-b")); + assertThat(exchange.getMessage().getHeader(SLSHeaders.STATUS_CODE)).isEqualTo(200); + assertThat(exchange.getMessage().getHeader(SLSHeaders.REQUEST_ID)).isEqualTo("req-789"); + + verify(slsClient).listLogStores( + eq(testConfiguration.getProperty("project")), + any(ListLogStoresRequest.class)); + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/PutLogsTest.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/PutLogsTest.java new file mode 100644 index 0000000000000..cfca7db79f15b --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/PutLogsTest.java @@ -0,0 +1,104 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import com.aliyun.sls20201230.Client; +import com.aliyun.sls20201230.models.LogContent; +import com.aliyun.sls20201230.models.LogGroup; +import com.aliyun.sls20201230.models.LogItem; +import com.aliyun.sls20201230.models.PutLogsRequest; +import com.aliyun.sls20201230.models.PutLogsResponse; +import org.apache.camel.BindToRegistry; +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.alibaba.sls.constants.SLSHeaders; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.junit6.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +class PutLogsTest extends CamelTestSupport { + + private final TestConfiguration testConfiguration = new TestConfiguration(); + + @BindToRegistry("slsClient") + Client slsClient = mock(Client.class); + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + @Override + public void configure() { + from("direct:putLogs") + .to("alibaba-sls:putLogs" + + "?project=" + testConfiguration.getProperty("project") + + "&logStoreName=" + testConfiguration.getProperty("logStoreName") + + "®ion=" + testConfiguration.getProperty("region") + + "&endpoint=" + testConfiguration.getProperty("endpoint") + + "&accessKey=" + testConfiguration.getProperty("accessKey") + + "&secretKey=" + testConfiguration.getProperty("secretKey") + + "&slsClient=#slsClient") + .to("mock:result"); + } + }; + } + + @Test + void testPutLogsWithLogGroup() throws Exception { + PutLogsResponse response = new PutLogsResponse(); + response.setStatusCode(200); + response.setHeaders(Collections.singletonMap("x-log-requestid", "req-123")); + + when(slsClient.putLogs( + eq(testConfiguration.getProperty("project")), + eq(testConfiguration.getProperty("logStoreName")), + any(PutLogsRequest.class))).thenReturn(response); + + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedMinimumMessageCount(1); + + LogGroup logGroup = new LogGroup() + .setTopic("test-topic") + .setLogItems(List.of(new LogItem() + .setTime(1700000000) + .setContents(List.of(new LogContent().setKey("message").setValue("hello sls"))))); + template.sendBody("direct:putLogs", logGroup); + + mock.assertIsSatisfied(); + + Exchange exchange = mock.getExchanges().get(0); + assertThat(exchange.getMessage().getBody(Map.class)) + .containsEntry("statusCode", 200); + assertThat(exchange.getMessage().getHeader(SLSHeaders.STATUS_CODE)).isEqualTo(200); + assertThat(exchange.getMessage().getHeader(SLSHeaders.REQUEST_ID)).isEqualTo("req-123"); + + verify(slsClient).putLogs( + eq(testConfiguration.getProperty("project")), + eq(testConfiguration.getProperty("logStoreName")), + any(PutLogsRequest.class)); + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSEndpointTest.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSEndpointTest.java new file mode 100644 index 0000000000000..9038ecdc1d7f0 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSEndpointTest.java @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls; + +import com.aliyun.sls20201230.Client; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; + +class SLSEndpointTest { + + @Test + void doStopKeepsAutowiredClient() throws Exception { + SLSEndpoint endpoint = new SLSEndpoint(); + Client client = mock(Client.class); + endpoint.setSlsClient(client); + + endpoint.doStop(); + + assertThat(endpoint.getSlsClient()).isSameAs(client); + } + + @Test + void doStopClearsOwnedClient() throws Exception { + SLSEndpoint endpoint = new SLSEndpoint(); + Client client = mock(Client.class); + + var clientField = SLSEndpoint.class.getDeclaredField("slsClient"); + clientField.setAccessible(true); + clientField.set(endpoint, client); + + var autowiredField = SLSEndpoint.class.getDeclaredField("autowiredSlsClient"); + autowiredField.setAccessible(true); + autowiredField.setBoolean(endpoint, false); + + endpoint.doStop(); + + assertThat(endpoint.getSlsClient()).isNull(); + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/TestConfiguration.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/TestConfiguration.java new file mode 100644 index 0000000000000..8e553e707f829 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/TestConfiguration.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls; + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import org.apache.camel.test.junit6.TestSupport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class TestConfiguration { + + private static final Logger LOGGER = LoggerFactory.getLogger(TestConfiguration.class); + private static Map propertyMap; + + TestConfiguration() { + initPropertyMap(); + } + + void initPropertyMap() { + if (propertyMap == null) { + propertyMap = new HashMap<>(); + String propertyFileName = "testconfiguration.properties"; + try { + Properties properties = TestSupport.loadExternalProperties(getClass().getClassLoader(), propertyFileName); + for (String key : properties.stringPropertyNames()) { + propertyMap.put(key, properties.getProperty(key)); + } + } catch (Exception e) { + LOGGER.error("Cannot load property file {}, reason {}", propertyFileName, e.getMessage()); + } + } + } + + String getProperty(String key) { + if (propertyMap == null) { + initPropertyMap(); + } + return propertyMap.get(key); + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/constants/SLSOperationsTest.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/constants/SLSOperationsTest.java new file mode 100644 index 0000000000000..87f96c087388d --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/constants/SLSOperationsTest.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls.constants; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +class SLSOperationsTest { + + @Test + void testOperationNames() { + assertThat(SLSOperations.PUT_LOGS).isEqualTo("putLogs"); + assertThat(SLSOperations.GET_LOGS).isEqualTo("getLogs"); + assertThat(SLSOperations.LIST_LOG_STORES).isEqualTo("listLogStores"); + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/resources/log4j2.properties b/components/camel-alibaba/camel-alibaba-sls/src/test/resources/log4j2.properties new file mode 100644 index 0000000000000..47e9930b6978a --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/resources/log4j2.properties @@ -0,0 +1,29 @@ +## --------------------------------------------------------------------------- +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You under the Apache License, Version 2.0 +## (the "License"); you may not use this file except in compliance with +## the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## --------------------------------------------------------------------------- + +appender.file.type = File +appender.file.name = file +appender.file.fileName = target/camel-alibaba-sls-test.log +appender.file.layout.type = PatternLayout +appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n +appender.out.type = Console +appender.out.name = out +appender.out.layout.type = PatternLayout +appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n + +rootLogger.level = INFO +rootLogger.appenderRef.file.ref = file diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/resources/testconfiguration.properties b/components/camel-alibaba/camel-alibaba-sls/src/test/resources/testconfiguration.properties new file mode 100644 index 0000000000000..b275df612f150 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/resources/testconfiguration.properties @@ -0,0 +1,23 @@ +## --------------------------------------------------------------------------- +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You under the Apache License, Version 2.0 +## (the "License"); you may not use this file except in compliance with +## the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## --------------------------------------------------------------------------- + +accessKey=dummy_access_key +secretKey=dummy_secret_key +region=cn-hangzhou +endpoint=cn-hangzhou.log.aliyuncs.com +project=test-project +logStoreName=test-logstore diff --git a/parent/pom.xml b/parent/pom.xml index 27fd8b3850352..990d88c866705 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -818,6 +818,11 @@ camel-alibaba-ots ${project.version} + + org.apache.camel + camel-alibaba-sls + ${project.version} + org.apache.camel camel-alibaba-sms From 1859fc284ffc545e98f259d4fea3432ff5d1ef4c Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 14 Aug 2026 07:06:05 +0000 Subject: [PATCH 3/9] CAMEL-24373: Wire SLS/OTS catalog, docs, BOM, coverage and DSL Add camel-alibaba-sls and camel-alibaba-ots to BOM and coverage modules. Regenerate catalog, component/endpoint DSL, kamelet dependencies, and component documentation pages for Phase 3 Alibaba Cloud integration. Co-authored-by: Omar Atie --- bom/camel-bom/pom.xml | 5 + .../camel/catalog/components.properties | 2 + .../camel/catalog/components/alibaba-ots.json | 46 ++ .../camel/catalog/components/alibaba-sls.json | 68 ++ .../org/apache/camel/catalog/docs.properties | 2 + .../catalog/docs/alibaba-ots-component.adoc | 73 ++ .../catalog/docs/alibaba-sls-component.adoc | 87 +++ .../camel-main-configuration-metadata.json | 2 +- .../apache/camel/main/components.properties | 2 + coverage/pom.xml | 5 + .../ROOT/examples/json/alibaba-ots.json | 46 ++ .../ROOT/examples/json/alibaba-sls.json | 68 ++ docs/components/modules/ROOT/nav.adoc | 2 + .../ROOT/pages/alibaba-ots-component.adoc | 1 + .../ROOT/pages/alibaba-sls-component.adoc | 1 + .../component/ComponentsBuilderFactory.java | 26 + .../AlibabaOtsComponentBuilderFactory.java | 160 ++++ .../AlibabaSlsComponentBuilderFactory.java | 160 ++++ .../endpoint/EndpointBuilderFactory.java | 2 + .../builder/endpoint/EndpointBuilders.java | 2 + .../endpoint/EndpointHeaderBuilders.java | 26 + .../endpoint/StaticEndpointBuilders.java | 88 +++ .../dsl/OTSEndpointBuilderFactory.java | 328 +++++++++ .../dsl/SLSEndpointBuilderFactory.java | 684 ++++++++++++++++++ ...el-component-known-dependencies.properties | 2 + 25 files changed, 1887 insertions(+), 1 deletion(-) create mode 100644 catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-ots.json create mode 100644 catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-sls.json create mode 100644 catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/alibaba-ots-component.adoc create mode 100644 catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/alibaba-sls-component.adoc create mode 100644 docs/components/modules/ROOT/examples/json/alibaba-ots.json create mode 100644 docs/components/modules/ROOT/examples/json/alibaba-sls.json create mode 120000 docs/components/modules/ROOT/pages/alibaba-ots-component.adoc create mode 120000 docs/components/modules/ROOT/pages/alibaba-sls-component.adoc create mode 100644 dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaOtsComponentBuilderFactory.java create mode 100644 dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaSlsComponentBuilderFactory.java create mode 100644 dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OTSEndpointBuilderFactory.java create mode 100644 dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SLSEndpointBuilderFactory.java diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml index 919dd419ce909..8878dbf5cdb0b 100644 --- a/bom/camel-bom/pom.xml +++ b/bom/camel-bom/pom.xml @@ -106,6 +106,11 @@ camel-alibaba-oss 4.23.0-SNAPSHOT + + org.apache.camel + camel-alibaba-sls + 4.23.0-SNAPSHOT + org.apache.camel camel-alibaba-ots diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties index 6b481121cb525..eb2f0cb47a420 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties @@ -7,6 +7,8 @@ alibaba-fc alibaba-kms alibaba-mns alibaba-oss +alibaba-ots +alibaba-sls alibaba-sms amqp arangodb diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-ots.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-ots.json new file mode 100644 index 0000000000000..442b35c56bb3f --- /dev/null +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-ots.json @@ -0,0 +1,46 @@ +{ + "component": { + "kind": "component", + "name": "alibaba-ots", + "title": "Alibaba Tablestore (OTS)", + "description": "Perform row operations on Alibaba Cloud Tablestore (OTS).", + "deprecated": false, + "firstVersion": "4.23.0", + "label": "cloud,database", + "javaType": "org.apache.camel.component.alibaba.ots.OTSComponent", + "supportLevel": "Preview", + "groupId": "org.apache.camel", + "artifactId": "camel-alibaba-ots", + "version": "4.23.0-SNAPSHOT", + "scheme": "alibaba-ots", + "extendsScheme": "", + "syntax": "alibaba-ots:operation", + "async": false, + "api": false, + "consumerOnly": false, + "producerOnly": true, + "lenientProperties": false, + "browsable": false, + "remote": true + }, + "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 during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "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 type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, + "healthCheckConsumerEnabled": { "index": 2, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, + "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } + }, + "headers": { + "CamelAlibabaOtsOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation override", "constantName": "org.apache.camel.component.alibaba.ots.constants.OTSHeaders#OPERATION" }, + "CamelAlibabaOtsRequestId": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore request id", "constantName": "org.apache.camel.component.alibaba.ots.constants.OTSHeaders#REQUEST_ID" } + }, + "properties": { + "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putRow", "getRow", "updateRow", "deleteRow", "listTables" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, + "endpoint": { "index": 1, "kind": "parameter", "displayName": "Endpoint", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore endpoint URL" }, + "instanceName": { "index": 2, "kind": "parameter", "displayName": "Instance Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore instance name" }, + "lazyStartProducer": { "index": 3, "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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "otsClient": { "index": 4, "kind": "parameter", "displayName": "OTS Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.alicloud.openservices.tablestore.SyncClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "description": "Autowire an existing Tablestore client instance" }, + "accessKey": { "index": 5, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Access key for the cloud user" }, + "secretKey": { "index": 6, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Secret key for the cloud user" }, + "serviceKeys": { "index": 7, "kind": "parameter", "displayName": "Service Keys", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.component.alibaba.common.models.ServiceKeys", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Configuration object for cloud service authentication" } + } +} diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-sls.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-sls.json new file mode 100644 index 0000000000000..940a63a6242a7 --- /dev/null +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-sls.json @@ -0,0 +1,68 @@ +{ + "component": { + "kind": "component", + "name": "alibaba-sls", + "title": "Alibaba Simple Log Service (SLS)", + "description": "Manage logs on Alibaba Cloud Simple Log Service (SLS).", + "deprecated": false, + "firstVersion": "4.23.0", + "label": "cloud,monitoring", + "javaType": "org.apache.camel.component.alibaba.sls.SLSComponent", + "supportLevel": "Preview", + "groupId": "org.apache.camel", + "artifactId": "camel-alibaba-sls", + "version": "4.23.0-SNAPSHOT", + "scheme": "alibaba-sls", + "extendsScheme": "", + "syntax": "alibaba-sls:operation", + "async": false, + "api": false, + "consumerOnly": false, + "producerOnly": true, + "lenientProperties": false, + "browsable": false, + "remote": true + }, + "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 during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "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 type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, + "healthCheckConsumerEnabled": { "index": 2, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, + "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } + }, + "headers": { + "CamelAlibabaSlsProject": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS project name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#PROJECT" }, + "CamelAlibabaSlsLogStoreName": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS log store name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LOG_STORE_NAME" }, + "CamelAlibabaSlsQuery": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query string override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#QUERY" }, + "CamelAlibabaSlsFrom": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query start time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#FROM" }, + "CamelAlibabaSlsTo": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query end time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TO" }, + "CamelAlibabaSlsLine": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Maximum number of log lines to return", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LINE" }, + "CamelAlibabaSlsOffset": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query offset", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#OFFSET" }, + "CamelAlibabaSlsTopic": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log topic filter override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TOPIC" }, + "CamelAlibabaSlsReverse": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether to return logs in reverse order", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#REVERSE" }, + "CamelAlibabaSlsLogstoreName": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log store name prefix filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LOGSTORE_NAME" }, + "CamelAlibabaSlsMode": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List mode for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#MODE" }, + "CamelAlibabaSlsSize": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Page size for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#SIZE" }, + "CamelAlibabaSlsTelemetryType": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Telemetry type filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TELEMETRY_TYPE" }, + "CamelAlibabaSlsRequestId": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud request id", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#REQUEST_ID" }, + "CamelAlibabaSlsStatusCode": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "HTTP status code from SLS response", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#STATUS_CODE" } + }, + "properties": { + "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putLogs", "getLogs", "listLogStores" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, + "endpoint": { "index": 1, "kind": "parameter", "displayName": "Endpoint", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS endpoint URL (e.g. cn-hangzhou.log.aliyuncs.com). Carries higher precedence than region based client initialization" }, + "logStoreName": { "index": 2, "kind": "parameter", "displayName": "Log Store Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS log store name" }, + "project": { "index": 3, "kind": "parameter", "displayName": "Project", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS project name" }, + "region": { "index": 4, "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud region" }, + "lazyStartProducer": { "index": 5, "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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "slsClient": { "index": 6, "kind": "parameter", "displayName": "SLS Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.aliyun.sls20201230.Client", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "description": "Autowire an existing SLS client instance" }, + "from": { "index": 7, "kind": "parameter", "displayName": "From", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Query start time for getLogs (Unix timestamp in seconds)" }, + "line": { "index": 8, "kind": "parameter", "displayName": "Line", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "Maximum number of log lines to return for getLogs" }, + "offset": { "index": 9, "kind": "parameter", "displayName": "Offset", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "Log query offset for getLogs" }, + "query": { "index": 10, "kind": "parameter", "displayName": "Query", "group": "getLogs", "label": "getLogs", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Log query string for getLogs" }, + "reverse": { "index": 11, "kind": "parameter", "displayName": "Reverse", "group": "getLogs", "label": "getLogs", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to return logs in reverse order for getLogs" }, + "to": { "index": 12, "kind": "parameter", "displayName": "To", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Query end time for getLogs (Unix timestamp in seconds)" }, + "topic": { "index": 13, "kind": "parameter", "displayName": "Topic", "group": "getLogs", "label": "getLogs", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Log topic filter for getLogs" }, + "accessKey": { "index": 14, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Access key for the cloud user" }, + "secretKey": { "index": 15, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Secret key for the cloud user" }, + "serviceKeys": { "index": 16, "kind": "parameter", "displayName": "Service Keys", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.component.alibaba.common.models.ServiceKeys", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Configuration object for cloud service authentication" } + } +} diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties index 8cd11c4a37add..b724bb81e5f57 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties @@ -13,6 +13,8 @@ alibaba-fc-component alibaba-kms-component alibaba-mns-component alibaba-oss-component +alibaba-ots-component +alibaba-sls-component alibaba-sms-component amqp-component arangodb-component diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/alibaba-ots-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/alibaba-ots-component.adoc new file mode 100644 index 0000000000000..083d4e2558cca --- /dev/null +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/alibaba-ots-component.adoc @@ -0,0 +1,73 @@ += Alibaba Tablestore (OTS) Component +:doctitle: Alibaba Tablestore (OTS) +:shortname: alibaba-ots +:artifactid: camel-alibaba-ots +:description: Perform row operations on Alibaba Cloud Tablestore (OTS). +:since: 4.23 +:supportlevel: Preview +:tabs-sync-option: +:component-header: Only producer is supported +//Manually maintained attributes +:group: Alibaba Cloud + +*Since Camel {since}* + +*{component-header}* + +The Alibaba Cloud Tablestore (OTS) component allows you to perform row operations against a Tablestore instance using the native Tablestore SDK. + +Maven users will need to add the following dependency to their `pom.xml` +for this component: + +[source,xml] +---- + + org.apache.camel + camel-alibaba-ots + x.x.x + + +---- + +== URI format + +[source] +---- +alibaba-ots:operation[?options] +---- + +// component options: START +include::partial$component-configure-options.adoc[] +include::partial$component-endpoint-options.adoc[] +include::partial$component-endpoint-headers.adoc[] +// component options: END + +== Usage + +=== Operations + +The component supports the following operations: + +* `putRow` - insert a row (producer) +* `getRow` - read a row (producer) +* `updateRow` - update a row (producer) +* `deleteRow` - delete a row (producer) +* `listTables` - list tables in the instance (producer) + +For row operations, the exchange body must be the corresponding Tablestore SDK request type (`PutRowRequest`, `GetRowRequest`, `UpdateRowRequest`, or `DeleteRowRequest`). The `listTables` operation does not require a message body. + +=== Producer example + +[source,java] +---- +from("direct:start") + .process(exchange -> { + PutRowRequest request = new PutRowRequest(new RowPutChange("my-table", primaryKey)); + exchange.getMessage().setBody(request); + }) + .to("alibaba-ots:putRow?endpoint=https://my-instance.cn-hangzhou.ots.aliyuncs.com&instanceName=my-instance&accessKey=RAW(accessKey)&secretKey=RAW(secretKey)"); +---- + +== Examples + +For more examples, see the unit tests in the `camel-alibaba-ots` module. diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/alibaba-sls-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/alibaba-sls-component.adoc new file mode 100644 index 0000000000000..267b8d77c1152 --- /dev/null +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/alibaba-sls-component.adoc @@ -0,0 +1,87 @@ += Alibaba Simple Log Service (SLS) Component +:doctitle: Alibaba Simple Log Service (SLS) +:shortname: alibaba-sls +:artifactid: camel-alibaba-sls +:description: Manage logs on Alibaba Cloud Simple Log Service (SLS). +:since: 4.23 +:supportlevel: Preview +:tabs-sync-option: +:component-header: Only producer is supported +//Manually maintained attributes +:group: Alibaba Cloud + +*Since Camel {since}* + +*{component-header}* + +The Alibaba Cloud Simple Log Service (SLS) component allows you to write logs, query logs and list log stores. + +Maven users will need to add the following dependency to their `pom.xml` +for this component: + +[source,xml] +---- + + org.apache.camel + camel-alibaba-sls + x.x.x + + +---- + +== URI format + +[source] +---- +alibaba-sls:operation[?options] +---- + +// component options: START +include::partial$component-configure-options.adoc[] +include::partial$component-endpoint-options.adoc[] +include::partial$component-endpoint-headers.adoc[] +// component options: END + +== Usage + +=== Operations + +The component supports the following operations: + +* `putLogs` - write a log group to a log store (producer) +* `getLogs` - query logs from a log store (producer) +* `listLogStores` - list log stores in a project (producer) + +=== Producer examples + +Put logs: + +[source,java] +---- +from("direct:start") + .setBody(simple("${body}")) + .to("alibaba-sls:putLogs?project=my-project&logStoreName=my-logstore®ion=cn-hangzhou&endpoint=cn-hangzhou.log.aliyuncs.com&accessKey=RAW(accessKey)&secretKey=RAW(secretKey)"); +---- + +Query logs: + +[source,java] +---- +from("direct:start") + .setHeader("CamelAlibabaSlsQuery", constant("*")) + .setHeader("CamelAlibabaSlsFrom", constant(1700000000)) + .setHeader("CamelAlibabaSlsTo", constant(1700003600)) + .to("alibaba-sls:getLogs?project=my-project&logStoreName=my-logstore®ion=cn-hangzhou&accessKey=RAW(accessKey)&secretKey=RAW(secretKey)"); +---- + +List log stores: + +[source,java] +---- +from("direct:start") + .to("alibaba-sls:listLogStores?project=my-project®ion=cn-hangzhou&accessKey=RAW(accessKey)&secretKey=RAW(secretKey)"); +---- + +== Examples + +For more examples, see the unit tests in the `camel-alibaba-sls` module. diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json index 6287ad28e0aee..1146c05cd1cc7 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json @@ -445,7 +445,7 @@ { "name": "camel.server.mcpServerName", "required": false, "description": "MCP server name advertised to clients. Defaults to the CamelContext name.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.server.mcpSessionIdleTtl", "required": false, "description": "Idle TTL in milliseconds for MCP sessions on the Vert.x streamable transport. Sessions with no activity for longer than this interval are evicted. 0 disables idle eviction.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "integer", "javaType": "long", "defaultValue": 300000, "secret": false }, { "name": "camel.server.mcpSessionKeepAliveInterval", "required": false, "description": "Keep-alive ping interval in milliseconds for MCP sessions on the Vert.x streamable transport. Dead sessions are evicted after consecutive ping failures. 0 disables keep-alive pings.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "integer", "javaType": "long", "defaultValue": 30000, "secret": false }, - { "name": "camel.server.mcpTags", "required": false, "description": "Comma-separated list of ai-tool tag patterns to expose as MCP tools. Matching is case-insensitive and supports exact match, wildcard prefix ( {code foo} ), and {code } to match all tags. Only tools registered under a matching tag are exposed; the untagged default pool is never exposed. When not set, no tools are exposed.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, + { "name": "camel.server.mcpTags", "required": false, "description": "Comma-separated list of ai-tool tags to expose as MCP tools. Only tools registered under one of these tags are exposed; the untagged default pool is never exposed. When not set, no tools are exposed.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.server.mcpToolTimeout", "required": false, "description": "Per-call MCP tool execution timeout in milliseconds. A call exceeding the timeout returns an error result to the MCP client; the underlying route keeps running until it completes on its own.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "integer", "javaType": "long", "defaultValue": 20000, "secret": false }, { "name": "camel.server.path", "required": false, "description": "Context-path to use for embedded HTTP server", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/", "secret": false }, { "name": "camel.server.port", "required": false, "description": "Port to use for binding embedded HTTP server. Use 0 to dynamic assign a free random port number.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 8080, "secret": false }, diff --git a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties index 6b481121cb525..eb2f0cb47a420 100644 --- a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties +++ b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties @@ -7,6 +7,8 @@ alibaba-fc alibaba-kms alibaba-mns alibaba-oss +alibaba-ots +alibaba-sls alibaba-sms amqp arangodb diff --git a/coverage/pom.xml b/coverage/pom.xml index 4ffc6430221a8..835e46af00c94 100644 --- a/coverage/pom.xml +++ b/coverage/pom.xml @@ -251,6 +251,11 @@ camel-alibaba-oss ${project.version} + + org.apache.camel + camel-alibaba-sls + ${project.version} + org.apache.camel camel-alibaba-ots diff --git a/docs/components/modules/ROOT/examples/json/alibaba-ots.json b/docs/components/modules/ROOT/examples/json/alibaba-ots.json new file mode 100644 index 0000000000000..442b35c56bb3f --- /dev/null +++ b/docs/components/modules/ROOT/examples/json/alibaba-ots.json @@ -0,0 +1,46 @@ +{ + "component": { + "kind": "component", + "name": "alibaba-ots", + "title": "Alibaba Tablestore (OTS)", + "description": "Perform row operations on Alibaba Cloud Tablestore (OTS).", + "deprecated": false, + "firstVersion": "4.23.0", + "label": "cloud,database", + "javaType": "org.apache.camel.component.alibaba.ots.OTSComponent", + "supportLevel": "Preview", + "groupId": "org.apache.camel", + "artifactId": "camel-alibaba-ots", + "version": "4.23.0-SNAPSHOT", + "scheme": "alibaba-ots", + "extendsScheme": "", + "syntax": "alibaba-ots:operation", + "async": false, + "api": false, + "consumerOnly": false, + "producerOnly": true, + "lenientProperties": false, + "browsable": false, + "remote": true + }, + "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 during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "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 type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, + "healthCheckConsumerEnabled": { "index": 2, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, + "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } + }, + "headers": { + "CamelAlibabaOtsOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation override", "constantName": "org.apache.camel.component.alibaba.ots.constants.OTSHeaders#OPERATION" }, + "CamelAlibabaOtsRequestId": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore request id", "constantName": "org.apache.camel.component.alibaba.ots.constants.OTSHeaders#REQUEST_ID" } + }, + "properties": { + "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putRow", "getRow", "updateRow", "deleteRow", "listTables" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, + "endpoint": { "index": 1, "kind": "parameter", "displayName": "Endpoint", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore endpoint URL" }, + "instanceName": { "index": 2, "kind": "parameter", "displayName": "Instance Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore instance name" }, + "lazyStartProducer": { "index": 3, "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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "otsClient": { "index": 4, "kind": "parameter", "displayName": "OTS Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.alicloud.openservices.tablestore.SyncClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "description": "Autowire an existing Tablestore client instance" }, + "accessKey": { "index": 5, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Access key for the cloud user" }, + "secretKey": { "index": 6, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Secret key for the cloud user" }, + "serviceKeys": { "index": 7, "kind": "parameter", "displayName": "Service Keys", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.component.alibaba.common.models.ServiceKeys", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Configuration object for cloud service authentication" } + } +} diff --git a/docs/components/modules/ROOT/examples/json/alibaba-sls.json b/docs/components/modules/ROOT/examples/json/alibaba-sls.json new file mode 100644 index 0000000000000..940a63a6242a7 --- /dev/null +++ b/docs/components/modules/ROOT/examples/json/alibaba-sls.json @@ -0,0 +1,68 @@ +{ + "component": { + "kind": "component", + "name": "alibaba-sls", + "title": "Alibaba Simple Log Service (SLS)", + "description": "Manage logs on Alibaba Cloud Simple Log Service (SLS).", + "deprecated": false, + "firstVersion": "4.23.0", + "label": "cloud,monitoring", + "javaType": "org.apache.camel.component.alibaba.sls.SLSComponent", + "supportLevel": "Preview", + "groupId": "org.apache.camel", + "artifactId": "camel-alibaba-sls", + "version": "4.23.0-SNAPSHOT", + "scheme": "alibaba-sls", + "extendsScheme": "", + "syntax": "alibaba-sls:operation", + "async": false, + "api": false, + "consumerOnly": false, + "producerOnly": true, + "lenientProperties": false, + "browsable": false, + "remote": true + }, + "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 during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "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 type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, + "healthCheckConsumerEnabled": { "index": 2, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, + "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } + }, + "headers": { + "CamelAlibabaSlsProject": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS project name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#PROJECT" }, + "CamelAlibabaSlsLogStoreName": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS log store name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LOG_STORE_NAME" }, + "CamelAlibabaSlsQuery": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query string override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#QUERY" }, + "CamelAlibabaSlsFrom": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query start time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#FROM" }, + "CamelAlibabaSlsTo": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query end time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TO" }, + "CamelAlibabaSlsLine": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Maximum number of log lines to return", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LINE" }, + "CamelAlibabaSlsOffset": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query offset", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#OFFSET" }, + "CamelAlibabaSlsTopic": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log topic filter override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TOPIC" }, + "CamelAlibabaSlsReverse": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether to return logs in reverse order", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#REVERSE" }, + "CamelAlibabaSlsLogstoreName": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log store name prefix filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LOGSTORE_NAME" }, + "CamelAlibabaSlsMode": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List mode for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#MODE" }, + "CamelAlibabaSlsSize": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Page size for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#SIZE" }, + "CamelAlibabaSlsTelemetryType": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Telemetry type filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TELEMETRY_TYPE" }, + "CamelAlibabaSlsRequestId": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud request id", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#REQUEST_ID" }, + "CamelAlibabaSlsStatusCode": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "HTTP status code from SLS response", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#STATUS_CODE" } + }, + "properties": { + "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putLogs", "getLogs", "listLogStores" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, + "endpoint": { "index": 1, "kind": "parameter", "displayName": "Endpoint", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS endpoint URL (e.g. cn-hangzhou.log.aliyuncs.com). Carries higher precedence than region based client initialization" }, + "logStoreName": { "index": 2, "kind": "parameter", "displayName": "Log Store Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS log store name" }, + "project": { "index": 3, "kind": "parameter", "displayName": "Project", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS project name" }, + "region": { "index": 4, "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud region" }, + "lazyStartProducer": { "index": 5, "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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "slsClient": { "index": 6, "kind": "parameter", "displayName": "SLS Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.aliyun.sls20201230.Client", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "description": "Autowire an existing SLS client instance" }, + "from": { "index": 7, "kind": "parameter", "displayName": "From", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Query start time for getLogs (Unix timestamp in seconds)" }, + "line": { "index": 8, "kind": "parameter", "displayName": "Line", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "Maximum number of log lines to return for getLogs" }, + "offset": { "index": 9, "kind": "parameter", "displayName": "Offset", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "Log query offset for getLogs" }, + "query": { "index": 10, "kind": "parameter", "displayName": "Query", "group": "getLogs", "label": "getLogs", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Log query string for getLogs" }, + "reverse": { "index": 11, "kind": "parameter", "displayName": "Reverse", "group": "getLogs", "label": "getLogs", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to return logs in reverse order for getLogs" }, + "to": { "index": 12, "kind": "parameter", "displayName": "To", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Query end time for getLogs (Unix timestamp in seconds)" }, + "topic": { "index": 13, "kind": "parameter", "displayName": "Topic", "group": "getLogs", "label": "getLogs", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Log topic filter for getLogs" }, + "accessKey": { "index": 14, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Access key for the cloud user" }, + "secretKey": { "index": 15, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Secret key for the cloud user" }, + "serviceKeys": { "index": 16, "kind": "parameter", "displayName": "Service Keys", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.component.alibaba.common.models.ServiceKeys", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Configuration object for cloud service authentication" } + } +} diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc index 0d37ea8a53d96..fefbf92be65c0 100644 --- a/docs/components/modules/ROOT/nav.adoc +++ b/docs/components/modules/ROOT/nav.adoc @@ -36,6 +36,8 @@ *** xref:alibaba-kms-component.adoc[Alibaba Key Management Service (KMS)] *** xref:alibaba-mns-component.adoc[Alibaba Message Service (MNS)] *** xref:alibaba-oss-component.adoc[Alibaba Object Storage Service (OSS)] +*** xref:alibaba-sls-component.adoc[Alibaba Simple Log Service (SLS)] +*** xref:alibaba-ots-component.adoc[Alibaba Table Store (OTS)] *** xref:alibaba-sms-component.adoc[Alibaba Short Message Service (SMS)] ** xref:amqp-component.adoc[AMQP] ** xref:arangodb-component.adoc[ArangoDb] diff --git a/docs/components/modules/ROOT/pages/alibaba-ots-component.adoc b/docs/components/modules/ROOT/pages/alibaba-ots-component.adoc new file mode 120000 index 0000000000000..34d6bef2933b2 --- /dev/null +++ b/docs/components/modules/ROOT/pages/alibaba-ots-component.adoc @@ -0,0 +1 @@ +../../../../../components/camel-alibaba/camel-alibaba-ots/src/main/docs/alibaba-ots-component.adoc \ No newline at end of file diff --git a/docs/components/modules/ROOT/pages/alibaba-sls-component.adoc b/docs/components/modules/ROOT/pages/alibaba-sls-component.adoc new file mode 120000 index 0000000000000..cb32a4e227a73 --- /dev/null +++ b/docs/components/modules/ROOT/pages/alibaba-sls-component.adoc @@ -0,0 +1 @@ +../../../../../components/camel-alibaba/camel-alibaba-sls/src/main/docs/alibaba-sls-component.adoc \ No newline at end of file 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 8b70341543930..e461b69cdf0ac 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 @@ -166,6 +166,32 @@ static AlibabaMnsComponentBuilderFactory.AlibabaMnsComponentBuilder alibabaMns() static AlibabaOssComponentBuilderFactory.AlibabaOssComponentBuilder alibabaOss() { return AlibabaOssComponentBuilderFactory.alibabaOss(); } + /** + * Alibaba Tablestore (OTS) (camel-alibaba-ots) + * Perform row operations on Alibaba Cloud Tablestore (OTS). + * + * Category: cloud,database + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-ots + * + * @return the dsl builder + */ + static AlibabaOtsComponentBuilderFactory.AlibabaOtsComponentBuilder alibabaOts() { + return AlibabaOtsComponentBuilderFactory.alibabaOts(); + } + /** + * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) + * Manage logs on Alibaba Cloud Simple Log Service (SLS). + * + * Category: cloud,monitoring + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-sls + * + * @return the dsl builder + */ + static AlibabaSlsComponentBuilderFactory.AlibabaSlsComponentBuilder alibabaSls() { + return AlibabaSlsComponentBuilderFactory.alibabaSls(); + } /** * Alibaba Short Message Service (SMS) (camel-alibaba-sms) * Send SMS messages using Alibaba Cloud Short Message Service (SMS). diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaOtsComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaOtsComponentBuilderFactory.java new file mode 100644 index 0000000000000..4f7934ebcf680 --- /dev/null +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaOtsComponentBuilderFactory.java @@ -0,0 +1,160 @@ +/* Generated by camel build tools - do NOT edit this file! */ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.builder.component.dsl; + +import javax.annotation.processing.Generated; +import org.apache.camel.Component; +import org.apache.camel.builder.component.AbstractComponentBuilder; +import org.apache.camel.builder.component.ComponentBuilder; +import org.apache.camel.component.alibaba.ots.OTSComponent; + +/** + * Perform row operations on Alibaba Cloud Tablestore (OTS). + * + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.ComponentDslMojo") +public interface AlibabaOtsComponentBuilderFactory { + + /** + * Alibaba Tablestore (OTS) (camel-alibaba-ots) + * Perform row operations on Alibaba Cloud Tablestore (OTS). + * + * Category: cloud,database + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-ots + * + * @return the dsl builder + */ + static AlibabaOtsComponentBuilder alibabaOts() { + return new AlibabaOtsComponentBuilderImpl(); + } + + /** + * Builder for the Alibaba Tablestore (OTS) component. + */ + interface AlibabaOtsComponentBuilder extends ComponentBuilder { + + + /** + * 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 during + * starting and cause the route to fail being started. By deferring this + * startup to be lazy then the startup failure can be handled during + * routing messages via Camel's routing error handlers. Beware that when + * the first message is processed then creating and starting the + * producer may take a little time and prolong the total processing time + * of the processing. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param lazyStartProducer the value to set + * @return the dsl builder + */ + default AlibabaOtsComponentBuilder lazyStartProducer(boolean lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); + return this; + } + + + /** + * 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 type, + * which then gets configured on the component. This can be used for + * automatic configuring JDBC data sources, JMS connection factories, + * AWS Clients, etc. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: advanced + * + * @param autowiredEnabled the value to set + * @return the dsl builder + */ + default AlibabaOtsComponentBuilder autowiredEnabled(boolean autowiredEnabled) { + doSetProperty("autowiredEnabled", autowiredEnabled); + return this; + } + + + /** + * Used for enabling or disabling all consumer based health checks from + * this component. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: health + * + * @param healthCheckConsumerEnabled the value to set + * @return the dsl builder + */ + default AlibabaOtsComponentBuilder healthCheckConsumerEnabled(boolean healthCheckConsumerEnabled) { + doSetProperty("healthCheckConsumerEnabled", healthCheckConsumerEnabled); + return this; + } + + + /** + * Used for enabling or disabling all producer based health checks from + * this component. Notice: Camel has by default disabled all producer + * based health-checks. You can turn on producer checks globally by + * setting camel.health.producersEnabled=true. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: health + * + * @param healthCheckProducerEnabled the value to set + * @return the dsl builder + */ + default AlibabaOtsComponentBuilder healthCheckProducerEnabled(boolean healthCheckProducerEnabled) { + doSetProperty("healthCheckProducerEnabled", healthCheckProducerEnabled); + return this; + } + } + + class AlibabaOtsComponentBuilderImpl + extends AbstractComponentBuilder + implements AlibabaOtsComponentBuilder { + @Override + protected OTSComponent buildConcreteComponent() { + return new OTSComponent(); + } + @Override + protected boolean setPropertyOnComponent( + Component component, + String name, + Object value) { + switch (name) { + case "lazyStartProducer": ((OTSComponent) component).setLazyStartProducer((boolean) value); return true; + case "autowiredEnabled": ((OTSComponent) component).setAutowiredEnabled((boolean) value); return true; + case "healthCheckConsumerEnabled": ((OTSComponent) component).setHealthCheckConsumerEnabled((boolean) value); return true; + case "healthCheckProducerEnabled": ((OTSComponent) component).setHealthCheckProducerEnabled((boolean) value); return true; + default: return false; + } + } + } +} \ No newline at end of file diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaSlsComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaSlsComponentBuilderFactory.java new file mode 100644 index 0000000000000..270504cab1860 --- /dev/null +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaSlsComponentBuilderFactory.java @@ -0,0 +1,160 @@ +/* Generated by camel build tools - do NOT edit this file! */ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.builder.component.dsl; + +import javax.annotation.processing.Generated; +import org.apache.camel.Component; +import org.apache.camel.builder.component.AbstractComponentBuilder; +import org.apache.camel.builder.component.ComponentBuilder; +import org.apache.camel.component.alibaba.sls.SLSComponent; + +/** + * Manage logs on Alibaba Cloud Simple Log Service (SLS). + * + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.ComponentDslMojo") +public interface AlibabaSlsComponentBuilderFactory { + + /** + * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) + * Manage logs on Alibaba Cloud Simple Log Service (SLS). + * + * Category: cloud,monitoring + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-sls + * + * @return the dsl builder + */ + static AlibabaSlsComponentBuilder alibabaSls() { + return new AlibabaSlsComponentBuilderImpl(); + } + + /** + * Builder for the Alibaba Simple Log Service (SLS) component. + */ + interface AlibabaSlsComponentBuilder extends ComponentBuilder { + + + /** + * 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 during + * starting and cause the route to fail being started. By deferring this + * startup to be lazy then the startup failure can be handled during + * routing messages via Camel's routing error handlers. Beware that when + * the first message is processed then creating and starting the + * producer may take a little time and prolong the total processing time + * of the processing. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param lazyStartProducer the value to set + * @return the dsl builder + */ + default AlibabaSlsComponentBuilder lazyStartProducer(boolean lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); + return this; + } + + + /** + * 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 type, + * which then gets configured on the component. This can be used for + * automatic configuring JDBC data sources, JMS connection factories, + * AWS Clients, etc. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: advanced + * + * @param autowiredEnabled the value to set + * @return the dsl builder + */ + default AlibabaSlsComponentBuilder autowiredEnabled(boolean autowiredEnabled) { + doSetProperty("autowiredEnabled", autowiredEnabled); + return this; + } + + + /** + * Used for enabling or disabling all consumer based health checks from + * this component. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: health + * + * @param healthCheckConsumerEnabled the value to set + * @return the dsl builder + */ + default AlibabaSlsComponentBuilder healthCheckConsumerEnabled(boolean healthCheckConsumerEnabled) { + doSetProperty("healthCheckConsumerEnabled", healthCheckConsumerEnabled); + return this; + } + + + /** + * Used for enabling or disabling all producer based health checks from + * this component. Notice: Camel has by default disabled all producer + * based health-checks. You can turn on producer checks globally by + * setting camel.health.producersEnabled=true. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: health + * + * @param healthCheckProducerEnabled the value to set + * @return the dsl builder + */ + default AlibabaSlsComponentBuilder healthCheckProducerEnabled(boolean healthCheckProducerEnabled) { + doSetProperty("healthCheckProducerEnabled", healthCheckProducerEnabled); + return this; + } + } + + class AlibabaSlsComponentBuilderImpl + extends AbstractComponentBuilder + implements AlibabaSlsComponentBuilder { + @Override + protected SLSComponent buildConcreteComponent() { + return new SLSComponent(); + } + @Override + protected boolean setPropertyOnComponent( + Component component, + String name, + Object value) { + switch (name) { + case "lazyStartProducer": ((SLSComponent) component).setLazyStartProducer((boolean) value); return true; + case "autowiredEnabled": ((SLSComponent) component).setAutowiredEnabled((boolean) value); return true; + case "healthCheckConsumerEnabled": ((SLSComponent) component).setHealthCheckConsumerEnabled((boolean) value); return true; + case "healthCheckProducerEnabled": ((SLSComponent) component).setHealthCheckProducerEnabled((boolean) value); return true; + default: return false; + } + } + } +} \ No newline at end of file diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java index edc7c01f4c844..cde0f1545c82d 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java @@ -287,6 +287,7 @@ public interface EndpointBuilderFactory org.apache.camel.builder.endpoint.dsl.OAIPMHEndpointBuilderFactory.OAIPMHBuilders, org.apache.camel.builder.endpoint.dsl.OBSEndpointBuilderFactory.OBSBuilders, org.apache.camel.builder.endpoint.dsl.OSSEndpointBuilderFactory.OSSBuilders, + org.apache.camel.builder.endpoint.dsl.OTSEndpointBuilderFactory.OTSBuilders, org.apache.camel.builder.endpoint.dsl.Olingo2EndpointBuilderFactory.Olingo2Builders, org.apache.camel.builder.endpoint.dsl.Olingo4EndpointBuilderFactory.Olingo4Builders, org.apache.camel.builder.endpoint.dsl.OnceEndpointBuilderFactory.OnceBuilders, @@ -327,6 +328,7 @@ public interface EndpointBuilderFactory org.apache.camel.builder.endpoint.dsl.RobotFrameworkEndpointBuilderFactory.RobotFrameworkBuilders, org.apache.camel.builder.endpoint.dsl.RocketMQEndpointBuilderFactory.RocketMQBuilders, org.apache.camel.builder.endpoint.dsl.RssEndpointBuilderFactory.RssBuilders, + org.apache.camel.builder.endpoint.dsl.SLSEndpointBuilderFactory.SLSBuilders, org.apache.camel.builder.endpoint.dsl.SMSEndpointBuilderFactory.SMSBuilders, org.apache.camel.builder.endpoint.dsl.STS2EndpointBuilderFactory.STS2Builders, org.apache.camel.builder.endpoint.dsl.SagaEndpointBuilderFactory.SagaBuilders, diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java index b3a69be4660ea..b9769334d6807 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java @@ -284,6 +284,7 @@ public interface EndpointBuilders org.apache.camel.builder.endpoint.dsl.OAIPMHEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.OBSEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.OSSEndpointBuilderFactory, + org.apache.camel.builder.endpoint.dsl.OTSEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.Olingo2EndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.Olingo4EndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.OnceEndpointBuilderFactory, @@ -324,6 +325,7 @@ public interface EndpointBuilders org.apache.camel.builder.endpoint.dsl.RobotFrameworkEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.RocketMQEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.RssEndpointBuilderFactory, + org.apache.camel.builder.endpoint.dsl.SLSEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.SMSEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.STS2EndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.SagaEndpointBuilderFactory, 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 ce9deaf4731e4..3f880c3c89213 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 @@ -145,6 +145,32 @@ public static MNSEndpointBuilderFactory.MNSHeaderNameBuilder alibabaMns() { public static OSSEndpointBuilderFactory.OSSHeaderNameBuilder alibabaOss() { return OSSEndpointBuilderFactory.OSSHeaderNameBuilder.INSTANCE; } + /** + * Alibaba Tablestore (OTS) (camel-alibaba-ots) + * Perform row operations on Alibaba Cloud Tablestore (OTS). + * + * Category: cloud,database + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-ots + * + * @return the dsl builder for the headers' name. + */ + public static OTSEndpointBuilderFactory.OTSHeaderNameBuilder alibabaOts() { + return OTSEndpointBuilderFactory.OTSHeaderNameBuilder.INSTANCE; + } + /** + * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) + * Manage logs on Alibaba Cloud Simple Log Service (SLS). + * + * Category: cloud,monitoring + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-sls + * + * @return the dsl builder for the headers' name. + */ + public static SLSEndpointBuilderFactory.SLSHeaderNameBuilder alibabaSls() { + return SLSEndpointBuilderFactory.SLSHeaderNameBuilder.INSTANCE; + } /** * Alibaba Short Message Service (SMS) (camel-alibaba-sms) * Send SMS messages using Alibaba Cloud Short Message Service (SMS). 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 1de2236fc4628..e8b43e8a00e98 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 @@ -430,6 +430,94 @@ public static OSSEndpointBuilderFactory.OSSEndpointBuilder alibabaOss(String pat public static OSSEndpointBuilderFactory.OSSEndpointBuilder alibabaOss(String componentName, String path) { return OSSEndpointBuilderFactory.endpointBuilder(componentName, path); } + /** + * Alibaba Tablestore (OTS) (camel-alibaba-ots) + * Perform row operations on Alibaba Cloud Tablestore (OTS). + * + * Category: cloud,database + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-ots + * + * Syntax: alibaba-ots:operation + * + * Path parameter: operation (required) + * Operation to perform + * There are 5 enums and the value can be one of: putRow, getRow, updateRow, + * deleteRow, listTables + * + * @param path operation + * @return the dsl builder + */ + public static OTSEndpointBuilderFactory.OTSEndpointBuilder alibabaOts(String path) { + return alibabaOts("alibaba-ots", path); + } + /** + * Alibaba Tablestore (OTS) (camel-alibaba-ots) + * Perform row operations on Alibaba Cloud Tablestore (OTS). + * + * Category: cloud,database + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-ots + * + * Syntax: alibaba-ots:operation + * + * Path parameter: operation (required) + * Operation to perform + * There are 5 enums and the value can be one of: putRow, getRow, updateRow, + * deleteRow, listTables + * + * @param componentName to use a custom component name for the endpoint + * instead of the default name + * @param path operation + * @return the dsl builder + */ + public static OTSEndpointBuilderFactory.OTSEndpointBuilder alibabaOts(String componentName, String path) { + return OTSEndpointBuilderFactory.endpointBuilder(componentName, path); + } + /** + * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) + * Manage logs on Alibaba Cloud Simple Log Service (SLS). + * + * Category: cloud,monitoring + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-sls + * + * Syntax: alibaba-sls:operation + * + * Path parameter: operation (required) + * Operation to perform + * There are 3 enums and the value can be one of: putLogs, getLogs, + * listLogStores + * + * @param path operation + * @return the dsl builder + */ + public static SLSEndpointBuilderFactory.SLSEndpointBuilder alibabaSls(String path) { + return alibabaSls("alibaba-sls", path); + } + /** + * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) + * Manage logs on Alibaba Cloud Simple Log Service (SLS). + * + * Category: cloud,monitoring + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-sls + * + * Syntax: alibaba-sls:operation + * + * Path parameter: operation (required) + * Operation to perform + * There are 3 enums and the value can be one of: putLogs, getLogs, + * listLogStores + * + * @param componentName to use a custom component name for the endpoint + * instead of the default name + * @param path operation + * @return the dsl builder + */ + public static SLSEndpointBuilderFactory.SLSEndpointBuilder alibabaSls(String componentName, String path) { + return SLSEndpointBuilderFactory.endpointBuilder(componentName, path); + } /** * Alibaba Short Message Service (SMS) (camel-alibaba-sms) * Send SMS messages using Alibaba Cloud Short Message Service (SMS). diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OTSEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OTSEndpointBuilderFactory.java new file mode 100644 index 0000000000000..5b39b0c7c50c6 --- /dev/null +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OTSEndpointBuilderFactory.java @@ -0,0 +1,328 @@ +/* Generated by camel build tools - do NOT edit this file! */ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.builder.endpoint.dsl; + +import java.util.*; +import java.util.concurrent.*; +import java.util.function.*; +import java.util.stream.*; +import javax.annotation.processing.Generated; +import org.apache.camel.builder.EndpointConsumerBuilder; +import org.apache.camel.builder.EndpointProducerBuilder; +import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; + +/** + * Perform row operations on Alibaba Cloud Tablestore (OTS). + * + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.EndpointDslMojo") +public interface OTSEndpointBuilderFactory { + + /** + * Builder for endpoint for the Alibaba Tablestore (OTS) component. + */ + public interface OTSEndpointBuilder + extends + EndpointProducerBuilder { + default AdvancedOTSEndpointBuilder advanced() { + return (AdvancedOTSEndpointBuilder) this; + } + + /** + * Tablestore endpoint URL. + * + * The option is a: java.lang.String type. + * + * Required: true + * Group: producer + * + * @param endpoint the value to set + * @return the dsl builder + */ + default OTSEndpointBuilder endpoint(String endpoint) { + doSetProperty("endpoint", endpoint); + return this; + } + /** + * Tablestore instance name. + * + * The option is a: java.lang.String type. + * + * Required: true + * Group: producer + * + * @param instanceName the value to set + * @return the dsl builder + */ + default OTSEndpointBuilder instanceName(String instanceName) { + doSetProperty("instanceName", instanceName); + return this; + } + /** + * Access key for the cloud user. + * + * The option is a: java.lang.String type. + * + * Group: security + * + * @param accessKey the value to set + * @return the dsl builder + */ + default OTSEndpointBuilder accessKey(String accessKey) { + doSetProperty("accessKey", accessKey); + return this; + } + /** + * Secret key for the cloud user. + * + * The option is a: java.lang.String type. + * + * Group: security + * + * @param secretKey the value to set + * @return the dsl builder + */ + default OTSEndpointBuilder secretKey(String secretKey) { + doSetProperty("secretKey", secretKey); + return this; + } + /** + * Configuration object for cloud service authentication. + * + * The option is a: + * org.apache.camel.component.alibaba.common.models.ServiceKeys type. + * + * Group: security + * + * @param serviceKeys the value to set + * @return the dsl builder + */ + default OTSEndpointBuilder serviceKeys(org.apache.camel.component.alibaba.common.models.ServiceKeys serviceKeys) { + doSetProperty("serviceKeys", serviceKeys); + return this; + } + /** + * Configuration object for cloud service authentication. + * + * The option will be converted to a + * org.apache.camel.component.alibaba.common.models.ServiceKeys type. + * + * Group: security + * + * @param serviceKeys the value to set + * @return the dsl builder + */ + default OTSEndpointBuilder serviceKeys(String serviceKeys) { + doSetProperty("serviceKeys", serviceKeys); + return this; + } + } + + /** + * Advanced builder for endpoint for the Alibaba Tablestore (OTS) component. + */ + public interface AdvancedOTSEndpointBuilder + extends + EndpointProducerBuilder { + default OTSEndpointBuilder basic() { + return (OTSEndpointBuilder) this; + } + + /** + * 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 during + * starting and cause the route to fail being started. By deferring this + * startup to be lazy then the startup failure can be handled during + * routing messages via Camel's routing error handlers. Beware that when + * the first message is processed then creating and starting the + * producer may take a little time and prolong the total processing time + * of the processing. + * + * The option is a: boolean type. + * + * Default: false + * Group: producer (advanced) + * + * @param lazyStartProducer the value to set + * @return the dsl builder + */ + default AdvancedOTSEndpointBuilder lazyStartProducer(boolean lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); + return this; + } + /** + * 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 during + * starting and cause the route to fail being started. By deferring this + * startup to be lazy then the startup failure can be handled during + * routing messages via Camel's routing error handlers. Beware that when + * the first message is processed then creating and starting the + * producer may take a little time and prolong the total processing time + * of the processing. + * + * The option will be converted to a boolean type. + * + * Default: false + * Group: producer (advanced) + * + * @param lazyStartProducer the value to set + * @return the dsl builder + */ + default AdvancedOTSEndpointBuilder lazyStartProducer(String lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); + return this; + } + /** + * Autowire an existing Tablestore client instance. + * + * The option is a: + * com.alicloud.openservices.tablestore.SyncClient type. + * + * Group: advanced + * + * @param otsClient the value to set + * @return the dsl builder + */ + default AdvancedOTSEndpointBuilder otsClient(com.alicloud.openservices.tablestore.SyncClient otsClient) { + doSetProperty("otsClient", otsClient); + return this; + } + /** + * Autowire an existing Tablestore client instance. + * + * The option will be converted to a + * com.alicloud.openservices.tablestore.SyncClient type. + * + * Group: advanced + * + * @param otsClient the value to set + * @return the dsl builder + */ + default AdvancedOTSEndpointBuilder otsClient(String otsClient) { + doSetProperty("otsClient", otsClient); + return this; + } + } + + public interface OTSBuilders { + /** + * Alibaba Tablestore (OTS) (camel-alibaba-ots) + * Perform row operations on Alibaba Cloud Tablestore (OTS). + * + * Category: cloud,database + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-ots + * + * @return the dsl builder for the headers' name. + */ + default OTSHeaderNameBuilder alibabaOts() { + return OTSHeaderNameBuilder.INSTANCE; + } + /** + * Alibaba Tablestore (OTS) (camel-alibaba-ots) + * Perform row operations on Alibaba Cloud Tablestore (OTS). + * + * Category: cloud,database + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-ots + * + * Syntax: alibaba-ots:operation + * + * Path parameter: operation (required) + * Operation to perform + * There are 5 enums and the value can be one of: putRow, getRow, + * updateRow, deleteRow, listTables + * + * @param path operation + * @return the dsl builder + */ + default OTSEndpointBuilder alibabaOts(String path) { + return OTSEndpointBuilderFactory.endpointBuilder("alibaba-ots", path); + } + /** + * Alibaba Tablestore (OTS) (camel-alibaba-ots) + * Perform row operations on Alibaba Cloud Tablestore (OTS). + * + * Category: cloud,database + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-ots + * + * Syntax: alibaba-ots:operation + * + * Path parameter: operation (required) + * Operation to perform + * There are 5 enums and the value can be one of: putRow, getRow, + * updateRow, deleteRow, listTables + * + * @param componentName to use a custom component name for the endpoint + * instead of the default name + * @param path operation + * @return the dsl builder + */ + default OTSEndpointBuilder alibabaOts(String componentName, String path) { + return OTSEndpointBuilderFactory.endpointBuilder(componentName, path); + } + + } + /** + * The builder of headers' name for the Alibaba Tablestore (OTS) component. + */ + public static class OTSHeaderNameBuilder { + /** + * The internal instance of the builder used to access to all the + * methods representing the name of headers. + */ + public static final OTSHeaderNameBuilder INSTANCE = new OTSHeaderNameBuilder(); + + /** + * Operation override. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaOtsOperation}. + */ + public String alibabaOtsOperation() { + return "CamelAlibabaOtsOperation"; + } + /** + * Tablestore request id. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaOtsRequestId}. + */ + public String alibabaOtsRequestId() { + return "CamelAlibabaOtsRequestId"; + } + } + static OTSEndpointBuilder endpointBuilder(String componentName, String path) { + class OTSEndpointBuilderImpl extends AbstractEndpointBuilder implements OTSEndpointBuilder, AdvancedOTSEndpointBuilder { + public OTSEndpointBuilderImpl(String path) { + super(componentName, path); + } + } + return new OTSEndpointBuilderImpl(path); + } +} \ No newline at end of file diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SLSEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SLSEndpointBuilderFactory.java new file mode 100644 index 0000000000000..b616d9bc79340 --- /dev/null +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SLSEndpointBuilderFactory.java @@ -0,0 +1,684 @@ +/* Generated by camel build tools - do NOT edit this file! */ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.builder.endpoint.dsl; + +import java.util.*; +import java.util.concurrent.*; +import java.util.function.*; +import java.util.stream.*; +import javax.annotation.processing.Generated; +import org.apache.camel.builder.EndpointConsumerBuilder; +import org.apache.camel.builder.EndpointProducerBuilder; +import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; + +/** + * Manage logs on Alibaba Cloud Simple Log Service (SLS). + * + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.EndpointDslMojo") +public interface SLSEndpointBuilderFactory { + + /** + * Builder for endpoint for the Alibaba Simple Log Service (SLS) component. + */ + public interface SLSEndpointBuilder + extends + EndpointProducerBuilder { + default AdvancedSLSEndpointBuilder advanced() { + return (AdvancedSLSEndpointBuilder) this; + } + + /** + * SLS endpoint URL (e.g. cn-hangzhou.log.aliyuncs.com). Carries higher + * precedence than region based client initialization. + * + * The option is a: java.lang.String type. + * + * Group: producer + * + * @param endpoint the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder endpoint(String endpoint) { + doSetProperty("endpoint", endpoint); + return this; + } + /** + * SLS log store name. + * + * The option is a: java.lang.String type. + * + * Group: producer + * + * @param logStoreName the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder logStoreName(String logStoreName) { + doSetProperty("logStoreName", logStoreName); + return this; + } + /** + * SLS project name. + * + * The option is a: java.lang.String type. + * + * Group: producer + * + * @param project the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder project(String project) { + doSetProperty("project", project); + return this; + } + /** + * Alibaba Cloud region. + * + * The option is a: java.lang.String type. + * + * Required: true + * Group: producer + * + * @param region the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder region(String region) { + doSetProperty("region", region); + return this; + } + /** + * Query start time for getLogs (Unix timestamp in seconds). + * + * The option is a: java.lang.Integer type. + * + * Group: getLogs + * + * @param from the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder from(Integer from) { + doSetProperty("from", from); + return this; + } + /** + * Query start time for getLogs (Unix timestamp in seconds). + * + * The option will be converted to a java.lang.Integer + * type. + * + * Group: getLogs + * + * @param from the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder from(String from) { + doSetProperty("from", from); + return this; + } + /** + * Maximum number of log lines to return for getLogs. + * + * The option is a: java.lang.Long type. + * + * Group: getLogs + * + * @param line the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder line(Long line) { + doSetProperty("line", line); + return this; + } + /** + * Maximum number of log lines to return for getLogs. + * + * The option will be converted to a java.lang.Long type. + * + * Group: getLogs + * + * @param line the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder line(String line) { + doSetProperty("line", line); + return this; + } + /** + * Log query offset for getLogs. + * + * The option is a: java.lang.Long type. + * + * Group: getLogs + * + * @param offset the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder offset(Long offset) { + doSetProperty("offset", offset); + return this; + } + /** + * Log query offset for getLogs. + * + * The option will be converted to a java.lang.Long type. + * + * Group: getLogs + * + * @param offset the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder offset(String offset) { + doSetProperty("offset", offset); + return this; + } + /** + * Log query string for getLogs. + * + * The option is a: java.lang.String type. + * + * Group: getLogs + * + * @param query the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder query(String query) { + doSetProperty("query", query); + return this; + } + /** + * Whether to return logs in reverse order for getLogs. + * + * The option is a: java.lang.Boolean type. + * + * Default: false + * Group: getLogs + * + * @param reverse the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder reverse(Boolean reverse) { + doSetProperty("reverse", reverse); + return this; + } + /** + * Whether to return logs in reverse order for getLogs. + * + * The option will be converted to a java.lang.Boolean + * type. + * + * Default: false + * Group: getLogs + * + * @param reverse the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder reverse(String reverse) { + doSetProperty("reverse", reverse); + return this; + } + /** + * Query end time for getLogs (Unix timestamp in seconds). + * + * The option is a: java.lang.Integer type. + * + * Group: getLogs + * + * @param to the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder to(Integer to) { + doSetProperty("to", to); + return this; + } + /** + * Query end time for getLogs (Unix timestamp in seconds). + * + * The option will be converted to a java.lang.Integer + * type. + * + * Group: getLogs + * + * @param to the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder to(String to) { + doSetProperty("to", to); + return this; + } + /** + * Log topic filter for getLogs. + * + * The option is a: java.lang.String type. + * + * Group: getLogs + * + * @param topic the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder topic(String topic) { + doSetProperty("topic", topic); + return this; + } + /** + * Access key for the cloud user. + * + * The option is a: java.lang.String type. + * + * Group: security + * + * @param accessKey the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder accessKey(String accessKey) { + doSetProperty("accessKey", accessKey); + return this; + } + /** + * Secret key for the cloud user. + * + * The option is a: java.lang.String type. + * + * Group: security + * + * @param secretKey the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder secretKey(String secretKey) { + doSetProperty("secretKey", secretKey); + return this; + } + /** + * Configuration object for cloud service authentication. + * + * The option is a: + * org.apache.camel.component.alibaba.common.models.ServiceKeys type. + * + * Group: security + * + * @param serviceKeys the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder serviceKeys(org.apache.camel.component.alibaba.common.models.ServiceKeys serviceKeys) { + doSetProperty("serviceKeys", serviceKeys); + return this; + } + /** + * Configuration object for cloud service authentication. + * + * The option will be converted to a + * org.apache.camel.component.alibaba.common.models.ServiceKeys type. + * + * Group: security + * + * @param serviceKeys the value to set + * @return the dsl builder + */ + default SLSEndpointBuilder serviceKeys(String serviceKeys) { + doSetProperty("serviceKeys", serviceKeys); + return this; + } + } + + /** + * Advanced builder for endpoint for the Alibaba Simple Log Service (SLS) component. + */ + public interface AdvancedSLSEndpointBuilder + extends + EndpointProducerBuilder { + default SLSEndpointBuilder basic() { + return (SLSEndpointBuilder) this; + } + + /** + * 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 during + * starting and cause the route to fail being started. By deferring this + * startup to be lazy then the startup failure can be handled during + * routing messages via Camel's routing error handlers. Beware that when + * the first message is processed then creating and starting the + * producer may take a little time and prolong the total processing time + * of the processing. + * + * The option is a: boolean type. + * + * Default: false + * Group: producer (advanced) + * + * @param lazyStartProducer the value to set + * @return the dsl builder + */ + default AdvancedSLSEndpointBuilder lazyStartProducer(boolean lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); + return this; + } + /** + * 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 during + * starting and cause the route to fail being started. By deferring this + * startup to be lazy then the startup failure can be handled during + * routing messages via Camel's routing error handlers. Beware that when + * the first message is processed then creating and starting the + * producer may take a little time and prolong the total processing time + * of the processing. + * + * The option will be converted to a boolean type. + * + * Default: false + * Group: producer (advanced) + * + * @param lazyStartProducer the value to set + * @return the dsl builder + */ + default AdvancedSLSEndpointBuilder lazyStartProducer(String lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); + return this; + } + /** + * Autowire an existing SLS client instance. + * + * The option is a: com.aliyun.sls20201230.Client type. + * + * Group: advanced + * + * @param slsClient the value to set + * @return the dsl builder + */ + default AdvancedSLSEndpointBuilder slsClient(com.aliyun.sls20201230.Client slsClient) { + doSetProperty("slsClient", slsClient); + return this; + } + /** + * Autowire an existing SLS client instance. + * + * The option will be converted to a + * com.aliyun.sls20201230.Client type. + * + * Group: advanced + * + * @param slsClient the value to set + * @return the dsl builder + */ + default AdvancedSLSEndpointBuilder slsClient(String slsClient) { + doSetProperty("slsClient", slsClient); + return this; + } + } + + public interface SLSBuilders { + /** + * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) + * Manage logs on Alibaba Cloud Simple Log Service (SLS). + * + * Category: cloud,monitoring + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-sls + * + * @return the dsl builder for the headers' name. + */ + default SLSHeaderNameBuilder alibabaSls() { + return SLSHeaderNameBuilder.INSTANCE; + } + /** + * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) + * Manage logs on Alibaba Cloud Simple Log Service (SLS). + * + * Category: cloud,monitoring + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-sls + * + * Syntax: alibaba-sls:operation + * + * Path parameter: operation (required) + * Operation to perform + * There are 3 enums and the value can be one of: putLogs, getLogs, + * listLogStores + * + * @param path operation + * @return the dsl builder + */ + default SLSEndpointBuilder alibabaSls(String path) { + return SLSEndpointBuilderFactory.endpointBuilder("alibaba-sls", path); + } + /** + * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) + * Manage logs on Alibaba Cloud Simple Log Service (SLS). + * + * Category: cloud,monitoring + * Since: 4.23 + * Maven coordinates: org.apache.camel:camel-alibaba-sls + * + * Syntax: alibaba-sls:operation + * + * Path parameter: operation (required) + * Operation to perform + * There are 3 enums and the value can be one of: putLogs, getLogs, + * listLogStores + * + * @param componentName to use a custom component name for the endpoint + * instead of the default name + * @param path operation + * @return the dsl builder + */ + default SLSEndpointBuilder alibabaSls(String componentName, String path) { + return SLSEndpointBuilderFactory.endpointBuilder(componentName, path); + } + + } + /** + * The builder of headers' name for the Alibaba Simple Log Service (SLS) component. + */ + public static class SLSHeaderNameBuilder { + /** + * The internal instance of the builder used to access to all the + * methods representing the name of headers. + */ + public static final SLSHeaderNameBuilder INSTANCE = new SLSHeaderNameBuilder(); + + /** + * SLS project name override. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsProject}. + */ + public String alibabaSlsProject() { + return "CamelAlibabaSlsProject"; + } + /** + * SLS log store name override. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsLogStoreName}. + */ + public String alibabaSlsLogStoreName() { + return "CamelAlibabaSlsLogStoreName"; + } + /** + * Log query string override. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsQuery}. + */ + public String alibabaSlsQuery() { + return "CamelAlibabaSlsQuery"; + } + /** + * Query start time override (Unix timestamp in seconds). + * + * The option is a: {@code Integer} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsFrom}. + */ + public String alibabaSlsFrom() { + return "CamelAlibabaSlsFrom"; + } + /** + * Query end time override (Unix timestamp in seconds). + * + * The option is a: {@code Integer} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsTo}. + */ + public String alibabaSlsTo() { + return "CamelAlibabaSlsTo"; + } + /** + * Maximum number of log lines to return. + * + * The option is a: {@code Long} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsLine}. + */ + public String alibabaSlsLine() { + return "CamelAlibabaSlsLine"; + } + /** + * Log query offset. + * + * The option is a: {@code Long} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsOffset}. + */ + public String alibabaSlsOffset() { + return "CamelAlibabaSlsOffset"; + } + /** + * Log topic filter override. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsTopic}. + */ + public String alibabaSlsTopic() { + return "CamelAlibabaSlsTopic"; + } + /** + * Whether to return logs in reverse order. + * + * The option is a: {@code Boolean} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsReverse}. + */ + public String alibabaSlsReverse() { + return "CamelAlibabaSlsReverse"; + } + /** + * Log store name prefix filter for listLogStores. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsLogstoreName}. + */ + public String alibabaSlsLogstoreName() { + return "CamelAlibabaSlsLogstoreName"; + } + /** + * List mode for listLogStores. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsMode}. + */ + public String alibabaSlsMode() { + return "CamelAlibabaSlsMode"; + } + /** + * Page size for listLogStores. + * + * The option is a: {@code Integer} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsSize}. + */ + public String alibabaSlsSize() { + return "CamelAlibabaSlsSize"; + } + /** + * Telemetry type filter for listLogStores. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsTelemetryType}. + */ + public String alibabaSlsTelemetryType() { + return "CamelAlibabaSlsTelemetryType"; + } + /** + * Alibaba Cloud request id. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsRequestId}. + */ + public String alibabaSlsRequestId() { + return "CamelAlibabaSlsRequestId"; + } + /** + * HTTP status code from SLS response. + * + * The option is a: {@code Integer} type. + * + * Group: producer + * + * @return the name of the header {@code AlibabaSlsStatusCode}. + */ + public String alibabaSlsStatusCode() { + return "CamelAlibabaSlsStatusCode"; + } + } + static SLSEndpointBuilder endpointBuilder(String componentName, String path) { + class SLSEndpointBuilderImpl extends AbstractEndpointBuilder implements SLSEndpointBuilder, AdvancedSLSEndpointBuilder { + public SLSEndpointBuilderImpl(String path) { + super(componentName, path); + } + } + return new SLSEndpointBuilderImpl(path); + } +} \ No newline at end of file diff --git a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties index ab3785ea8160e..58994d46165eb 100644 --- a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties +++ b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties @@ -26,6 +26,8 @@ org.apache.camel.component.alibaba.fc.FCComponent=camel:alibaba-fc org.apache.camel.component.alibaba.kms.KMSComponent=camel:alibaba-kms org.apache.camel.component.alibaba.mns.MNSComponent=camel:alibaba-mns org.apache.camel.component.alibaba.oss.OSSComponent=camel:alibaba-oss +org.apache.camel.component.alibaba.ots.OTSComponent=camel:alibaba-ots +org.apache.camel.component.alibaba.sls.SLSComponent=camel:alibaba-sls org.apache.camel.component.alibaba.sms.SMSComponent=camel:alibaba-sms org.apache.camel.component.amqp.AMQPComponent=camel:amqp org.apache.camel.component.arangodb.ArangoDbComponent=camel:arangodb From e768077bbedb640a83afac6ff6db94441803c0b9 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 14 Aug 2026 07:38:06 +0000 Subject: [PATCH 4/9] CAMEL-24373: Resolve stale SDK client after route restart Stop caching SLS and OTS clients in producers so endpoint.initClient() is used on each exchange. This avoids reusing a shut-down SyncClient after OTSEndpoint.doStop() clears the endpoint-owned client. Co-authored-by: Cursor --- .../component/alibaba/ots/OTSProducer.java | 26 ++++----- .../alibaba/ots/OTSProducerTest.java | 56 +++++++++++++++++++ .../component/alibaba/sls/SLSProducer.java | 18 +++--- .../alibaba/sls/SLSProducerTest.java | 56 +++++++++++++++++++ 4 files changed, 130 insertions(+), 26 deletions(-) create mode 100644 components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSProducerTest.java create mode 100644 components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSProducerTest.java diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSProducer.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSProducer.java index a547395257c12..befd3d982404c 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSProducer.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSProducer.java @@ -30,8 +30,6 @@ public class OTSProducer extends DefaultProducer { - private SyncClient otsClient; - public OTSProducer(OTSEndpoint endpoint) { super(endpoint); } @@ -45,49 +43,47 @@ public void process(Exchange exchange) throws Exception { throw new IllegalArgumentException("Operation name not found"); } - if (otsClient == null) { - otsClient = endpoint.initClient(); - } + SyncClient otsClient = endpoint.initClient(); switch (configuration.getOperation()) { - case OTSOperations.PUT_ROW -> putRow(exchange); - case OTSOperations.GET_ROW -> getRow(exchange); - case OTSOperations.UPDATE_ROW -> updateRow(exchange); - case OTSOperations.DELETE_ROW -> deleteRow(exchange); - case OTSOperations.LIST_TABLES -> listTables(exchange); + case OTSOperations.PUT_ROW -> putRow(exchange, otsClient); + case OTSOperations.GET_ROW -> getRow(exchange, otsClient); + case OTSOperations.UPDATE_ROW -> updateRow(exchange, otsClient); + case OTSOperations.DELETE_ROW -> deleteRow(exchange, otsClient); + case OTSOperations.LIST_TABLES -> listTables(exchange, otsClient); default -> throw new UnsupportedOperationException("Unsupported operation: " + configuration.getOperation()); } } - private void putRow(Exchange exchange) throws Exception { + private void putRow(Exchange exchange, SyncClient otsClient) throws Exception { PutRowRequest request = exchange.getMessage().getMandatoryBody(PutRowRequest.class); var response = otsClient.putRow(request); exchange.getMessage().setBody(OTSUtils.toPutRowMap(response)); setResponseHeaders(exchange, response.getRequestId()); } - private void getRow(Exchange exchange) throws Exception { + private void getRow(Exchange exchange, SyncClient otsClient) throws Exception { GetRowRequest request = exchange.getMessage().getMandatoryBody(GetRowRequest.class); var response = otsClient.getRow(request); exchange.getMessage().setBody(OTSUtils.toGetRowMap(response)); setResponseHeaders(exchange, response.getRequestId()); } - private void updateRow(Exchange exchange) throws Exception { + private void updateRow(Exchange exchange, SyncClient otsClient) throws Exception { UpdateRowRequest request = exchange.getMessage().getMandatoryBody(UpdateRowRequest.class); var response = otsClient.updateRow(request); exchange.getMessage().setBody(OTSUtils.toUpdateRowMap(response)); setResponseHeaders(exchange, response.getRequestId()); } - private void deleteRow(Exchange exchange) throws Exception { + private void deleteRow(Exchange exchange, SyncClient otsClient) throws Exception { DeleteRowRequest request = exchange.getMessage().getMandatoryBody(DeleteRowRequest.class); var response = otsClient.deleteRow(request); exchange.getMessage().setBody(OTSUtils.toDeleteRowMap(response)); setResponseHeaders(exchange, response.getRequestId()); } - private void listTables(Exchange exchange) throws Exception { + private void listTables(Exchange exchange, SyncClient otsClient) throws Exception { var response = otsClient.listTable(); exchange.getMessage().setBody(OTSUtils.toListTablesBody(response)); setResponseHeaders(exchange, response.getRequestId()); diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSProducerTest.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSProducerTest.java new file mode 100644 index 0000000000000..c12d2156c17c7 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSProducerTest.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.ots; + +import java.util.List; + +import com.alicloud.openservices.tablestore.SyncClient; +import com.alicloud.openservices.tablestore.model.ListTableResponse; +import com.alicloud.openservices.tablestore.model.Response; +import org.apache.camel.support.DefaultExchange; +import org.apache.camel.test.junit6.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +class OTSProducerTest extends CamelTestSupport { + + @Test + void processReinitializesClientFromEndpointOnEachExchange() throws Exception { + OTSEndpoint endpoint = mock(OTSEndpoint.class); + when(endpoint.getOperation()).thenReturn("listTables"); + when(endpoint.getCamelContext()).thenReturn(context); + + SyncClient firstClient = mock(SyncClient.class); + SyncClient secondClient = mock(SyncClient.class); + when(endpoint.initClient()).thenReturn(firstClient, secondClient); + + ListTableResponse response = new ListTableResponse(new Response("req-list")); + response.setTableNames(List.of("table-a")); + when(firstClient.listTable()).thenReturn(response); + when(secondClient.listTable()).thenReturn(response); + + OTSProducer producer = new OTSProducer(endpoint); + producer.process(new DefaultExchange(context)); + producer.process(new DefaultExchange(context)); + + verify(firstClient).listTable(); + verify(secondClient).listTable(); + } +} diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSProducer.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSProducer.java index 0e658da079bb9..36159dc8ba6c4 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSProducer.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSProducer.java @@ -34,8 +34,6 @@ public class SLSProducer extends DefaultProducer { - private Client slsClient; - public SLSProducer(SLSEndpoint endpoint) { super(endpoint); } @@ -49,19 +47,17 @@ public void process(Exchange exchange) throws Exception { throw new IllegalArgumentException("Operation name not found"); } - if (slsClient == null) { - slsClient = endpoint.initClient(); - } + Client slsClient = endpoint.initClient(); switch (configuration.getOperation()) { - case SLSOperations.PUT_LOGS -> putLogs(exchange, configuration); - case SLSOperations.GET_LOGS -> getLogs(exchange, configuration); - case SLSOperations.LIST_LOG_STORES -> listLogStores(exchange, configuration); + case SLSOperations.PUT_LOGS -> putLogs(exchange, configuration, slsClient); + case SLSOperations.GET_LOGS -> getLogs(exchange, configuration, slsClient); + case SLSOperations.LIST_LOG_STORES -> listLogStores(exchange, configuration, slsClient); default -> throw new UnsupportedOperationException("Unsupported operation: " + configuration.getOperation()); } } - private void putLogs(Exchange exchange, ClientConfigurations configuration) throws Exception { + private void putLogs(Exchange exchange, ClientConfigurations configuration, Client slsClient) throws Exception { validateProjectAndLogStore(configuration); PutLogsRequest request = SLSUtils.resolvePutLogsRequest(exchange); @@ -74,7 +70,7 @@ private void putLogs(Exchange exchange, ClientConfigurations configuration) thro setResponseHeaders(exchange, response.getStatusCode(), response.getHeaders()); } - private void getLogs(Exchange exchange, ClientConfigurations configuration) throws Exception { + private void getLogs(Exchange exchange, ClientConfigurations configuration, Client slsClient) throws Exception { validateProjectAndLogStore(configuration); GetLogsRequest request = SLSUtils.buildGetLogsRequest(configuration); @@ -87,7 +83,7 @@ private void getLogs(Exchange exchange, ClientConfigurations configuration) thro setResponseHeaders(exchange, response.getStatusCode(), response.getHeaders()); } - private void listLogStores(Exchange exchange, ClientConfigurations configuration) throws Exception { + private void listLogStores(Exchange exchange, ClientConfigurations configuration, Client slsClient) throws Exception { validateProject(configuration); ListLogStoresRequest request = SLSUtils.buildListLogStoresRequest(configuration); diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSProducerTest.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSProducerTest.java new file mode 100644 index 0000000000000..33c2d36b513c2 --- /dev/null +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSProducerTest.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.alibaba.sls; + +import com.aliyun.sls20201230.Client; +import com.aliyun.sls20201230.models.ListLogStoresRequest; +import com.aliyun.sls20201230.models.ListLogStoresResponse; +import org.apache.camel.support.DefaultExchange; +import org.apache.camel.test.junit6.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +class SLSProducerTest extends CamelTestSupport { + + @Test + void processReinitializesClientFromEndpointOnEachExchange() throws Exception { + SLSEndpoint endpoint = mock(SLSEndpoint.class); + when(endpoint.getOperation()).thenReturn("listLogStores"); + when(endpoint.getProject()).thenReturn("demo-project"); + when(endpoint.getCamelContext()).thenReturn(context); + + Client firstClient = mock(Client.class); + Client secondClient = mock(Client.class); + when(endpoint.initClient()).thenReturn(firstClient, secondClient); + + ListLogStoresResponse response = new ListLogStoresResponse(); + when(firstClient.listLogStores(eq("demo-project"), any(ListLogStoresRequest.class))).thenReturn(response); + when(secondClient.listLogStores(eq("demo-project"), any(ListLogStoresRequest.class))).thenReturn(response); + + SLSProducer producer = new SLSProducer(endpoint); + producer.process(new DefaultExchange(context)); + producer.process(new DefaultExchange(context)); + + verify(firstClient).listLogStores(eq("demo-project"), any(ListLogStoresRequest.class)); + verify(secondClient).listLogStores(eq("demo-project"), any(ListLogStoresRequest.class)); + } +} From 05eba4fe7681c3a533e976fa3f7ffee2bd259807 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 14 Aug 2026 15:31:05 +0000 Subject: [PATCH 5/9] CAMEL-24373: Rename SLS and OTS classes with Alibaba prefix Follow the Phase 2 EventBridge rename pattern to avoid class name clashes on case-insensitive filesystems. Rename component, endpoint, producer, utils, headers, operations and properties classes to AlibabaSls* and AlibabaOts* prefixes. Regenerate catalog, DSL and component metadata. Co-authored-by: Cursor --- .../camel/catalog/components/alibaba-ots.json | 6 +- .../camel/catalog/components/alibaba-sls.json | 32 +++---- ...ava => AlibabaOtsComponentConfigurer.java} | 6 +- ...java => AlibabaOtsEndpointConfigurer.java} | 6 +- ...java => AlibabaOtsEndpointUriFactory.java} | 2 +- .../component/alibaba/ots/alibaba-ots.json | 6 +- .../org/apache/camel/component/alibaba-ots | 2 +- .../camel/configurer/alibaba-ots-component | 2 +- .../camel/configurer/alibaba-ots-endpoint | 2 +- .../camel/urifactory/alibaba-ots-endpoint | 2 +- ...omponent.java => AlibabaOtsComponent.java} | 4 +- ...SEndpoint.java => AlibabaOtsEndpoint.java} | 14 +-- ...SProducer.java => AlibabaOtsProducer.java} | 38 ++++---- .../{OTSUtils.java => AlibabaOtsUtils.java} | 12 +-- ...OTSHeaders.java => AlibabaOtsHeaders.java} | 8 +- ...rations.java => AlibabaOtsOperations.java} | 4 +- ...perties.java => AlibabaOtsProperties.java} | 4 +- ...tTest.java => AlibabaOtsEndpointTest.java} | 12 +-- ...rTest.java => AlibabaOtsProducerTest.java} | 6 +- ...est.java => AlibabaOtsOperationsTest.java} | 12 +-- ...ava => AlibabaSlsComponentConfigurer.java} | 6 +- ...java => AlibabaSlsEndpointConfigurer.java} | 6 +- ...java => AlibabaSlsEndpointUriFactory.java} | 2 +- .../component/alibaba/sls/alibaba-sls.json | 32 +++---- .../org/apache/camel/component/alibaba-sls | 2 +- .../camel/configurer/alibaba-sls-component | 2 +- .../camel/configurer/alibaba-sls-endpoint | 2 +- .../camel/urifactory/alibaba-sls-endpoint | 2 +- ...omponent.java => AlibabaSlsComponent.java} | 4 +- ...SEndpoint.java => AlibabaSlsEndpoint.java} | 14 +-- ...SProducer.java => AlibabaSlsProducer.java} | 40 ++++----- .../{SLSUtils.java => AlibabaSlsUtils.java} | 41 ++++----- ...SLSHeaders.java => AlibabaSlsHeaders.java} | 32 +++---- ...rations.java => AlibabaSlsOperations.java} | 4 +- ...perties.java => AlibabaSlsProperties.java} | 4 +- ...tTest.java => AlibabaSlsEndpointTest.java} | 10 +-- ...rTest.java => AlibabaSlsProducerTest.java} | 6 +- .../component/alibaba/sls/GetLogsTest.java | 6 +- .../alibaba/sls/ListLogStoresTest.java | 6 +- .../component/alibaba/sls/PutLogsTest.java | 6 +- ...est.java => AlibabaSlsOperationsTest.java} | 8 +- .../ROOT/examples/json/alibaba-ots.json | 6 +- .../ROOT/examples/json/alibaba-sls.json | 32 +++---- .../AlibabaOtsComponentBuilderFactory.java | 18 ++-- .../AlibabaSlsComponentBuilderFactory.java | 18 ++-- .../endpoint/EndpointBuilderFactory.java | 4 +- .../builder/endpoint/EndpointBuilders.java | 4 +- .../endpoint/EndpointHeaderBuilders.java | 8 +- .../endpoint/StaticEndpointBuilders.java | 12 +-- ... => AlibabaOtsEndpointBuilderFactory.java} | 60 ++++++------- ... => AlibabaSlsEndpointBuilderFactory.java} | 88 +++++++++---------- ...el-component-known-dependencies.properties | 4 +- 52 files changed, 335 insertions(+), 334 deletions(-) rename components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/{OTSComponentConfigurer.java => AlibabaOtsComponentConfigurer.java} (91%) rename components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/{OTSEndpointConfigurer.java => AlibabaOtsEndpointConfigurer.java} (93%) rename components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/{OTSEndpointUriFactory.java => AlibabaOtsEndpointUriFactory.java} (94%) rename components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/{OTSComponent.java => AlibabaOtsComponent.java} (89%) rename components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/{OTSEndpoint.java => AlibabaOtsEndpoint.java} (91%) rename components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/{OTSProducer.java => AlibabaOtsProducer.java} (70%) rename components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/{OTSUtils.java => AlibabaOtsUtils.java} (95%) rename components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/{OTSHeaders.java => AlibabaOtsHeaders.java} (82%) rename components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/{OTSOperations.java => AlibabaOtsOperations.java} (93%) rename components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/{OTSProperties.java => AlibabaOtsProperties.java} (94%) rename components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/{OTSEndpointTest.java => AlibabaOtsEndpointTest.java} (85%) rename components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/{OTSProducerTest.java => AlibabaOtsProducerTest.java} (91%) rename components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/constants/{OTSOperationsTest.java => AlibabaOtsOperationsTest.java} (71%) rename components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/{SLSComponentConfigurer.java => AlibabaSlsComponentConfigurer.java} (91%) rename components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/{SLSEndpointConfigurer.java => AlibabaSlsEndpointConfigurer.java} (95%) rename components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/{SLSEndpointUriFactory.java => AlibabaSlsEndpointUriFactory.java} (95%) rename components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/{SLSComponent.java => AlibabaSlsComponent.java} (89%) rename components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/{SLSEndpoint.java => AlibabaSlsEndpoint.java} (94%) rename components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/{SLSProducer.java => AlibabaSlsProducer.java} (71%) rename components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/{SLSUtils.java => AlibabaSlsUtils.java} (83%) rename components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/{SLSHeaders.java => AlibabaSlsHeaders.java} (70%) rename components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/{SLSOperations.java => AlibabaSlsOperations.java} (92%) rename components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/{SLSProperties.java => AlibabaSlsProperties.java} (97%) rename components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/{SLSEndpointTest.java => AlibabaSlsEndpointTest.java} (83%) rename components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/{SLSProducerTest.java => AlibabaSlsProducerTest.java} (92%) rename components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/constants/{SLSOperationsTest.java => AlibabaSlsOperationsTest.java} (79%) rename dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/{OTSEndpointBuilderFactory.java => AlibabaOtsEndpointBuilderFactory.java} (81%) rename dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/{SLSEndpointBuilderFactory.java => AlibabaSlsEndpointBuilderFactory.java} (86%) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-ots.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-ots.json index 442b35c56bb3f..4942723cda505 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-ots.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-ots.json @@ -7,7 +7,7 @@ "deprecated": false, "firstVersion": "4.23.0", "label": "cloud,database", - "javaType": "org.apache.camel.component.alibaba.ots.OTSComponent", + "javaType": "org.apache.camel.component.alibaba.ots.AlibabaOtsComponent", "supportLevel": "Preview", "groupId": "org.apache.camel", "artifactId": "camel-alibaba-ots", @@ -30,8 +30,8 @@ "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } }, "headers": { - "CamelAlibabaOtsOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation override", "constantName": "org.apache.camel.component.alibaba.ots.constants.OTSHeaders#OPERATION" }, - "CamelAlibabaOtsRequestId": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore request id", "constantName": "org.apache.camel.component.alibaba.ots.constants.OTSHeaders#REQUEST_ID" } + "CamelAlibabaOtsOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation override", "constantName": "org.apache.camel.component.alibaba.ots.constants.AlibabaOtsHeaders#OPERATION" }, + "CamelAlibabaOtsRequestId": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore request id", "constantName": "org.apache.camel.component.alibaba.ots.constants.AlibabaOtsHeaders#REQUEST_ID" } }, "properties": { "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putRow", "getRow", "updateRow", "deleteRow", "listTables" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-sls.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-sls.json index 940a63a6242a7..b4da0b72d0261 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-sls.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-sls.json @@ -7,7 +7,7 @@ "deprecated": false, "firstVersion": "4.23.0", "label": "cloud,monitoring", - "javaType": "org.apache.camel.component.alibaba.sls.SLSComponent", + "javaType": "org.apache.camel.component.alibaba.sls.AlibabaSlsComponent", "supportLevel": "Preview", "groupId": "org.apache.camel", "artifactId": "camel-alibaba-sls", @@ -30,21 +30,21 @@ "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } }, "headers": { - "CamelAlibabaSlsProject": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS project name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#PROJECT" }, - "CamelAlibabaSlsLogStoreName": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS log store name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LOG_STORE_NAME" }, - "CamelAlibabaSlsQuery": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query string override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#QUERY" }, - "CamelAlibabaSlsFrom": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query start time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#FROM" }, - "CamelAlibabaSlsTo": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query end time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TO" }, - "CamelAlibabaSlsLine": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Maximum number of log lines to return", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LINE" }, - "CamelAlibabaSlsOffset": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query offset", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#OFFSET" }, - "CamelAlibabaSlsTopic": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log topic filter override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TOPIC" }, - "CamelAlibabaSlsReverse": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether to return logs in reverse order", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#REVERSE" }, - "CamelAlibabaSlsLogstoreName": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log store name prefix filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LOGSTORE_NAME" }, - "CamelAlibabaSlsMode": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List mode for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#MODE" }, - "CamelAlibabaSlsSize": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Page size for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#SIZE" }, - "CamelAlibabaSlsTelemetryType": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Telemetry type filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TELEMETRY_TYPE" }, - "CamelAlibabaSlsRequestId": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud request id", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#REQUEST_ID" }, - "CamelAlibabaSlsStatusCode": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "HTTP status code from SLS response", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#STATUS_CODE" } + "CamelAlibabaSlsProject": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS project name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#PROJECT" }, + "CamelAlibabaSlsLogStoreName": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS log store name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#LOG_STORE_NAME" }, + "CamelAlibabaSlsQuery": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query string override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#QUERY" }, + "CamelAlibabaSlsFrom": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query start time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#FROM" }, + "CamelAlibabaSlsTo": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query end time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#TO" }, + "CamelAlibabaSlsLine": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Maximum number of log lines to return", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#LINE" }, + "CamelAlibabaSlsOffset": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query offset", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#OFFSET" }, + "CamelAlibabaSlsTopic": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log topic filter override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#TOPIC" }, + "CamelAlibabaSlsReverse": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether to return logs in reverse order", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#REVERSE" }, + "CamelAlibabaSlsLogstoreName": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log store name prefix filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#LOGSTORE_NAME" }, + "CamelAlibabaSlsMode": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List mode for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#MODE" }, + "CamelAlibabaSlsSize": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Page size for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#SIZE" }, + "CamelAlibabaSlsTelemetryType": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Telemetry type filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#TELEMETRY_TYPE" }, + "CamelAlibabaSlsRequestId": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud request id", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#REQUEST_ID" }, + "CamelAlibabaSlsStatusCode": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "HTTP status code from SLS response", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#STATUS_CODE" } }, "properties": { "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putLogs", "getLogs", "listLogStores" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSComponentConfigurer.java b/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/AlibabaOtsComponentConfigurer.java similarity index 91% rename from components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSComponentConfigurer.java rename to components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/AlibabaOtsComponentConfigurer.java index cb5775e6bf4b5..89e5df97b3aff 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSComponentConfigurer.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/AlibabaOtsComponentConfigurer.java @@ -17,11 +17,11 @@ */ @Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo") @SuppressWarnings("unchecked") -public class OTSComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { +public class AlibabaOtsComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { @Override public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { - OTSComponent target = (OTSComponent) obj; + AlibabaOtsComponent target = (AlibabaOtsComponent) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "autowiredenabled": case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true; @@ -52,7 +52,7 @@ public Class getOptionType(String name, boolean ignoreCase) { @Override public Object getOptionValue(Object obj, String name, boolean ignoreCase) { - OTSComponent target = (OTSComponent) obj; + AlibabaOtsComponent target = (AlibabaOtsComponent) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "autowiredenabled": case "autowiredEnabled": return target.isAutowiredEnabled(); diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointConfigurer.java b/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointConfigurer.java similarity index 93% rename from components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointConfigurer.java rename to components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointConfigurer.java index cb1e536a01307..d799920d26f50 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointConfigurer.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointConfigurer.java @@ -17,11 +17,11 @@ */ @Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo") @SuppressWarnings("unchecked") -public class OTSEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { +public class AlibabaOtsEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { @Override public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { - OTSEndpoint target = (OTSEndpoint) obj; + AlibabaOtsEndpoint target = (AlibabaOtsEndpoint) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "accesskey": case "accessKey": target.setAccessKey(property(camelContext, java.lang.String.class, value)); return true; @@ -67,7 +67,7 @@ public Class getOptionType(String name, boolean ignoreCase) { @Override public Object getOptionValue(Object obj, String name, boolean ignoreCase) { - OTSEndpoint target = (OTSEndpoint) obj; + AlibabaOtsEndpoint target = (AlibabaOtsEndpoint) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "accesskey": case "accessKey": return target.getAccessKey(); diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointUriFactory.java b/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointUriFactory.java similarity index 94% rename from components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointUriFactory.java rename to components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointUriFactory.java index 85f5a1221d3e0..4fd264b7f9682 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/OTSEndpointUriFactory.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointUriFactory.java @@ -15,7 +15,7 @@ * Generated by camel build tools - do NOT edit this file! */ @Generated("org.apache.camel.maven.packaging.GenerateEndpointUriFactoryMojo") -public class OTSEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory { +public class AlibabaOtsEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory { private static final String BASE = ":operation"; diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/org/apache/camel/component/alibaba/ots/alibaba-ots.json b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/org/apache/camel/component/alibaba/ots/alibaba-ots.json index 442b35c56bb3f..4942723cda505 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/org/apache/camel/component/alibaba/ots/alibaba-ots.json +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/org/apache/camel/component/alibaba/ots/alibaba-ots.json @@ -7,7 +7,7 @@ "deprecated": false, "firstVersion": "4.23.0", "label": "cloud,database", - "javaType": "org.apache.camel.component.alibaba.ots.OTSComponent", + "javaType": "org.apache.camel.component.alibaba.ots.AlibabaOtsComponent", "supportLevel": "Preview", "groupId": "org.apache.camel", "artifactId": "camel-alibaba-ots", @@ -30,8 +30,8 @@ "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } }, "headers": { - "CamelAlibabaOtsOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation override", "constantName": "org.apache.camel.component.alibaba.ots.constants.OTSHeaders#OPERATION" }, - "CamelAlibabaOtsRequestId": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore request id", "constantName": "org.apache.camel.component.alibaba.ots.constants.OTSHeaders#REQUEST_ID" } + "CamelAlibabaOtsOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation override", "constantName": "org.apache.camel.component.alibaba.ots.constants.AlibabaOtsHeaders#OPERATION" }, + "CamelAlibabaOtsRequestId": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore request id", "constantName": "org.apache.camel.component.alibaba.ots.constants.AlibabaOtsHeaders#REQUEST_ID" } }, "properties": { "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putRow", "getRow", "updateRow", "deleteRow", "listTables" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-ots b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-ots index 91c7212fe1865..7e209d1d751bb 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-ots +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-ots @@ -1,2 +1,2 @@ # Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.alibaba.ots.OTSComponent +class=org.apache.camel.component.alibaba.ots.AlibabaOtsComponent diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-component b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-component index 08d76a28352ef..5abe1bb3f501f 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-component +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-component @@ -1,2 +1,2 @@ # Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.alibaba.ots.OTSComponentConfigurer +class=org.apache.camel.component.alibaba.ots.AlibabaOtsComponentConfigurer diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-endpoint b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-endpoint index 915b9a8d6a443..069fba5c93e30 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-endpoint +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-ots-endpoint @@ -1,2 +1,2 @@ # Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.alibaba.ots.OTSEndpointConfigurer +class=org.apache.camel.component.alibaba.ots.AlibabaOtsEndpointConfigurer diff --git a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-ots-endpoint b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-ots-endpoint index d0c9ffcbf7828..416d98816211c 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-ots-endpoint +++ b/components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-ots-endpoint @@ -1,2 +1,2 @@ # Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.alibaba.ots.OTSEndpointUriFactory +class=org.apache.camel.component.alibaba.ots.AlibabaOtsEndpointUriFactory diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSComponent.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsComponent.java similarity index 89% rename from components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSComponent.java rename to components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsComponent.java index 9efad6bc92dd0..ef4300d3320b0 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSComponent.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsComponent.java @@ -23,11 +23,11 @@ import org.apache.camel.support.HealthCheckComponent; @Component("alibaba-ots") -public class OTSComponent extends HealthCheckComponent { +public class AlibabaOtsComponent extends HealthCheckComponent { @Override protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception { - OTSEndpoint endpoint = new OTSEndpoint(uri, remaining, this); + AlibabaOtsEndpoint endpoint = new AlibabaOtsEndpoint(uri, remaining, this); setProperties(endpoint, parameters); return endpoint; } diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSEndpoint.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpoint.java similarity index 91% rename from components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSEndpoint.java rename to components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpoint.java index 9f1c78e530c4b..73089a331dadc 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSEndpoint.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpoint.java @@ -22,7 +22,7 @@ import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.component.alibaba.common.models.ServiceKeys; -import org.apache.camel.component.alibaba.ots.constants.OTSHeaders; +import org.apache.camel.component.alibaba.ots.constants.AlibabaOtsHeaders; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -34,8 +34,8 @@ */ @UriEndpoint(firstVersion = "4.23.0", scheme = "alibaba-ots", title = "Alibaba Tablestore (OTS)", syntax = "alibaba-ots:operation", category = { Category.CLOUD, Category.DATABASE }, - headersClass = OTSHeaders.class, producerOnly = true) -public class OTSEndpoint extends DefaultEndpoint { + headersClass = AlibabaOtsHeaders.class, producerOnly = true) +public class AlibabaOtsEndpoint extends DefaultEndpoint { @UriPath(description = "Operation to perform", displayName = "Operation", label = "producer", enums = "putRow,getRow,updateRow,deleteRow,listTables") @@ -69,17 +69,17 @@ public class OTSEndpoint extends DefaultEndpoint { private boolean autowiredOtsClient; - public OTSEndpoint() { + public AlibabaOtsEndpoint() { } - public OTSEndpoint(String uri, String operation, OTSComponent component) { + public AlibabaOtsEndpoint(String uri, String operation, AlibabaOtsComponent component) { super(uri, component); this.operation = operation; } @Override public Producer createProducer() throws Exception { - return new OTSProducer(this); + return new AlibabaOtsProducer(this); } @Override @@ -91,7 +91,7 @@ public SyncClient initClient() throws Exception { if (otsClient != null) { return otsClient; } - otsClient = OTSUtils.createClient(this); + otsClient = AlibabaOtsUtils.createClient(this); return otsClient; } diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSProducer.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsProducer.java similarity index 70% rename from components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSProducer.java rename to components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsProducer.java index befd3d982404c..519dd4558aec6 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSProducer.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsProducer.java @@ -22,22 +22,22 @@ import com.alicloud.openservices.tablestore.model.PutRowRequest; import com.alicloud.openservices.tablestore.model.UpdateRowRequest; import org.apache.camel.Exchange; -import org.apache.camel.component.alibaba.ots.constants.OTSHeaders; -import org.apache.camel.component.alibaba.ots.constants.OTSOperations; +import org.apache.camel.component.alibaba.ots.constants.AlibabaOtsHeaders; +import org.apache.camel.component.alibaba.ots.constants.AlibabaOtsOperations; import org.apache.camel.component.alibaba.ots.models.ClientConfigurations; import org.apache.camel.support.DefaultProducer; import org.apache.camel.util.ObjectHelper; -public class OTSProducer extends DefaultProducer { +public class AlibabaOtsProducer extends DefaultProducer { - public OTSProducer(OTSEndpoint endpoint) { + public AlibabaOtsProducer(AlibabaOtsEndpoint endpoint) { super(endpoint); } @Override public void process(Exchange exchange) throws Exception { - OTSEndpoint endpoint = getEndpoint(); - ClientConfigurations configuration = OTSUtils.createClientConfigurations(endpoint, exchange); + AlibabaOtsEndpoint endpoint = getEndpoint(); + ClientConfigurations configuration = AlibabaOtsUtils.createClientConfigurations(endpoint, exchange); if (ObjectHelper.isEmpty(configuration.getOperation())) { throw new IllegalArgumentException("Operation name not found"); @@ -46,11 +46,11 @@ public void process(Exchange exchange) throws Exception { SyncClient otsClient = endpoint.initClient(); switch (configuration.getOperation()) { - case OTSOperations.PUT_ROW -> putRow(exchange, otsClient); - case OTSOperations.GET_ROW -> getRow(exchange, otsClient); - case OTSOperations.UPDATE_ROW -> updateRow(exchange, otsClient); - case OTSOperations.DELETE_ROW -> deleteRow(exchange, otsClient); - case OTSOperations.LIST_TABLES -> listTables(exchange, otsClient); + case AlibabaOtsOperations.PUT_ROW -> putRow(exchange, otsClient); + case AlibabaOtsOperations.GET_ROW -> getRow(exchange, otsClient); + case AlibabaOtsOperations.UPDATE_ROW -> updateRow(exchange, otsClient); + case AlibabaOtsOperations.DELETE_ROW -> deleteRow(exchange, otsClient); + case AlibabaOtsOperations.LIST_TABLES -> listTables(exchange, otsClient); default -> throw new UnsupportedOperationException("Unsupported operation: " + configuration.getOperation()); } } @@ -58,45 +58,45 @@ public void process(Exchange exchange) throws Exception { private void putRow(Exchange exchange, SyncClient otsClient) throws Exception { PutRowRequest request = exchange.getMessage().getMandatoryBody(PutRowRequest.class); var response = otsClient.putRow(request); - exchange.getMessage().setBody(OTSUtils.toPutRowMap(response)); + exchange.getMessage().setBody(AlibabaOtsUtils.toPutRowMap(response)); setResponseHeaders(exchange, response.getRequestId()); } private void getRow(Exchange exchange, SyncClient otsClient) throws Exception { GetRowRequest request = exchange.getMessage().getMandatoryBody(GetRowRequest.class); var response = otsClient.getRow(request); - exchange.getMessage().setBody(OTSUtils.toGetRowMap(response)); + exchange.getMessage().setBody(AlibabaOtsUtils.toGetRowMap(response)); setResponseHeaders(exchange, response.getRequestId()); } private void updateRow(Exchange exchange, SyncClient otsClient) throws Exception { UpdateRowRequest request = exchange.getMessage().getMandatoryBody(UpdateRowRequest.class); var response = otsClient.updateRow(request); - exchange.getMessage().setBody(OTSUtils.toUpdateRowMap(response)); + exchange.getMessage().setBody(AlibabaOtsUtils.toUpdateRowMap(response)); setResponseHeaders(exchange, response.getRequestId()); } private void deleteRow(Exchange exchange, SyncClient otsClient) throws Exception { DeleteRowRequest request = exchange.getMessage().getMandatoryBody(DeleteRowRequest.class); var response = otsClient.deleteRow(request); - exchange.getMessage().setBody(OTSUtils.toDeleteRowMap(response)); + exchange.getMessage().setBody(AlibabaOtsUtils.toDeleteRowMap(response)); setResponseHeaders(exchange, response.getRequestId()); } private void listTables(Exchange exchange, SyncClient otsClient) throws Exception { var response = otsClient.listTable(); - exchange.getMessage().setBody(OTSUtils.toListTablesBody(response)); + exchange.getMessage().setBody(AlibabaOtsUtils.toListTablesBody(response)); setResponseHeaders(exchange, response.getRequestId()); } private void setResponseHeaders(Exchange exchange, String requestId) { if (ObjectHelper.isNotEmpty(requestId)) { - exchange.getMessage().setHeader(OTSHeaders.REQUEST_ID, requestId); + exchange.getMessage().setHeader(AlibabaOtsHeaders.REQUEST_ID, requestId); } } @Override - public OTSEndpoint getEndpoint() { - return (OTSEndpoint) super.getEndpoint(); + public AlibabaOtsEndpoint getEndpoint() { + return (AlibabaOtsEndpoint) super.getEndpoint(); } } diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSUtils.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsUtils.java similarity index 95% rename from components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSUtils.java rename to components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsUtils.java index 1d20b76176de3..676a662491231 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/OTSUtils.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsUtils.java @@ -38,16 +38,16 @@ import org.apache.camel.Exchange; import org.apache.camel.component.alibaba.common.OpenApiClientSupport; import org.apache.camel.component.alibaba.common.models.ServiceKeys; -import org.apache.camel.component.alibaba.ots.constants.OTSProperties; +import org.apache.camel.component.alibaba.ots.constants.AlibabaOtsProperties; import org.apache.camel.component.alibaba.ots.models.ClientConfigurations; import org.apache.camel.util.ObjectHelper; -public final class OTSUtils { +public final class AlibabaOtsUtils { - private OTSUtils() { + private AlibabaOtsUtils() { } - public static SyncClient createClient(OTSEndpoint endpoint) { + public static SyncClient createClient(AlibabaOtsEndpoint endpoint) { if (ObjectHelper.isEmpty(endpoint.getEndpoint())) { throw new IllegalArgumentException("Endpoint is required"); } @@ -82,10 +82,10 @@ public static String resolveSecretKey(String secretKey, ServiceKeys serviceKeys) throw new IllegalArgumentException("Authentication parameter 'secret key (SK)' not found"); } - public static ClientConfigurations createClientConfigurations(OTSEndpoint endpoint, Exchange exchange) { + public static ClientConfigurations createClientConfigurations(AlibabaOtsEndpoint endpoint, Exchange exchange) { ClientConfigurations configuration = new ClientConfigurations(); configuration.setOperation( - OpenApiClientSupport.resolveString(exchange, OTSProperties.OPERATION, endpoint.getOperation())); + OpenApiClientSupport.resolveString(exchange, AlibabaOtsProperties.OPERATION, endpoint.getOperation())); return configuration; } diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSHeaders.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/AlibabaOtsHeaders.java similarity index 82% rename from components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSHeaders.java rename to components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/AlibabaOtsHeaders.java index 5588f46272e4a..c3ea1996ce96b 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSHeaders.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/AlibabaOtsHeaders.java @@ -18,14 +18,14 @@ import org.apache.camel.spi.Metadata; -public final class OTSHeaders { +public final class AlibabaOtsHeaders { @Metadata(label = "producer", description = "Operation override", javaType = "String") - public static final String OPERATION = OTSProperties.OPERATION; + public static final String OPERATION = AlibabaOtsProperties.OPERATION; @Metadata(label = "producer", description = "Tablestore request id", javaType = "String") - public static final String REQUEST_ID = OTSProperties.REQUEST_ID; + public static final String REQUEST_ID = AlibabaOtsProperties.REQUEST_ID; - private OTSHeaders() { + private AlibabaOtsHeaders() { } } diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSOperations.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/AlibabaOtsOperations.java similarity index 93% rename from components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSOperations.java rename to components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/AlibabaOtsOperations.java index 6ebdde5200f58..bd610fca6ac2d 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSOperations.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/AlibabaOtsOperations.java @@ -16,7 +16,7 @@ */ package org.apache.camel.component.alibaba.ots.constants; -public final class OTSOperations { +public final class AlibabaOtsOperations { public static final String PUT_ROW = "putRow"; public static final String GET_ROW = "getRow"; @@ -24,6 +24,6 @@ public final class OTSOperations { public static final String DELETE_ROW = "deleteRow"; public static final String LIST_TABLES = "listTables"; - private OTSOperations() { + private AlibabaOtsOperations() { } } diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSProperties.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/AlibabaOtsProperties.java similarity index 94% rename from components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSProperties.java rename to components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/AlibabaOtsProperties.java index c8abcf0ac1f86..55ab325cf20a1 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/OTSProperties.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/constants/AlibabaOtsProperties.java @@ -18,7 +18,7 @@ import org.apache.camel.spi.Metadata; -public final class OTSProperties { +public final class AlibabaOtsProperties { @Metadata(label = "producer", description = "Operation to perform", javaType = "String") public static final String OPERATION = "CamelAlibabaOtsOperation"; @@ -26,6 +26,6 @@ public final class OTSProperties { @Metadata(label = "producer", description = "Request id returned by Tablestore", javaType = "String") public static final String REQUEST_ID = "CamelAlibabaOtsRequestId"; - private OTSProperties() { + private AlibabaOtsProperties() { } } diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSEndpointTest.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointTest.java similarity index 85% rename from components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSEndpointTest.java rename to components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointTest.java index f96ec835de7ae..5435230325ca5 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSEndpointTest.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointTest.java @@ -24,11 +24,11 @@ import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; -class OTSEndpointTest { +class AlibabaOtsEndpointTest { @Test void initClientReturnsCachedInstance() throws Exception { - OTSEndpoint endpoint = new OTSEndpoint(); + AlibabaOtsEndpoint endpoint = new AlibabaOtsEndpoint(); endpoint.setAccessKey("ak"); endpoint.setSecretKey("sk"); endpoint.setEndpoint("https://test-instance.cn-hangzhou.ots.aliyuncs.com"); @@ -43,7 +43,7 @@ void initClientReturnsCachedInstance() throws Exception { @Test void doStopSkipsShutdownForAutowiredClient() throws Exception { - OTSEndpoint endpoint = new OTSEndpoint(); + AlibabaOtsEndpoint endpoint = new AlibabaOtsEndpoint(); SyncClient client = mock(SyncClient.class); endpoint.setOtsClient(client); @@ -54,14 +54,14 @@ void doStopSkipsShutdownForAutowiredClient() throws Exception { @Test void doStopShutsDownOwnedClient() throws Exception { - OTSEndpoint endpoint = new OTSEndpoint(); + AlibabaOtsEndpoint endpoint = new AlibabaOtsEndpoint(); SyncClient client = mock(SyncClient.class); - var clientField = OTSEndpoint.class.getDeclaredField("otsClient"); + var clientField = AlibabaOtsEndpoint.class.getDeclaredField("otsClient"); clientField.setAccessible(true); clientField.set(endpoint, client); - var autowiredField = OTSEndpoint.class.getDeclaredField("autowiredOtsClient"); + var autowiredField = AlibabaOtsEndpoint.class.getDeclaredField("autowiredOtsClient"); autowiredField.setAccessible(true); autowiredField.setBoolean(endpoint, false); diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSProducerTest.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/AlibabaOtsProducerTest.java similarity index 91% rename from components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSProducerTest.java rename to components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/AlibabaOtsProducerTest.java index c12d2156c17c7..a55be7fff34e1 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/OTSProducerTest.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/AlibabaOtsProducerTest.java @@ -29,11 +29,11 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -class OTSProducerTest extends CamelTestSupport { +class AlibabaOtsProducerTest extends CamelTestSupport { @Test void processReinitializesClientFromEndpointOnEachExchange() throws Exception { - OTSEndpoint endpoint = mock(OTSEndpoint.class); + AlibabaOtsEndpoint endpoint = mock(AlibabaOtsEndpoint.class); when(endpoint.getOperation()).thenReturn("listTables"); when(endpoint.getCamelContext()).thenReturn(context); @@ -46,7 +46,7 @@ void processReinitializesClientFromEndpointOnEachExchange() throws Exception { when(firstClient.listTable()).thenReturn(response); when(secondClient.listTable()).thenReturn(response); - OTSProducer producer = new OTSProducer(endpoint); + AlibabaOtsProducer producer = new AlibabaOtsProducer(endpoint); producer.process(new DefaultExchange(context)); producer.process(new DefaultExchange(context)); diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/constants/OTSOperationsTest.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/constants/AlibabaOtsOperationsTest.java similarity index 71% rename from components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/constants/OTSOperationsTest.java rename to components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/constants/AlibabaOtsOperationsTest.java index 8fcdf1fe35be5..55edc402cfe11 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/constants/OTSOperationsTest.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/constants/AlibabaOtsOperationsTest.java @@ -20,14 +20,14 @@ import static org.assertj.core.api.Assertions.assertThat; -class OTSOperationsTest { +class AlibabaOtsOperationsTest { @Test void testOperations() { - assertThat(OTSOperations.PUT_ROW).isEqualTo("putRow"); - assertThat(OTSOperations.GET_ROW).isEqualTo("getRow"); - assertThat(OTSOperations.UPDATE_ROW).isEqualTo("updateRow"); - assertThat(OTSOperations.DELETE_ROW).isEqualTo("deleteRow"); - assertThat(OTSOperations.LIST_TABLES).isEqualTo("listTables"); + assertThat(AlibabaOtsOperations.PUT_ROW).isEqualTo("putRow"); + assertThat(AlibabaOtsOperations.GET_ROW).isEqualTo("getRow"); + assertThat(AlibabaOtsOperations.UPDATE_ROW).isEqualTo("updateRow"); + assertThat(AlibabaOtsOperations.DELETE_ROW).isEqualTo("deleteRow"); + assertThat(AlibabaOtsOperations.LIST_TABLES).isEqualTo("listTables"); } } diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSComponentConfigurer.java b/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/AlibabaSlsComponentConfigurer.java similarity index 91% rename from components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSComponentConfigurer.java rename to components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/AlibabaSlsComponentConfigurer.java index 9f0e7d236b2fb..93b14bd5e8795 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSComponentConfigurer.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/AlibabaSlsComponentConfigurer.java @@ -17,11 +17,11 @@ */ @Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo") @SuppressWarnings("unchecked") -public class SLSComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { +public class AlibabaSlsComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { @Override public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { - SLSComponent target = (SLSComponent) obj; + AlibabaSlsComponent target = (AlibabaSlsComponent) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "autowiredenabled": case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true; @@ -52,7 +52,7 @@ public Class getOptionType(String name, boolean ignoreCase) { @Override public Object getOptionValue(Object obj, String name, boolean ignoreCase) { - SLSComponent target = (SLSComponent) obj; + AlibabaSlsComponent target = (AlibabaSlsComponent) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "autowiredenabled": case "autowiredEnabled": return target.isAutowiredEnabled(); diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointConfigurer.java b/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpointConfigurer.java similarity index 95% rename from components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointConfigurer.java rename to components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpointConfigurer.java index 37b7eaf3bc950..b55eb6c3f47b2 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointConfigurer.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpointConfigurer.java @@ -17,11 +17,11 @@ */ @Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo") @SuppressWarnings("unchecked") -public class SLSEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { +public class AlibabaSlsEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { @Override public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { - SLSEndpoint target = (SLSEndpoint) obj; + AlibabaSlsEndpoint target = (AlibabaSlsEndpoint) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "accesskey": case "accessKey": target.setAccessKey(property(camelContext, java.lang.String.class, value)); return true; @@ -85,7 +85,7 @@ public Class getOptionType(String name, boolean ignoreCase) { @Override public Object getOptionValue(Object obj, String name, boolean ignoreCase) { - SLSEndpoint target = (SLSEndpoint) obj; + AlibabaSlsEndpoint target = (AlibabaSlsEndpoint) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "accesskey": case "accessKey": return target.getAccessKey(); diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointUriFactory.java b/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpointUriFactory.java similarity index 95% rename from components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointUriFactory.java rename to components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpointUriFactory.java index 28c82498a3d10..7840d24150d8b 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/SLSEndpointUriFactory.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpointUriFactory.java @@ -15,7 +15,7 @@ * Generated by camel build tools - do NOT edit this file! */ @Generated("org.apache.camel.maven.packaging.GenerateEndpointUriFactoryMojo") -public class SLSEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory { +public class AlibabaSlsEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory { private static final String BASE = ":operation"; diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json index 940a63a6242a7..b4da0b72d0261 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json @@ -7,7 +7,7 @@ "deprecated": false, "firstVersion": "4.23.0", "label": "cloud,monitoring", - "javaType": "org.apache.camel.component.alibaba.sls.SLSComponent", + "javaType": "org.apache.camel.component.alibaba.sls.AlibabaSlsComponent", "supportLevel": "Preview", "groupId": "org.apache.camel", "artifactId": "camel-alibaba-sls", @@ -30,21 +30,21 @@ "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } }, "headers": { - "CamelAlibabaSlsProject": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS project name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#PROJECT" }, - "CamelAlibabaSlsLogStoreName": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS log store name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LOG_STORE_NAME" }, - "CamelAlibabaSlsQuery": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query string override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#QUERY" }, - "CamelAlibabaSlsFrom": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query start time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#FROM" }, - "CamelAlibabaSlsTo": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query end time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TO" }, - "CamelAlibabaSlsLine": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Maximum number of log lines to return", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LINE" }, - "CamelAlibabaSlsOffset": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query offset", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#OFFSET" }, - "CamelAlibabaSlsTopic": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log topic filter override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TOPIC" }, - "CamelAlibabaSlsReverse": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether to return logs in reverse order", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#REVERSE" }, - "CamelAlibabaSlsLogstoreName": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log store name prefix filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LOGSTORE_NAME" }, - "CamelAlibabaSlsMode": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List mode for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#MODE" }, - "CamelAlibabaSlsSize": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Page size for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#SIZE" }, - "CamelAlibabaSlsTelemetryType": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Telemetry type filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TELEMETRY_TYPE" }, - "CamelAlibabaSlsRequestId": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud request id", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#REQUEST_ID" }, - "CamelAlibabaSlsStatusCode": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "HTTP status code from SLS response", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#STATUS_CODE" } + "CamelAlibabaSlsProject": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS project name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#PROJECT" }, + "CamelAlibabaSlsLogStoreName": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS log store name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#LOG_STORE_NAME" }, + "CamelAlibabaSlsQuery": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query string override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#QUERY" }, + "CamelAlibabaSlsFrom": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query start time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#FROM" }, + "CamelAlibabaSlsTo": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query end time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#TO" }, + "CamelAlibabaSlsLine": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Maximum number of log lines to return", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#LINE" }, + "CamelAlibabaSlsOffset": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query offset", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#OFFSET" }, + "CamelAlibabaSlsTopic": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log topic filter override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#TOPIC" }, + "CamelAlibabaSlsReverse": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether to return logs in reverse order", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#REVERSE" }, + "CamelAlibabaSlsLogstoreName": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log store name prefix filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#LOGSTORE_NAME" }, + "CamelAlibabaSlsMode": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List mode for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#MODE" }, + "CamelAlibabaSlsSize": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Page size for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#SIZE" }, + "CamelAlibabaSlsTelemetryType": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Telemetry type filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#TELEMETRY_TYPE" }, + "CamelAlibabaSlsRequestId": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud request id", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#REQUEST_ID" }, + "CamelAlibabaSlsStatusCode": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "HTTP status code from SLS response", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#STATUS_CODE" } }, "properties": { "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putLogs", "getLogs", "listLogStores" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-sls b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-sls index 1e4c99d9c5cc6..e8db4ae4bc60a 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-sls +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/component/alibaba-sls @@ -1,2 +1,2 @@ # Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.alibaba.sls.SLSComponent +class=org.apache.camel.component.alibaba.sls.AlibabaSlsComponent diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-component b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-component index d2b52268d9dd5..0d2a69c7af7d9 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-component +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-component @@ -1,2 +1,2 @@ # Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.alibaba.sls.SLSComponentConfigurer +class=org.apache.camel.component.alibaba.sls.AlibabaSlsComponentConfigurer diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-endpoint b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-endpoint index c1574849c73f2..2b8e7fe257f6b 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-endpoint +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/configurer/alibaba-sls-endpoint @@ -1,2 +1,2 @@ # Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.alibaba.sls.SLSEndpointConfigurer +class=org.apache.camel.component.alibaba.sls.AlibabaSlsEndpointConfigurer diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-sls-endpoint b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-sls-endpoint index 3a310ec42d8bc..9ae2d3a33cfdb 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-sls-endpoint +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/services/org/apache/camel/urifactory/alibaba-sls-endpoint @@ -1,2 +1,2 @@ # Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.alibaba.sls.SLSEndpointUriFactory +class=org.apache.camel.component.alibaba.sls.AlibabaSlsEndpointUriFactory diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSComponent.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsComponent.java similarity index 89% rename from components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSComponent.java rename to components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsComponent.java index 405e74af156a4..4534e8cb70c80 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSComponent.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsComponent.java @@ -23,11 +23,11 @@ import org.apache.camel.support.HealthCheckComponent; @Component("alibaba-sls") -public class SLSComponent extends HealthCheckComponent { +public class AlibabaSlsComponent extends HealthCheckComponent { @Override protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception { - SLSEndpoint endpoint = new SLSEndpoint(uri, remaining, this); + AlibabaSlsEndpoint endpoint = new AlibabaSlsEndpoint(uri, remaining, this); setProperties(endpoint, parameters); return endpoint; } diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSEndpoint.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpoint.java similarity index 94% rename from components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSEndpoint.java rename to components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpoint.java index 393da0c3cda1a..f1d0ea33791ad 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSEndpoint.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpoint.java @@ -22,7 +22,7 @@ import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.component.alibaba.common.models.ServiceKeys; -import org.apache.camel.component.alibaba.sls.constants.SLSHeaders; +import org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -34,8 +34,8 @@ */ @UriEndpoint(firstVersion = "4.23.0", scheme = "alibaba-sls", title = "Alibaba Simple Log Service (SLS)", syntax = "alibaba-sls:operation", category = { Category.CLOUD, Category.MONITORING }, - headersClass = SLSHeaders.class, producerOnly = true) -public class SLSEndpoint extends DefaultEndpoint { + headersClass = AlibabaSlsHeaders.class, producerOnly = true) +public class AlibabaSlsEndpoint extends DefaultEndpoint { @UriPath(description = "Operation to perform", displayName = "Operation", label = "producer", enums = "putLogs,getLogs,listLogStores") @@ -100,17 +100,17 @@ public class SLSEndpoint extends DefaultEndpoint { private boolean autowiredSlsClient; - public SLSEndpoint() { + public AlibabaSlsEndpoint() { } - public SLSEndpoint(String uri, String operation, SLSComponent component) { + public AlibabaSlsEndpoint(String uri, String operation, AlibabaSlsComponent component) { super(uri, component); this.operation = operation; } @Override public Producer createProducer() throws Exception { - return new SLSProducer(this); + return new AlibabaSlsProducer(this); } @Override @@ -122,7 +122,7 @@ public Client initClient() throws Exception { if (slsClient != null) { return slsClient; } - slsClient = SLSUtils.createClient(this); + slsClient = AlibabaSlsUtils.createClient(this); return slsClient; } diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSProducer.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsProducer.java similarity index 71% rename from components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSProducer.java rename to components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsProducer.java index 36159dc8ba6c4..c7b154a2d76c0 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSProducer.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsProducer.java @@ -26,22 +26,22 @@ import com.aliyun.sls20201230.models.PutLogsRequest; import com.aliyun.sls20201230.models.PutLogsResponse; import org.apache.camel.Exchange; -import org.apache.camel.component.alibaba.sls.constants.SLSHeaders; -import org.apache.camel.component.alibaba.sls.constants.SLSOperations; +import org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders; +import org.apache.camel.component.alibaba.sls.constants.AlibabaSlsOperations; import org.apache.camel.component.alibaba.sls.models.ClientConfigurations; import org.apache.camel.support.DefaultProducer; import org.apache.camel.util.ObjectHelper; -public class SLSProducer extends DefaultProducer { +public class AlibabaSlsProducer extends DefaultProducer { - public SLSProducer(SLSEndpoint endpoint) { + public AlibabaSlsProducer(AlibabaSlsEndpoint endpoint) { super(endpoint); } @Override public void process(Exchange exchange) throws Exception { - SLSEndpoint endpoint = getEndpoint(); - ClientConfigurations configuration = SLSUtils.createClientConfigurations(endpoint, exchange); + AlibabaSlsEndpoint endpoint = getEndpoint(); + ClientConfigurations configuration = AlibabaSlsUtils.createClientConfigurations(endpoint, exchange); if (ObjectHelper.isEmpty(configuration.getOperation())) { throw new IllegalArgumentException("Operation name not found"); @@ -50,9 +50,9 @@ public void process(Exchange exchange) throws Exception { Client slsClient = endpoint.initClient(); switch (configuration.getOperation()) { - case SLSOperations.PUT_LOGS -> putLogs(exchange, configuration, slsClient); - case SLSOperations.GET_LOGS -> getLogs(exchange, configuration, slsClient); - case SLSOperations.LIST_LOG_STORES -> listLogStores(exchange, configuration, slsClient); + case AlibabaSlsOperations.PUT_LOGS -> putLogs(exchange, configuration, slsClient); + case AlibabaSlsOperations.GET_LOGS -> getLogs(exchange, configuration, slsClient); + case AlibabaSlsOperations.LIST_LOG_STORES -> listLogStores(exchange, configuration, slsClient); default -> throw new UnsupportedOperationException("Unsupported operation: " + configuration.getOperation()); } } @@ -60,36 +60,36 @@ public void process(Exchange exchange) throws Exception { private void putLogs(Exchange exchange, ClientConfigurations configuration, Client slsClient) throws Exception { validateProjectAndLogStore(configuration); - PutLogsRequest request = SLSUtils.resolvePutLogsRequest(exchange); + PutLogsRequest request = AlibabaSlsUtils.resolvePutLogsRequest(exchange); PutLogsResponse response = slsClient.putLogs( configuration.getProject(), configuration.getLogStoreName(), request); - exchange.getMessage().setBody(SLSUtils.toPutLogsMap(response)); + exchange.getMessage().setBody(AlibabaSlsUtils.toPutLogsMap(response)); setResponseHeaders(exchange, response.getStatusCode(), response.getHeaders()); } private void getLogs(Exchange exchange, ClientConfigurations configuration, Client slsClient) throws Exception { validateProjectAndLogStore(configuration); - GetLogsRequest request = SLSUtils.buildGetLogsRequest(configuration); + GetLogsRequest request = AlibabaSlsUtils.buildGetLogsRequest(configuration); GetLogsResponse response = slsClient.getLogs( configuration.getProject(), configuration.getLogStoreName(), request); - exchange.getMessage().setBody(SLSUtils.toGetLogsMap(response)); + exchange.getMessage().setBody(AlibabaSlsUtils.toGetLogsMap(response)); setResponseHeaders(exchange, response.getStatusCode(), response.getHeaders()); } private void listLogStores(Exchange exchange, ClientConfigurations configuration, Client slsClient) throws Exception { validateProject(configuration); - ListLogStoresRequest request = SLSUtils.buildListLogStoresRequest(configuration); + ListLogStoresRequest request = AlibabaSlsUtils.buildListLogStoresRequest(configuration); ListLogStoresResponse response = slsClient.listLogStores(configuration.getProject(), request); - exchange.getMessage().setBody(SLSUtils.toListLogStoresMap(response)); + exchange.getMessage().setBody(AlibabaSlsUtils.toListLogStoresMap(response)); setResponseHeaders(exchange, response.getStatusCode(), response.getHeaders()); } @@ -107,16 +107,16 @@ private void validateProject(ClientConfigurations configuration) { private void setResponseHeaders(Exchange exchange, Integer statusCode, Map headers) { if (statusCode != null) { - exchange.getMessage().setHeader(SLSHeaders.STATUS_CODE, statusCode); + exchange.getMessage().setHeader(AlibabaSlsHeaders.STATUS_CODE, statusCode); } - String requestId = SLSUtils.extractRequestId(headers); + String requestId = AlibabaSlsUtils.extractRequestId(headers); if (ObjectHelper.isNotEmpty(requestId)) { - exchange.getMessage().setHeader(SLSHeaders.REQUEST_ID, requestId); + exchange.getMessage().setHeader(AlibabaSlsHeaders.REQUEST_ID, requestId); } } @Override - public SLSEndpoint getEndpoint() { - return (SLSEndpoint) super.getEndpoint(); + public AlibabaSlsEndpoint getEndpoint() { + return (AlibabaSlsEndpoint) super.getEndpoint(); } } diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSUtils.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsUtils.java similarity index 83% rename from components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSUtils.java rename to components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsUtils.java index 6dbbf1081be01..27bc2dd07a2ba 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/SLSUtils.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsUtils.java @@ -32,16 +32,16 @@ import org.apache.camel.Exchange; import org.apache.camel.component.alibaba.common.OpenApiClientSupport; import org.apache.camel.component.alibaba.common.models.ServiceKeys; -import org.apache.camel.component.alibaba.sls.constants.SLSProperties; +import org.apache.camel.component.alibaba.sls.constants.AlibabaSlsProperties; import org.apache.camel.component.alibaba.sls.models.ClientConfigurations; import org.apache.camel.util.ObjectHelper; -public final class SLSUtils { +public final class AlibabaSlsUtils { - private SLSUtils() { + private AlibabaSlsUtils() { } - public static Client createClient(SLSEndpoint endpoint) throws Exception { + public static Client createClient(AlibabaSlsEndpoint endpoint) throws Exception { if (ObjectHelper.isEmpty(endpoint.getRegion()) && ObjectHelper.isEmpty(endpoint.getEndpoint())) { throw new IllegalArgumentException("Region or endpoint is required"); } @@ -69,28 +69,29 @@ private static Config createTeaConfig( return config; } - public static ClientConfigurations createClientConfigurations(SLSEndpoint endpoint, Exchange exchange) { + public static ClientConfigurations createClientConfigurations(AlibabaSlsEndpoint endpoint, Exchange exchange) { ClientConfigurations configuration = new ClientConfigurations(); configuration - .setOperation(OpenApiClientSupport.resolveString(exchange, SLSProperties.OPERATION, endpoint.getOperation())); + .setOperation( + OpenApiClientSupport.resolveString(exchange, AlibabaSlsProperties.OPERATION, endpoint.getOperation())); configuration.setProject( - OpenApiClientSupport.resolveString(exchange, SLSProperties.PROJECT, endpoint.getProject())); + OpenApiClientSupport.resolveString(exchange, AlibabaSlsProperties.PROJECT, endpoint.getProject())); configuration.setLogStoreName( - OpenApiClientSupport.resolveString(exchange, SLSProperties.LOG_STORE_NAME, endpoint.getLogStoreName())); - configuration.setQuery(OpenApiClientSupport.resolveString(exchange, SLSProperties.QUERY, endpoint.getQuery())); - configuration.setFrom(OpenApiClientSupport.resolveInteger(exchange, SLSProperties.FROM, endpoint.getFrom())); - configuration.setTo(OpenApiClientSupport.resolveInteger(exchange, SLSProperties.TO, endpoint.getTo())); - configuration.setLine(resolveLong(exchange, SLSProperties.LINE, endpoint.getLine())); - configuration.setOffset(resolveLong(exchange, SLSProperties.OFFSET, endpoint.getOffset())); - configuration.setTopic(OpenApiClientSupport.resolveString(exchange, SLSProperties.TOPIC, endpoint.getTopic())); - configuration.setReverse(resolveBoolean(exchange, SLSProperties.REVERSE, endpoint.getReverse())); + OpenApiClientSupport.resolveString(exchange, AlibabaSlsProperties.LOG_STORE_NAME, endpoint.getLogStoreName())); + configuration.setQuery(OpenApiClientSupport.resolveString(exchange, AlibabaSlsProperties.QUERY, endpoint.getQuery())); + configuration.setFrom(OpenApiClientSupport.resolveInteger(exchange, AlibabaSlsProperties.FROM, endpoint.getFrom())); + configuration.setTo(OpenApiClientSupport.resolveInteger(exchange, AlibabaSlsProperties.TO, endpoint.getTo())); + configuration.setLine(resolveLong(exchange, AlibabaSlsProperties.LINE, endpoint.getLine())); + configuration.setOffset(resolveLong(exchange, AlibabaSlsProperties.OFFSET, endpoint.getOffset())); + configuration.setTopic(OpenApiClientSupport.resolveString(exchange, AlibabaSlsProperties.TOPIC, endpoint.getTopic())); + configuration.setReverse(resolveBoolean(exchange, AlibabaSlsProperties.REVERSE, endpoint.getReverse())); configuration.setLogstoreName( - OpenApiClientSupport.resolveString(exchange, SLSProperties.LOGSTORE_NAME, null)); - configuration.setMode(OpenApiClientSupport.resolveString(exchange, SLSProperties.MODE, null)); - configuration.setListOffset(OpenApiClientSupport.resolveInteger(exchange, SLSProperties.OFFSET, null)); - configuration.setSize(OpenApiClientSupport.resolveInteger(exchange, SLSProperties.SIZE, null)); + OpenApiClientSupport.resolveString(exchange, AlibabaSlsProperties.LOGSTORE_NAME, null)); + configuration.setMode(OpenApiClientSupport.resolveString(exchange, AlibabaSlsProperties.MODE, null)); + configuration.setListOffset(OpenApiClientSupport.resolveInteger(exchange, AlibabaSlsProperties.OFFSET, null)); + configuration.setSize(OpenApiClientSupport.resolveInteger(exchange, AlibabaSlsProperties.SIZE, null)); configuration.setTelemetryType( - OpenApiClientSupport.resolveString(exchange, SLSProperties.TELEMETRY_TYPE, null)); + OpenApiClientSupport.resolveString(exchange, AlibabaSlsProperties.TELEMETRY_TYPE, null)); return configuration; } diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSHeaders.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsHeaders.java similarity index 70% rename from components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSHeaders.java rename to components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsHeaders.java index dfe149d724402..d802addf53156 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSHeaders.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsHeaders.java @@ -18,53 +18,53 @@ import org.apache.camel.spi.Metadata; -public final class SLSHeaders { +public final class AlibabaSlsHeaders { @Metadata(label = "producer", description = "SLS project name override", javaType = "String") - public static final String PROJECT = SLSProperties.PROJECT; + public static final String PROJECT = AlibabaSlsProperties.PROJECT; @Metadata(label = "producer", description = "SLS log store name override", javaType = "String") - public static final String LOG_STORE_NAME = SLSProperties.LOG_STORE_NAME; + public static final String LOG_STORE_NAME = AlibabaSlsProperties.LOG_STORE_NAME; @Metadata(label = "producer", description = "Log query string override", javaType = "String") - public static final String QUERY = SLSProperties.QUERY; + public static final String QUERY = AlibabaSlsProperties.QUERY; @Metadata(label = "producer", description = "Query start time override (Unix timestamp in seconds)", javaType = "Integer") - public static final String FROM = SLSProperties.FROM; + public static final String FROM = AlibabaSlsProperties.FROM; @Metadata(label = "producer", description = "Query end time override (Unix timestamp in seconds)", javaType = "Integer") - public static final String TO = SLSProperties.TO; + public static final String TO = AlibabaSlsProperties.TO; @Metadata(label = "producer", description = "Maximum number of log lines to return", javaType = "Long") - public static final String LINE = SLSProperties.LINE; + public static final String LINE = AlibabaSlsProperties.LINE; @Metadata(label = "producer", description = "Log query offset", javaType = "Long") - public static final String OFFSET = SLSProperties.OFFSET; + public static final String OFFSET = AlibabaSlsProperties.OFFSET; @Metadata(label = "producer", description = "Log topic filter override", javaType = "String") - public static final String TOPIC = SLSProperties.TOPIC; + public static final String TOPIC = AlibabaSlsProperties.TOPIC; @Metadata(label = "producer", description = "Whether to return logs in reverse order", javaType = "Boolean") - public static final String REVERSE = SLSProperties.REVERSE; + public static final String REVERSE = AlibabaSlsProperties.REVERSE; @Metadata(label = "producer", description = "Log store name prefix filter for listLogStores", javaType = "String") - public static final String LOGSTORE_NAME = SLSProperties.LOGSTORE_NAME; + public static final String LOGSTORE_NAME = AlibabaSlsProperties.LOGSTORE_NAME; @Metadata(label = "producer", description = "List mode for listLogStores", javaType = "String") - public static final String MODE = SLSProperties.MODE; + public static final String MODE = AlibabaSlsProperties.MODE; @Metadata(label = "producer", description = "Page size for listLogStores", javaType = "Integer") - public static final String SIZE = SLSProperties.SIZE; + public static final String SIZE = AlibabaSlsProperties.SIZE; @Metadata(label = "producer", description = "Telemetry type filter for listLogStores", javaType = "String") - public static final String TELEMETRY_TYPE = SLSProperties.TELEMETRY_TYPE; + public static final String TELEMETRY_TYPE = AlibabaSlsProperties.TELEMETRY_TYPE; @Metadata(label = "producer", description = "Alibaba Cloud request id", javaType = "String") - public static final String REQUEST_ID = SLSProperties.REQUEST_ID; + public static final String REQUEST_ID = AlibabaSlsProperties.REQUEST_ID; @Metadata(label = "producer", description = "HTTP status code from SLS response", javaType = "Integer") public static final String STATUS_CODE = "CamelAlibabaSlsStatusCode"; - private SLSHeaders() { + private AlibabaSlsHeaders() { } } diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSOperations.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsOperations.java similarity index 92% rename from components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSOperations.java rename to components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsOperations.java index 312f81bbb4eee..9db9e0697005c 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSOperations.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsOperations.java @@ -16,12 +16,12 @@ */ package org.apache.camel.component.alibaba.sls.constants; -public final class SLSOperations { +public final class AlibabaSlsOperations { public static final String PUT_LOGS = "putLogs"; public static final String GET_LOGS = "getLogs"; public static final String LIST_LOG_STORES = "listLogStores"; - private SLSOperations() { + private AlibabaSlsOperations() { } } diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSProperties.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsProperties.java similarity index 97% rename from components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSProperties.java rename to components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsProperties.java index 47c673ca7db95..278f8306fb341 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/SLSProperties.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsProperties.java @@ -18,7 +18,7 @@ import org.apache.camel.spi.Metadata; -public final class SLSProperties { +public final class AlibabaSlsProperties { @Metadata(label = "producer", description = "Operation to perform", javaType = "String") public static final String OPERATION = "CamelAlibabaSlsOperation"; @@ -65,6 +65,6 @@ public final class SLSProperties { @Metadata(label = "producer", description = "Request id returned by SLS", javaType = "String") public static final String REQUEST_ID = "CamelAlibabaSlsRequestId"; - private SLSProperties() { + private AlibabaSlsProperties() { } } diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSEndpointTest.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpointTest.java similarity index 83% rename from components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSEndpointTest.java rename to components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpointTest.java index 9038ecdc1d7f0..09a60440f3dbd 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSEndpointTest.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpointTest.java @@ -22,11 +22,11 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; -class SLSEndpointTest { +class AlibabaSlsEndpointTest { @Test void doStopKeepsAutowiredClient() throws Exception { - SLSEndpoint endpoint = new SLSEndpoint(); + AlibabaSlsEndpoint endpoint = new AlibabaSlsEndpoint(); Client client = mock(Client.class); endpoint.setSlsClient(client); @@ -37,14 +37,14 @@ void doStopKeepsAutowiredClient() throws Exception { @Test void doStopClearsOwnedClient() throws Exception { - SLSEndpoint endpoint = new SLSEndpoint(); + AlibabaSlsEndpoint endpoint = new AlibabaSlsEndpoint(); Client client = mock(Client.class); - var clientField = SLSEndpoint.class.getDeclaredField("slsClient"); + var clientField = AlibabaSlsEndpoint.class.getDeclaredField("slsClient"); clientField.setAccessible(true); clientField.set(endpoint, client); - var autowiredField = SLSEndpoint.class.getDeclaredField("autowiredSlsClient"); + var autowiredField = AlibabaSlsEndpoint.class.getDeclaredField("autowiredSlsClient"); autowiredField.setAccessible(true); autowiredField.setBoolean(endpoint, false); diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSProducerTest.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/AlibabaSlsProducerTest.java similarity index 92% rename from components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSProducerTest.java rename to components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/AlibabaSlsProducerTest.java index 33c2d36b513c2..16df06c057baa 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/SLSProducerTest.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/AlibabaSlsProducerTest.java @@ -29,11 +29,11 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -class SLSProducerTest extends CamelTestSupport { +class AlibabaSlsProducerTest extends CamelTestSupport { @Test void processReinitializesClientFromEndpointOnEachExchange() throws Exception { - SLSEndpoint endpoint = mock(SLSEndpoint.class); + AlibabaSlsEndpoint endpoint = mock(AlibabaSlsEndpoint.class); when(endpoint.getOperation()).thenReturn("listLogStores"); when(endpoint.getProject()).thenReturn("demo-project"); when(endpoint.getCamelContext()).thenReturn(context); @@ -46,7 +46,7 @@ void processReinitializesClientFromEndpointOnEachExchange() throws Exception { when(firstClient.listLogStores(eq("demo-project"), any(ListLogStoresRequest.class))).thenReturn(response); when(secondClient.listLogStores(eq("demo-project"), any(ListLogStoresRequest.class))).thenReturn(response); - SLSProducer producer = new SLSProducer(endpoint); + AlibabaSlsProducer producer = new AlibabaSlsProducer(endpoint); producer.process(new DefaultExchange(context)); producer.process(new DefaultExchange(context)); diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/GetLogsTest.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/GetLogsTest.java index 9c04615e95a92..c9d2e8d30ece4 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/GetLogsTest.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/GetLogsTest.java @@ -26,7 +26,7 @@ import org.apache.camel.BindToRegistry; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.alibaba.sls.constants.SLSHeaders; +import org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.test.junit6.CamelTestSupport; import org.junit.jupiter.api.Test; @@ -91,8 +91,8 @@ void testGetLogs() throws Exception { assertThat(exchange.getMessage().getBody(Map.class)) .containsEntry("statusCode", 200) .containsEntry("body", List.of(Map.of("message", "log line"))); - assertThat(exchange.getMessage().getHeader(SLSHeaders.STATUS_CODE)).isEqualTo(200); - assertThat(exchange.getMessage().getHeader(SLSHeaders.REQUEST_ID)).isEqualTo("req-456"); + assertThat(exchange.getMessage().getHeader(AlibabaSlsHeaders.STATUS_CODE)).isEqualTo(200); + assertThat(exchange.getMessage().getHeader(AlibabaSlsHeaders.REQUEST_ID)).isEqualTo("req-456"); verify(slsClient).getLogs( eq(testConfiguration.getProperty("project")), diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/ListLogStoresTest.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/ListLogStoresTest.java index 8be8844f71fa8..aab77404044fa 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/ListLogStoresTest.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/ListLogStoresTest.java @@ -27,7 +27,7 @@ import org.apache.camel.BindToRegistry; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.alibaba.sls.constants.SLSHeaders; +import org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.test.junit6.CamelTestSupport; import org.junit.jupiter.api.Test; @@ -91,8 +91,8 @@ void testListLogStores() throws Exception { .containsEntry("count", 2) .containsEntry("total", 2) .containsEntry("logstores", List.of("logstore-a", "logstore-b")); - assertThat(exchange.getMessage().getHeader(SLSHeaders.STATUS_CODE)).isEqualTo(200); - assertThat(exchange.getMessage().getHeader(SLSHeaders.REQUEST_ID)).isEqualTo("req-789"); + assertThat(exchange.getMessage().getHeader(AlibabaSlsHeaders.STATUS_CODE)).isEqualTo(200); + assertThat(exchange.getMessage().getHeader(AlibabaSlsHeaders.REQUEST_ID)).isEqualTo("req-789"); verify(slsClient).listLogStores( eq(testConfiguration.getProperty("project")), diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/PutLogsTest.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/PutLogsTest.java index cfca7db79f15b..4929ca6826049 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/PutLogsTest.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/PutLogsTest.java @@ -29,7 +29,7 @@ import org.apache.camel.BindToRegistry; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.alibaba.sls.constants.SLSHeaders; +import org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.test.junit6.CamelTestSupport; import org.junit.jupiter.api.Test; @@ -93,8 +93,8 @@ void testPutLogsWithLogGroup() throws Exception { Exchange exchange = mock.getExchanges().get(0); assertThat(exchange.getMessage().getBody(Map.class)) .containsEntry("statusCode", 200); - assertThat(exchange.getMessage().getHeader(SLSHeaders.STATUS_CODE)).isEqualTo(200); - assertThat(exchange.getMessage().getHeader(SLSHeaders.REQUEST_ID)).isEqualTo("req-123"); + assertThat(exchange.getMessage().getHeader(AlibabaSlsHeaders.STATUS_CODE)).isEqualTo(200); + assertThat(exchange.getMessage().getHeader(AlibabaSlsHeaders.REQUEST_ID)).isEqualTo("req-123"); verify(slsClient).putLogs( eq(testConfiguration.getProperty("project")), diff --git a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/constants/SLSOperationsTest.java b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsOperationsTest.java similarity index 79% rename from components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/constants/SLSOperationsTest.java rename to components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsOperationsTest.java index 87f96c087388d..c6d60d68065f8 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/constants/SLSOperationsTest.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/test/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsOperationsTest.java @@ -20,12 +20,12 @@ import static org.assertj.core.api.Assertions.assertThat; -class SLSOperationsTest { +class AlibabaSlsOperationsTest { @Test void testOperationNames() { - assertThat(SLSOperations.PUT_LOGS).isEqualTo("putLogs"); - assertThat(SLSOperations.GET_LOGS).isEqualTo("getLogs"); - assertThat(SLSOperations.LIST_LOG_STORES).isEqualTo("listLogStores"); + assertThat(AlibabaSlsOperations.PUT_LOGS).isEqualTo("putLogs"); + assertThat(AlibabaSlsOperations.GET_LOGS).isEqualTo("getLogs"); + assertThat(AlibabaSlsOperations.LIST_LOG_STORES).isEqualTo("listLogStores"); } } diff --git a/docs/components/modules/ROOT/examples/json/alibaba-ots.json b/docs/components/modules/ROOT/examples/json/alibaba-ots.json index 442b35c56bb3f..4942723cda505 100644 --- a/docs/components/modules/ROOT/examples/json/alibaba-ots.json +++ b/docs/components/modules/ROOT/examples/json/alibaba-ots.json @@ -7,7 +7,7 @@ "deprecated": false, "firstVersion": "4.23.0", "label": "cloud,database", - "javaType": "org.apache.camel.component.alibaba.ots.OTSComponent", + "javaType": "org.apache.camel.component.alibaba.ots.AlibabaOtsComponent", "supportLevel": "Preview", "groupId": "org.apache.camel", "artifactId": "camel-alibaba-ots", @@ -30,8 +30,8 @@ "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } }, "headers": { - "CamelAlibabaOtsOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation override", "constantName": "org.apache.camel.component.alibaba.ots.constants.OTSHeaders#OPERATION" }, - "CamelAlibabaOtsRequestId": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore request id", "constantName": "org.apache.camel.component.alibaba.ots.constants.OTSHeaders#REQUEST_ID" } + "CamelAlibabaOtsOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation override", "constantName": "org.apache.camel.component.alibaba.ots.constants.AlibabaOtsHeaders#OPERATION" }, + "CamelAlibabaOtsRequestId": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore request id", "constantName": "org.apache.camel.component.alibaba.ots.constants.AlibabaOtsHeaders#REQUEST_ID" } }, "properties": { "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putRow", "getRow", "updateRow", "deleteRow", "listTables" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, diff --git a/docs/components/modules/ROOT/examples/json/alibaba-sls.json b/docs/components/modules/ROOT/examples/json/alibaba-sls.json index 940a63a6242a7..b4da0b72d0261 100644 --- a/docs/components/modules/ROOT/examples/json/alibaba-sls.json +++ b/docs/components/modules/ROOT/examples/json/alibaba-sls.json @@ -7,7 +7,7 @@ "deprecated": false, "firstVersion": "4.23.0", "label": "cloud,monitoring", - "javaType": "org.apache.camel.component.alibaba.sls.SLSComponent", + "javaType": "org.apache.camel.component.alibaba.sls.AlibabaSlsComponent", "supportLevel": "Preview", "groupId": "org.apache.camel", "artifactId": "camel-alibaba-sls", @@ -30,21 +30,21 @@ "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } }, "headers": { - "CamelAlibabaSlsProject": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS project name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#PROJECT" }, - "CamelAlibabaSlsLogStoreName": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS log store name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LOG_STORE_NAME" }, - "CamelAlibabaSlsQuery": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query string override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#QUERY" }, - "CamelAlibabaSlsFrom": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query start time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#FROM" }, - "CamelAlibabaSlsTo": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query end time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TO" }, - "CamelAlibabaSlsLine": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Maximum number of log lines to return", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LINE" }, - "CamelAlibabaSlsOffset": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query offset", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#OFFSET" }, - "CamelAlibabaSlsTopic": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log topic filter override", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TOPIC" }, - "CamelAlibabaSlsReverse": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether to return logs in reverse order", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#REVERSE" }, - "CamelAlibabaSlsLogstoreName": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log store name prefix filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#LOGSTORE_NAME" }, - "CamelAlibabaSlsMode": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List mode for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#MODE" }, - "CamelAlibabaSlsSize": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Page size for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#SIZE" }, - "CamelAlibabaSlsTelemetryType": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Telemetry type filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#TELEMETRY_TYPE" }, - "CamelAlibabaSlsRequestId": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud request id", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#REQUEST_ID" }, - "CamelAlibabaSlsStatusCode": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "HTTP status code from SLS response", "constantName": "org.apache.camel.component.alibaba.sls.constants.SLSHeaders#STATUS_CODE" } + "CamelAlibabaSlsProject": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS project name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#PROJECT" }, + "CamelAlibabaSlsLogStoreName": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS log store name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#LOG_STORE_NAME" }, + "CamelAlibabaSlsQuery": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query string override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#QUERY" }, + "CamelAlibabaSlsFrom": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query start time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#FROM" }, + "CamelAlibabaSlsTo": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query end time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#TO" }, + "CamelAlibabaSlsLine": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Maximum number of log lines to return", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#LINE" }, + "CamelAlibabaSlsOffset": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query offset", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#OFFSET" }, + "CamelAlibabaSlsTopic": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log topic filter override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#TOPIC" }, + "CamelAlibabaSlsReverse": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether to return logs in reverse order", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#REVERSE" }, + "CamelAlibabaSlsLogstoreName": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log store name prefix filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#LOGSTORE_NAME" }, + "CamelAlibabaSlsMode": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List mode for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#MODE" }, + "CamelAlibabaSlsSize": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Page size for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#SIZE" }, + "CamelAlibabaSlsTelemetryType": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Telemetry type filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#TELEMETRY_TYPE" }, + "CamelAlibabaSlsRequestId": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud request id", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#REQUEST_ID" }, + "CamelAlibabaSlsStatusCode": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "HTTP status code from SLS response", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#STATUS_CODE" } }, "properties": { "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putLogs", "getLogs", "listLogStores" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaOtsComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaOtsComponentBuilderFactory.java index 4f7934ebcf680..6bc2d4b848a91 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaOtsComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaOtsComponentBuilderFactory.java @@ -21,7 +21,7 @@ import org.apache.camel.Component; import org.apache.camel.builder.component.AbstractComponentBuilder; import org.apache.camel.builder.component.ComponentBuilder; -import org.apache.camel.component.alibaba.ots.OTSComponent; +import org.apache.camel.component.alibaba.ots.AlibabaOtsComponent; /** * Perform row operations on Alibaba Cloud Tablestore (OTS). @@ -48,7 +48,7 @@ static AlibabaOtsComponentBuilder alibabaOts() { /** * Builder for the Alibaba Tablestore (OTS) component. */ - interface AlibabaOtsComponentBuilder extends ComponentBuilder { + interface AlibabaOtsComponentBuilder extends ComponentBuilder { /** @@ -137,11 +137,11 @@ default AlibabaOtsComponentBuilder healthCheckProducerEnabled(boolean healthChec } class AlibabaOtsComponentBuilderImpl - extends AbstractComponentBuilder + extends AbstractComponentBuilder implements AlibabaOtsComponentBuilder { @Override - protected OTSComponent buildConcreteComponent() { - return new OTSComponent(); + protected AlibabaOtsComponent buildConcreteComponent() { + return new AlibabaOtsComponent(); } @Override protected boolean setPropertyOnComponent( @@ -149,10 +149,10 @@ protected boolean setPropertyOnComponent( String name, Object value) { switch (name) { - case "lazyStartProducer": ((OTSComponent) component).setLazyStartProducer((boolean) value); return true; - case "autowiredEnabled": ((OTSComponent) component).setAutowiredEnabled((boolean) value); return true; - case "healthCheckConsumerEnabled": ((OTSComponent) component).setHealthCheckConsumerEnabled((boolean) value); return true; - case "healthCheckProducerEnabled": ((OTSComponent) component).setHealthCheckProducerEnabled((boolean) value); return true; + case "lazyStartProducer": ((AlibabaOtsComponent) component).setLazyStartProducer((boolean) value); return true; + case "autowiredEnabled": ((AlibabaOtsComponent) component).setAutowiredEnabled((boolean) value); return true; + case "healthCheckConsumerEnabled": ((AlibabaOtsComponent) component).setHealthCheckConsumerEnabled((boolean) value); return true; + case "healthCheckProducerEnabled": ((AlibabaOtsComponent) component).setHealthCheckProducerEnabled((boolean) value); return true; default: return false; } } diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaSlsComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaSlsComponentBuilderFactory.java index 270504cab1860..ebaa93021f064 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaSlsComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AlibabaSlsComponentBuilderFactory.java @@ -21,7 +21,7 @@ import org.apache.camel.Component; import org.apache.camel.builder.component.AbstractComponentBuilder; import org.apache.camel.builder.component.ComponentBuilder; -import org.apache.camel.component.alibaba.sls.SLSComponent; +import org.apache.camel.component.alibaba.sls.AlibabaSlsComponent; /** * Manage logs on Alibaba Cloud Simple Log Service (SLS). @@ -48,7 +48,7 @@ static AlibabaSlsComponentBuilder alibabaSls() { /** * Builder for the Alibaba Simple Log Service (SLS) component. */ - interface AlibabaSlsComponentBuilder extends ComponentBuilder { + interface AlibabaSlsComponentBuilder extends ComponentBuilder { /** @@ -137,11 +137,11 @@ default AlibabaSlsComponentBuilder healthCheckProducerEnabled(boolean healthChec } class AlibabaSlsComponentBuilderImpl - extends AbstractComponentBuilder + extends AbstractComponentBuilder implements AlibabaSlsComponentBuilder { @Override - protected SLSComponent buildConcreteComponent() { - return new SLSComponent(); + protected AlibabaSlsComponent buildConcreteComponent() { + return new AlibabaSlsComponent(); } @Override protected boolean setPropertyOnComponent( @@ -149,10 +149,10 @@ protected boolean setPropertyOnComponent( String name, Object value) { switch (name) { - case "lazyStartProducer": ((SLSComponent) component).setLazyStartProducer((boolean) value); return true; - case "autowiredEnabled": ((SLSComponent) component).setAutowiredEnabled((boolean) value); return true; - case "healthCheckConsumerEnabled": ((SLSComponent) component).setHealthCheckConsumerEnabled((boolean) value); return true; - case "healthCheckProducerEnabled": ((SLSComponent) component).setHealthCheckProducerEnabled((boolean) value); return true; + case "lazyStartProducer": ((AlibabaSlsComponent) component).setLazyStartProducer((boolean) value); return true; + case "autowiredEnabled": ((AlibabaSlsComponent) component).setAutowiredEnabled((boolean) value); return true; + case "healthCheckConsumerEnabled": ((AlibabaSlsComponent) component).setHealthCheckConsumerEnabled((boolean) value); return true; + case "healthCheckProducerEnabled": ((AlibabaSlsComponent) component).setHealthCheckProducerEnabled((boolean) value); return true; default: return false; } } diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java index cde0f1545c82d..4a9a1dc834244 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java @@ -39,6 +39,8 @@ public interface EndpointBuilderFactory org.apache.camel.builder.endpoint.dsl.ActiveMQEndpointBuilderFactory.ActiveMQBuilders, org.apache.camel.builder.endpoint.dsl.AiToolEndpointBuilderFactory.AiToolBuilders, org.apache.camel.builder.endpoint.dsl.AlibabaEventBridgeEndpointBuilderFactory.AlibabaEventBridgeBuilders, + org.apache.camel.builder.endpoint.dsl.AlibabaOtsEndpointBuilderFactory.AlibabaOtsBuilders, + org.apache.camel.builder.endpoint.dsl.AlibabaSlsEndpointBuilderFactory.AlibabaSlsBuilders, org.apache.camel.builder.endpoint.dsl.ArangoDbEndpointBuilderFactory.ArangoDbBuilders, org.apache.camel.builder.endpoint.dsl.AsteriskEndpointBuilderFactory.AsteriskBuilders, org.apache.camel.builder.endpoint.dsl.Athena2EndpointBuilderFactory.Athena2Builders, @@ -287,7 +289,6 @@ public interface EndpointBuilderFactory org.apache.camel.builder.endpoint.dsl.OAIPMHEndpointBuilderFactory.OAIPMHBuilders, org.apache.camel.builder.endpoint.dsl.OBSEndpointBuilderFactory.OBSBuilders, org.apache.camel.builder.endpoint.dsl.OSSEndpointBuilderFactory.OSSBuilders, - org.apache.camel.builder.endpoint.dsl.OTSEndpointBuilderFactory.OTSBuilders, org.apache.camel.builder.endpoint.dsl.Olingo2EndpointBuilderFactory.Olingo2Builders, org.apache.camel.builder.endpoint.dsl.Olingo4EndpointBuilderFactory.Olingo4Builders, org.apache.camel.builder.endpoint.dsl.OnceEndpointBuilderFactory.OnceBuilders, @@ -328,7 +329,6 @@ public interface EndpointBuilderFactory org.apache.camel.builder.endpoint.dsl.RobotFrameworkEndpointBuilderFactory.RobotFrameworkBuilders, org.apache.camel.builder.endpoint.dsl.RocketMQEndpointBuilderFactory.RocketMQBuilders, org.apache.camel.builder.endpoint.dsl.RssEndpointBuilderFactory.RssBuilders, - org.apache.camel.builder.endpoint.dsl.SLSEndpointBuilderFactory.SLSBuilders, org.apache.camel.builder.endpoint.dsl.SMSEndpointBuilderFactory.SMSBuilders, org.apache.camel.builder.endpoint.dsl.STS2EndpointBuilderFactory.STS2Builders, org.apache.camel.builder.endpoint.dsl.SagaEndpointBuilderFactory.SagaBuilders, diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java index b9769334d6807..7df3e98d43845 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java @@ -36,6 +36,8 @@ public interface EndpointBuilders org.apache.camel.builder.endpoint.dsl.ActiveMQEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.AiToolEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.AlibabaEventBridgeEndpointBuilderFactory, + org.apache.camel.builder.endpoint.dsl.AlibabaOtsEndpointBuilderFactory, + org.apache.camel.builder.endpoint.dsl.AlibabaSlsEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.ArangoDbEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.AsteriskEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.Athena2EndpointBuilderFactory, @@ -284,7 +286,6 @@ public interface EndpointBuilders org.apache.camel.builder.endpoint.dsl.OAIPMHEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.OBSEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.OSSEndpointBuilderFactory, - org.apache.camel.builder.endpoint.dsl.OTSEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.Olingo2EndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.Olingo4EndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.OnceEndpointBuilderFactory, @@ -325,7 +326,6 @@ public interface EndpointBuilders org.apache.camel.builder.endpoint.dsl.RobotFrameworkEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.RocketMQEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.RssEndpointBuilderFactory, - org.apache.camel.builder.endpoint.dsl.SLSEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.SMSEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.STS2EndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.SagaEndpointBuilderFactory, 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 3f880c3c89213..0816f4b65053c 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 @@ -155,8 +155,8 @@ public static OSSEndpointBuilderFactory.OSSHeaderNameBuilder alibabaOss() { * * @return the dsl builder for the headers' name. */ - public static OTSEndpointBuilderFactory.OTSHeaderNameBuilder alibabaOts() { - return OTSEndpointBuilderFactory.OTSHeaderNameBuilder.INSTANCE; + public static AlibabaOtsEndpointBuilderFactory.AlibabaOtsHeaderNameBuilder alibabaOts() { + return AlibabaOtsEndpointBuilderFactory.AlibabaOtsHeaderNameBuilder.INSTANCE; } /** * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) @@ -168,8 +168,8 @@ public static OTSEndpointBuilderFactory.OTSHeaderNameBuilder alibabaOts() { * * @return the dsl builder for the headers' name. */ - public static SLSEndpointBuilderFactory.SLSHeaderNameBuilder alibabaSls() { - return SLSEndpointBuilderFactory.SLSHeaderNameBuilder.INSTANCE; + public static AlibabaSlsEndpointBuilderFactory.AlibabaSlsHeaderNameBuilder alibabaSls() { + return AlibabaSlsEndpointBuilderFactory.AlibabaSlsHeaderNameBuilder.INSTANCE; } /** * Alibaba Short Message Service (SMS) (camel-alibaba-sms) 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 e8b43e8a00e98..fdbd3d03db9e4 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 @@ -448,7 +448,7 @@ public static OSSEndpointBuilderFactory.OSSEndpointBuilder alibabaOss(String com * @param path operation * @return the dsl builder */ - public static OTSEndpointBuilderFactory.OTSEndpointBuilder alibabaOts(String path) { + public static AlibabaOtsEndpointBuilderFactory.AlibabaOtsEndpointBuilder alibabaOts(String path) { return alibabaOts("alibaba-ots", path); } /** @@ -471,8 +471,8 @@ public static OTSEndpointBuilderFactory.OTSEndpointBuilder alibabaOts(String pat * @param path operation * @return the dsl builder */ - public static OTSEndpointBuilderFactory.OTSEndpointBuilder alibabaOts(String componentName, String path) { - return OTSEndpointBuilderFactory.endpointBuilder(componentName, path); + public static AlibabaOtsEndpointBuilderFactory.AlibabaOtsEndpointBuilder alibabaOts(String componentName, String path) { + return AlibabaOtsEndpointBuilderFactory.endpointBuilder(componentName, path); } /** * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) @@ -492,7 +492,7 @@ public static OTSEndpointBuilderFactory.OTSEndpointBuilder alibabaOts(String com * @param path operation * @return the dsl builder */ - public static SLSEndpointBuilderFactory.SLSEndpointBuilder alibabaSls(String path) { + public static AlibabaSlsEndpointBuilderFactory.AlibabaSlsEndpointBuilder alibabaSls(String path) { return alibabaSls("alibaba-sls", path); } /** @@ -515,8 +515,8 @@ public static SLSEndpointBuilderFactory.SLSEndpointBuilder alibabaSls(String pat * @param path operation * @return the dsl builder */ - public static SLSEndpointBuilderFactory.SLSEndpointBuilder alibabaSls(String componentName, String path) { - return SLSEndpointBuilderFactory.endpointBuilder(componentName, path); + public static AlibabaSlsEndpointBuilderFactory.AlibabaSlsEndpointBuilder alibabaSls(String componentName, String path) { + return AlibabaSlsEndpointBuilderFactory.endpointBuilder(componentName, path); } /** * Alibaba Short Message Service (SMS) (camel-alibaba-sms) diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OTSEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AlibabaOtsEndpointBuilderFactory.java similarity index 81% rename from dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OTSEndpointBuilderFactory.java rename to dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AlibabaOtsEndpointBuilderFactory.java index 5b39b0c7c50c6..27fc511b99fed 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OTSEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AlibabaOtsEndpointBuilderFactory.java @@ -32,16 +32,16 @@ * Generated by camel build tools - do NOT edit this file! */ @Generated("org.apache.camel.maven.packaging.EndpointDslMojo") -public interface OTSEndpointBuilderFactory { +public interface AlibabaOtsEndpointBuilderFactory { /** * Builder for endpoint for the Alibaba Tablestore (OTS) component. */ - public interface OTSEndpointBuilder + public interface AlibabaOtsEndpointBuilder extends EndpointProducerBuilder { - default AdvancedOTSEndpointBuilder advanced() { - return (AdvancedOTSEndpointBuilder) this; + default AdvancedAlibabaOtsEndpointBuilder advanced() { + return (AdvancedAlibabaOtsEndpointBuilder) this; } /** @@ -55,7 +55,7 @@ default AdvancedOTSEndpointBuilder advanced() { * @param endpoint the value to set * @return the dsl builder */ - default OTSEndpointBuilder endpoint(String endpoint) { + default AlibabaOtsEndpointBuilder endpoint(String endpoint) { doSetProperty("endpoint", endpoint); return this; } @@ -70,7 +70,7 @@ default OTSEndpointBuilder endpoint(String endpoint) { * @param instanceName the value to set * @return the dsl builder */ - default OTSEndpointBuilder instanceName(String instanceName) { + default AlibabaOtsEndpointBuilder instanceName(String instanceName) { doSetProperty("instanceName", instanceName); return this; } @@ -84,7 +84,7 @@ default OTSEndpointBuilder instanceName(String instanceName) { * @param accessKey the value to set * @return the dsl builder */ - default OTSEndpointBuilder accessKey(String accessKey) { + default AlibabaOtsEndpointBuilder accessKey(String accessKey) { doSetProperty("accessKey", accessKey); return this; } @@ -98,7 +98,7 @@ default OTSEndpointBuilder accessKey(String accessKey) { * @param secretKey the value to set * @return the dsl builder */ - default OTSEndpointBuilder secretKey(String secretKey) { + default AlibabaOtsEndpointBuilder secretKey(String secretKey) { doSetProperty("secretKey", secretKey); return this; } @@ -113,7 +113,7 @@ default OTSEndpointBuilder secretKey(String secretKey) { * @param serviceKeys the value to set * @return the dsl builder */ - default OTSEndpointBuilder serviceKeys(org.apache.camel.component.alibaba.common.models.ServiceKeys serviceKeys) { + default AlibabaOtsEndpointBuilder serviceKeys(org.apache.camel.component.alibaba.common.models.ServiceKeys serviceKeys) { doSetProperty("serviceKeys", serviceKeys); return this; } @@ -128,7 +128,7 @@ default OTSEndpointBuilder serviceKeys(org.apache.camel.component.alibaba.common * @param serviceKeys the value to set * @return the dsl builder */ - default OTSEndpointBuilder serviceKeys(String serviceKeys) { + default AlibabaOtsEndpointBuilder serviceKeys(String serviceKeys) { doSetProperty("serviceKeys", serviceKeys); return this; } @@ -137,11 +137,11 @@ default OTSEndpointBuilder serviceKeys(String serviceKeys) { /** * Advanced builder for endpoint for the Alibaba Tablestore (OTS) component. */ - public interface AdvancedOTSEndpointBuilder + public interface AdvancedAlibabaOtsEndpointBuilder extends EndpointProducerBuilder { - default OTSEndpointBuilder basic() { - return (OTSEndpointBuilder) this; + default AlibabaOtsEndpointBuilder basic() { + return (AlibabaOtsEndpointBuilder) this; } /** @@ -163,7 +163,7 @@ default OTSEndpointBuilder basic() { * @param lazyStartProducer the value to set * @return the dsl builder */ - default AdvancedOTSEndpointBuilder lazyStartProducer(boolean lazyStartProducer) { + default AdvancedAlibabaOtsEndpointBuilder lazyStartProducer(boolean lazyStartProducer) { doSetProperty("lazyStartProducer", lazyStartProducer); return this; } @@ -186,7 +186,7 @@ default AdvancedOTSEndpointBuilder lazyStartProducer(boolean lazyStartProducer) * @param lazyStartProducer the value to set * @return the dsl builder */ - default AdvancedOTSEndpointBuilder lazyStartProducer(String lazyStartProducer) { + default AdvancedAlibabaOtsEndpointBuilder lazyStartProducer(String lazyStartProducer) { doSetProperty("lazyStartProducer", lazyStartProducer); return this; } @@ -201,7 +201,7 @@ default AdvancedOTSEndpointBuilder lazyStartProducer(String lazyStartProducer) { * @param otsClient the value to set * @return the dsl builder */ - default AdvancedOTSEndpointBuilder otsClient(com.alicloud.openservices.tablestore.SyncClient otsClient) { + default AdvancedAlibabaOtsEndpointBuilder otsClient(com.alicloud.openservices.tablestore.SyncClient otsClient) { doSetProperty("otsClient", otsClient); return this; } @@ -216,13 +216,13 @@ default AdvancedOTSEndpointBuilder otsClient(com.alicloud.openservices.tablestor * @param otsClient the value to set * @return the dsl builder */ - default AdvancedOTSEndpointBuilder otsClient(String otsClient) { + default AdvancedAlibabaOtsEndpointBuilder otsClient(String otsClient) { doSetProperty("otsClient", otsClient); return this; } } - public interface OTSBuilders { + public interface AlibabaOtsBuilders { /** * Alibaba Tablestore (OTS) (camel-alibaba-ots) * Perform row operations on Alibaba Cloud Tablestore (OTS). @@ -233,8 +233,8 @@ public interface OTSBuilders { * * @return the dsl builder for the headers' name. */ - default OTSHeaderNameBuilder alibabaOts() { - return OTSHeaderNameBuilder.INSTANCE; + default AlibabaOtsHeaderNameBuilder alibabaOts() { + return AlibabaOtsHeaderNameBuilder.INSTANCE; } /** * Alibaba Tablestore (OTS) (camel-alibaba-ots) @@ -254,8 +254,8 @@ default OTSHeaderNameBuilder alibabaOts() { * @param path operation * @return the dsl builder */ - default OTSEndpointBuilder alibabaOts(String path) { - return OTSEndpointBuilderFactory.endpointBuilder("alibaba-ots", path); + default AlibabaOtsEndpointBuilder alibabaOts(String path) { + return AlibabaOtsEndpointBuilderFactory.endpointBuilder("alibaba-ots", path); } /** * Alibaba Tablestore (OTS) (camel-alibaba-ots) @@ -277,20 +277,20 @@ default OTSEndpointBuilder alibabaOts(String path) { * @param path operation * @return the dsl builder */ - default OTSEndpointBuilder alibabaOts(String componentName, String path) { - return OTSEndpointBuilderFactory.endpointBuilder(componentName, path); + default AlibabaOtsEndpointBuilder alibabaOts(String componentName, String path) { + return AlibabaOtsEndpointBuilderFactory.endpointBuilder(componentName, path); } } /** * The builder of headers' name for the Alibaba Tablestore (OTS) component. */ - public static class OTSHeaderNameBuilder { + public static class AlibabaOtsHeaderNameBuilder { /** * The internal instance of the builder used to access to all the * methods representing the name of headers. */ - public static final OTSHeaderNameBuilder INSTANCE = new OTSHeaderNameBuilder(); + public static final AlibabaOtsHeaderNameBuilder INSTANCE = new AlibabaOtsHeaderNameBuilder(); /** * Operation override. @@ -317,12 +317,12 @@ public String alibabaOtsRequestId() { return "CamelAlibabaOtsRequestId"; } } - static OTSEndpointBuilder endpointBuilder(String componentName, String path) { - class OTSEndpointBuilderImpl extends AbstractEndpointBuilder implements OTSEndpointBuilder, AdvancedOTSEndpointBuilder { - public OTSEndpointBuilderImpl(String path) { + static AlibabaOtsEndpointBuilder endpointBuilder(String componentName, String path) { + class AlibabaOtsEndpointBuilderImpl extends AbstractEndpointBuilder implements AlibabaOtsEndpointBuilder, AdvancedAlibabaOtsEndpointBuilder { + public AlibabaOtsEndpointBuilderImpl(String path) { super(componentName, path); } } - return new OTSEndpointBuilderImpl(path); + return new AlibabaOtsEndpointBuilderImpl(path); } } \ No newline at end of file diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SLSEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AlibabaSlsEndpointBuilderFactory.java similarity index 86% rename from dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SLSEndpointBuilderFactory.java rename to dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AlibabaSlsEndpointBuilderFactory.java index b616d9bc79340..8e0ca6768784d 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SLSEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AlibabaSlsEndpointBuilderFactory.java @@ -32,16 +32,16 @@ * Generated by camel build tools - do NOT edit this file! */ @Generated("org.apache.camel.maven.packaging.EndpointDslMojo") -public interface SLSEndpointBuilderFactory { +public interface AlibabaSlsEndpointBuilderFactory { /** * Builder for endpoint for the Alibaba Simple Log Service (SLS) component. */ - public interface SLSEndpointBuilder + public interface AlibabaSlsEndpointBuilder extends EndpointProducerBuilder { - default AdvancedSLSEndpointBuilder advanced() { - return (AdvancedSLSEndpointBuilder) this; + default AdvancedAlibabaSlsEndpointBuilder advanced() { + return (AdvancedAlibabaSlsEndpointBuilder) this; } /** @@ -55,7 +55,7 @@ default AdvancedSLSEndpointBuilder advanced() { * @param endpoint the value to set * @return the dsl builder */ - default SLSEndpointBuilder endpoint(String endpoint) { + default AlibabaSlsEndpointBuilder endpoint(String endpoint) { doSetProperty("endpoint", endpoint); return this; } @@ -69,7 +69,7 @@ default SLSEndpointBuilder endpoint(String endpoint) { * @param logStoreName the value to set * @return the dsl builder */ - default SLSEndpointBuilder logStoreName(String logStoreName) { + default AlibabaSlsEndpointBuilder logStoreName(String logStoreName) { doSetProperty("logStoreName", logStoreName); return this; } @@ -83,7 +83,7 @@ default SLSEndpointBuilder logStoreName(String logStoreName) { * @param project the value to set * @return the dsl builder */ - default SLSEndpointBuilder project(String project) { + default AlibabaSlsEndpointBuilder project(String project) { doSetProperty("project", project); return this; } @@ -98,7 +98,7 @@ default SLSEndpointBuilder project(String project) { * @param region the value to set * @return the dsl builder */ - default SLSEndpointBuilder region(String region) { + default AlibabaSlsEndpointBuilder region(String region) { doSetProperty("region", region); return this; } @@ -112,7 +112,7 @@ default SLSEndpointBuilder region(String region) { * @param from the value to set * @return the dsl builder */ - default SLSEndpointBuilder from(Integer from) { + default AlibabaSlsEndpointBuilder from(Integer from) { doSetProperty("from", from); return this; } @@ -127,7 +127,7 @@ default SLSEndpointBuilder from(Integer from) { * @param from the value to set * @return the dsl builder */ - default SLSEndpointBuilder from(String from) { + default AlibabaSlsEndpointBuilder from(String from) { doSetProperty("from", from); return this; } @@ -141,7 +141,7 @@ default SLSEndpointBuilder from(String from) { * @param line the value to set * @return the dsl builder */ - default SLSEndpointBuilder line(Long line) { + default AlibabaSlsEndpointBuilder line(Long line) { doSetProperty("line", line); return this; } @@ -155,7 +155,7 @@ default SLSEndpointBuilder line(Long line) { * @param line the value to set * @return the dsl builder */ - default SLSEndpointBuilder line(String line) { + default AlibabaSlsEndpointBuilder line(String line) { doSetProperty("line", line); return this; } @@ -169,7 +169,7 @@ default SLSEndpointBuilder line(String line) { * @param offset the value to set * @return the dsl builder */ - default SLSEndpointBuilder offset(Long offset) { + default AlibabaSlsEndpointBuilder offset(Long offset) { doSetProperty("offset", offset); return this; } @@ -183,7 +183,7 @@ default SLSEndpointBuilder offset(Long offset) { * @param offset the value to set * @return the dsl builder */ - default SLSEndpointBuilder offset(String offset) { + default AlibabaSlsEndpointBuilder offset(String offset) { doSetProperty("offset", offset); return this; } @@ -197,7 +197,7 @@ default SLSEndpointBuilder offset(String offset) { * @param query the value to set * @return the dsl builder */ - default SLSEndpointBuilder query(String query) { + default AlibabaSlsEndpointBuilder query(String query) { doSetProperty("query", query); return this; } @@ -212,7 +212,7 @@ default SLSEndpointBuilder query(String query) { * @param reverse the value to set * @return the dsl builder */ - default SLSEndpointBuilder reverse(Boolean reverse) { + default AlibabaSlsEndpointBuilder reverse(Boolean reverse) { doSetProperty("reverse", reverse); return this; } @@ -228,7 +228,7 @@ default SLSEndpointBuilder reverse(Boolean reverse) { * @param reverse the value to set * @return the dsl builder */ - default SLSEndpointBuilder reverse(String reverse) { + default AlibabaSlsEndpointBuilder reverse(String reverse) { doSetProperty("reverse", reverse); return this; } @@ -242,7 +242,7 @@ default SLSEndpointBuilder reverse(String reverse) { * @param to the value to set * @return the dsl builder */ - default SLSEndpointBuilder to(Integer to) { + default AlibabaSlsEndpointBuilder to(Integer to) { doSetProperty("to", to); return this; } @@ -257,7 +257,7 @@ default SLSEndpointBuilder to(Integer to) { * @param to the value to set * @return the dsl builder */ - default SLSEndpointBuilder to(String to) { + default AlibabaSlsEndpointBuilder to(String to) { doSetProperty("to", to); return this; } @@ -271,7 +271,7 @@ default SLSEndpointBuilder to(String to) { * @param topic the value to set * @return the dsl builder */ - default SLSEndpointBuilder topic(String topic) { + default AlibabaSlsEndpointBuilder topic(String topic) { doSetProperty("topic", topic); return this; } @@ -285,7 +285,7 @@ default SLSEndpointBuilder topic(String topic) { * @param accessKey the value to set * @return the dsl builder */ - default SLSEndpointBuilder accessKey(String accessKey) { + default AlibabaSlsEndpointBuilder accessKey(String accessKey) { doSetProperty("accessKey", accessKey); return this; } @@ -299,7 +299,7 @@ default SLSEndpointBuilder accessKey(String accessKey) { * @param secretKey the value to set * @return the dsl builder */ - default SLSEndpointBuilder secretKey(String secretKey) { + default AlibabaSlsEndpointBuilder secretKey(String secretKey) { doSetProperty("secretKey", secretKey); return this; } @@ -314,7 +314,7 @@ default SLSEndpointBuilder secretKey(String secretKey) { * @param serviceKeys the value to set * @return the dsl builder */ - default SLSEndpointBuilder serviceKeys(org.apache.camel.component.alibaba.common.models.ServiceKeys serviceKeys) { + default AlibabaSlsEndpointBuilder serviceKeys(org.apache.camel.component.alibaba.common.models.ServiceKeys serviceKeys) { doSetProperty("serviceKeys", serviceKeys); return this; } @@ -329,7 +329,7 @@ default SLSEndpointBuilder serviceKeys(org.apache.camel.component.alibaba.common * @param serviceKeys the value to set * @return the dsl builder */ - default SLSEndpointBuilder serviceKeys(String serviceKeys) { + default AlibabaSlsEndpointBuilder serviceKeys(String serviceKeys) { doSetProperty("serviceKeys", serviceKeys); return this; } @@ -338,11 +338,11 @@ default SLSEndpointBuilder serviceKeys(String serviceKeys) { /** * Advanced builder for endpoint for the Alibaba Simple Log Service (SLS) component. */ - public interface AdvancedSLSEndpointBuilder + public interface AdvancedAlibabaSlsEndpointBuilder extends EndpointProducerBuilder { - default SLSEndpointBuilder basic() { - return (SLSEndpointBuilder) this; + default AlibabaSlsEndpointBuilder basic() { + return (AlibabaSlsEndpointBuilder) this; } /** @@ -364,7 +364,7 @@ default SLSEndpointBuilder basic() { * @param lazyStartProducer the value to set * @return the dsl builder */ - default AdvancedSLSEndpointBuilder lazyStartProducer(boolean lazyStartProducer) { + default AdvancedAlibabaSlsEndpointBuilder lazyStartProducer(boolean lazyStartProducer) { doSetProperty("lazyStartProducer", lazyStartProducer); return this; } @@ -387,7 +387,7 @@ default AdvancedSLSEndpointBuilder lazyStartProducer(boolean lazyStartProducer) * @param lazyStartProducer the value to set * @return the dsl builder */ - default AdvancedSLSEndpointBuilder lazyStartProducer(String lazyStartProducer) { + default AdvancedAlibabaSlsEndpointBuilder lazyStartProducer(String lazyStartProducer) { doSetProperty("lazyStartProducer", lazyStartProducer); return this; } @@ -401,7 +401,7 @@ default AdvancedSLSEndpointBuilder lazyStartProducer(String lazyStartProducer) { * @param slsClient the value to set * @return the dsl builder */ - default AdvancedSLSEndpointBuilder slsClient(com.aliyun.sls20201230.Client slsClient) { + default AdvancedAlibabaSlsEndpointBuilder slsClient(com.aliyun.sls20201230.Client slsClient) { doSetProperty("slsClient", slsClient); return this; } @@ -416,13 +416,13 @@ default AdvancedSLSEndpointBuilder slsClient(com.aliyun.sls20201230.Client slsCl * @param slsClient the value to set * @return the dsl builder */ - default AdvancedSLSEndpointBuilder slsClient(String slsClient) { + default AdvancedAlibabaSlsEndpointBuilder slsClient(String slsClient) { doSetProperty("slsClient", slsClient); return this; } } - public interface SLSBuilders { + public interface AlibabaSlsBuilders { /** * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) * Manage logs on Alibaba Cloud Simple Log Service (SLS). @@ -433,8 +433,8 @@ public interface SLSBuilders { * * @return the dsl builder for the headers' name. */ - default SLSHeaderNameBuilder alibabaSls() { - return SLSHeaderNameBuilder.INSTANCE; + default AlibabaSlsHeaderNameBuilder alibabaSls() { + return AlibabaSlsHeaderNameBuilder.INSTANCE; } /** * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) @@ -454,8 +454,8 @@ default SLSHeaderNameBuilder alibabaSls() { * @param path operation * @return the dsl builder */ - default SLSEndpointBuilder alibabaSls(String path) { - return SLSEndpointBuilderFactory.endpointBuilder("alibaba-sls", path); + default AlibabaSlsEndpointBuilder alibabaSls(String path) { + return AlibabaSlsEndpointBuilderFactory.endpointBuilder("alibaba-sls", path); } /** * Alibaba Simple Log Service (SLS) (camel-alibaba-sls) @@ -477,20 +477,20 @@ default SLSEndpointBuilder alibabaSls(String path) { * @param path operation * @return the dsl builder */ - default SLSEndpointBuilder alibabaSls(String componentName, String path) { - return SLSEndpointBuilderFactory.endpointBuilder(componentName, path); + default AlibabaSlsEndpointBuilder alibabaSls(String componentName, String path) { + return AlibabaSlsEndpointBuilderFactory.endpointBuilder(componentName, path); } } /** * The builder of headers' name for the Alibaba Simple Log Service (SLS) component. */ - public static class SLSHeaderNameBuilder { + public static class AlibabaSlsHeaderNameBuilder { /** * The internal instance of the builder used to access to all the * methods representing the name of headers. */ - public static final SLSHeaderNameBuilder INSTANCE = new SLSHeaderNameBuilder(); + public static final AlibabaSlsHeaderNameBuilder INSTANCE = new AlibabaSlsHeaderNameBuilder(); /** * SLS project name override. @@ -673,12 +673,12 @@ public String alibabaSlsStatusCode() { return "CamelAlibabaSlsStatusCode"; } } - static SLSEndpointBuilder endpointBuilder(String componentName, String path) { - class SLSEndpointBuilderImpl extends AbstractEndpointBuilder implements SLSEndpointBuilder, AdvancedSLSEndpointBuilder { - public SLSEndpointBuilderImpl(String path) { + static AlibabaSlsEndpointBuilder endpointBuilder(String componentName, String path) { + class AlibabaSlsEndpointBuilderImpl extends AbstractEndpointBuilder implements AlibabaSlsEndpointBuilder, AdvancedAlibabaSlsEndpointBuilder { + public AlibabaSlsEndpointBuilderImpl(String path) { super(componentName, path); } } - return new SLSEndpointBuilderImpl(path); + return new AlibabaSlsEndpointBuilderImpl(path); } } \ No newline at end of file diff --git a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties index 58994d46165eb..59249c431ca1a 100644 --- a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties +++ b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties @@ -26,8 +26,8 @@ org.apache.camel.component.alibaba.fc.FCComponent=camel:alibaba-fc org.apache.camel.component.alibaba.kms.KMSComponent=camel:alibaba-kms org.apache.camel.component.alibaba.mns.MNSComponent=camel:alibaba-mns org.apache.camel.component.alibaba.oss.OSSComponent=camel:alibaba-oss -org.apache.camel.component.alibaba.ots.OTSComponent=camel:alibaba-ots -org.apache.camel.component.alibaba.sls.SLSComponent=camel:alibaba-sls +org.apache.camel.component.alibaba.ots.AlibabaOtsComponent=camel:alibaba-ots +org.apache.camel.component.alibaba.sls.AlibabaSlsComponent=camel:alibaba-sls org.apache.camel.component.alibaba.sms.SMSComponent=camel:alibaba-sms org.apache.camel.component.amqp.AMQPComponent=camel:amqp org.apache.camel.component.arangodb.ArangoDbComponent=camel:arangodb From 81e9ae1c28b32341d3c1ff975dd71c1a5c3d77e5 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 14 Aug 2026 16:23:42 +0000 Subject: [PATCH 6/9] CAMEL-24373: Fix BOM order, doc symlinks and nav title for CI - Sort camel-alibaba-ots before camel-alibaba-sls in BOM (alphabetical) - Use symlinks for alibaba-sls/ots JSON examples like other components - Align nav title with component doc: Alibaba Tablestore (OTS) - Regenerate camel-main-configuration-metadata.json Co-authored-by: Cursor --- bom/camel-bom/pom.xml | 4 +- .../camel-main-configuration-metadata.json | 2 +- .../ROOT/examples/json/alibaba-ots.json | 47 +------------ .../ROOT/examples/json/alibaba-sls.json | 69 +------------------ docs/components/modules/ROOT/nav.adoc | 2 +- 5 files changed, 6 insertions(+), 118 deletions(-) mode change 100644 => 120000 docs/components/modules/ROOT/examples/json/alibaba-ots.json mode change 100644 => 120000 docs/components/modules/ROOT/examples/json/alibaba-sls.json diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml index 8878dbf5cdb0b..7d15c992e805e 100644 --- a/bom/camel-bom/pom.xml +++ b/bom/camel-bom/pom.xml @@ -108,12 +108,12 @@ org.apache.camel - camel-alibaba-sls + camel-alibaba-ots 4.23.0-SNAPSHOT org.apache.camel - camel-alibaba-ots + camel-alibaba-sls 4.23.0-SNAPSHOT diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json index 1146c05cd1cc7..6287ad28e0aee 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json @@ -445,7 +445,7 @@ { "name": "camel.server.mcpServerName", "required": false, "description": "MCP server name advertised to clients. Defaults to the CamelContext name.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.server.mcpSessionIdleTtl", "required": false, "description": "Idle TTL in milliseconds for MCP sessions on the Vert.x streamable transport. Sessions with no activity for longer than this interval are evicted. 0 disables idle eviction.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "integer", "javaType": "long", "defaultValue": 300000, "secret": false }, { "name": "camel.server.mcpSessionKeepAliveInterval", "required": false, "description": "Keep-alive ping interval in milliseconds for MCP sessions on the Vert.x streamable transport. Dead sessions are evicted after consecutive ping failures. 0 disables keep-alive pings.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "integer", "javaType": "long", "defaultValue": 30000, "secret": false }, - { "name": "camel.server.mcpTags", "required": false, "description": "Comma-separated list of ai-tool tags to expose as MCP tools. Only tools registered under one of these tags are exposed; the untagged default pool is never exposed. When not set, no tools are exposed.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, + { "name": "camel.server.mcpTags", "required": false, "description": "Comma-separated list of ai-tool tag patterns to expose as MCP tools. Matching is case-insensitive and supports exact match, wildcard prefix ( {code foo} ), and {code } to match all tags. Only tools registered under a matching tag are exposed; the untagged default pool is never exposed. When not set, no tools are exposed.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.server.mcpToolTimeout", "required": false, "description": "Per-call MCP tool execution timeout in milliseconds. A call exceeding the timeout returns an error result to the MCP client; the underlying route keeps running until it completes on its own.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "integer", "javaType": "long", "defaultValue": 20000, "secret": false }, { "name": "camel.server.path", "required": false, "description": "Context-path to use for embedded HTTP server", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/", "secret": false }, { "name": "camel.server.port", "required": false, "description": "Port to use for binding embedded HTTP server. Use 0 to dynamic assign a free random port number.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 8080, "secret": false }, diff --git a/docs/components/modules/ROOT/examples/json/alibaba-ots.json b/docs/components/modules/ROOT/examples/json/alibaba-ots.json deleted file mode 100644 index 4942723cda505..0000000000000 --- a/docs/components/modules/ROOT/examples/json/alibaba-ots.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "component": { - "kind": "component", - "name": "alibaba-ots", - "title": "Alibaba Tablestore (OTS)", - "description": "Perform row operations on Alibaba Cloud Tablestore (OTS).", - "deprecated": false, - "firstVersion": "4.23.0", - "label": "cloud,database", - "javaType": "org.apache.camel.component.alibaba.ots.AlibabaOtsComponent", - "supportLevel": "Preview", - "groupId": "org.apache.camel", - "artifactId": "camel-alibaba-ots", - "version": "4.23.0-SNAPSHOT", - "scheme": "alibaba-ots", - "extendsScheme": "", - "syntax": "alibaba-ots:operation", - "async": false, - "api": false, - "consumerOnly": false, - "producerOnly": true, - "lenientProperties": false, - "browsable": false, - "remote": true - }, - "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 during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, - "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 type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, - "healthCheckConsumerEnabled": { "index": 2, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, - "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } - }, - "headers": { - "CamelAlibabaOtsOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation override", "constantName": "org.apache.camel.component.alibaba.ots.constants.AlibabaOtsHeaders#OPERATION" }, - "CamelAlibabaOtsRequestId": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore request id", "constantName": "org.apache.camel.component.alibaba.ots.constants.AlibabaOtsHeaders#REQUEST_ID" } - }, - "properties": { - "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putRow", "getRow", "updateRow", "deleteRow", "listTables" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, - "endpoint": { "index": 1, "kind": "parameter", "displayName": "Endpoint", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore endpoint URL" }, - "instanceName": { "index": 2, "kind": "parameter", "displayName": "Instance Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tablestore instance name" }, - "lazyStartProducer": { "index": 3, "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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, - "otsClient": { "index": 4, "kind": "parameter", "displayName": "OTS Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.alicloud.openservices.tablestore.SyncClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "description": "Autowire an existing Tablestore client instance" }, - "accessKey": { "index": 5, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Access key for the cloud user" }, - "secretKey": { "index": 6, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Secret key for the cloud user" }, - "serviceKeys": { "index": 7, "kind": "parameter", "displayName": "Service Keys", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.component.alibaba.common.models.ServiceKeys", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Configuration object for cloud service authentication" } - } -} diff --git a/docs/components/modules/ROOT/examples/json/alibaba-ots.json b/docs/components/modules/ROOT/examples/json/alibaba-ots.json new file mode 120000 index 0000000000000..3a81b0bd71579 --- /dev/null +++ b/docs/components/modules/ROOT/examples/json/alibaba-ots.json @@ -0,0 +1 @@ +../../../../../../components/camel-alibaba/camel-alibaba-ots/src/generated/resources/META-INF/org/apache/camel/component/alibaba/ots/alibaba-ots.json \ No newline at end of file diff --git a/docs/components/modules/ROOT/examples/json/alibaba-sls.json b/docs/components/modules/ROOT/examples/json/alibaba-sls.json deleted file mode 100644 index b4da0b72d0261..0000000000000 --- a/docs/components/modules/ROOT/examples/json/alibaba-sls.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "component": { - "kind": "component", - "name": "alibaba-sls", - "title": "Alibaba Simple Log Service (SLS)", - "description": "Manage logs on Alibaba Cloud Simple Log Service (SLS).", - "deprecated": false, - "firstVersion": "4.23.0", - "label": "cloud,monitoring", - "javaType": "org.apache.camel.component.alibaba.sls.AlibabaSlsComponent", - "supportLevel": "Preview", - "groupId": "org.apache.camel", - "artifactId": "camel-alibaba-sls", - "version": "4.23.0-SNAPSHOT", - "scheme": "alibaba-sls", - "extendsScheme": "", - "syntax": "alibaba-sls:operation", - "async": false, - "api": false, - "consumerOnly": false, - "producerOnly": true, - "lenientProperties": false, - "browsable": false, - "remote": true - }, - "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 during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, - "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 type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, - "healthCheckConsumerEnabled": { "index": 2, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, - "healthCheckProducerEnabled": { "index": 3, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true." } - }, - "headers": { - "CamelAlibabaSlsProject": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS project name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#PROJECT" }, - "CamelAlibabaSlsLogStoreName": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SLS log store name override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#LOG_STORE_NAME" }, - "CamelAlibabaSlsQuery": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query string override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#QUERY" }, - "CamelAlibabaSlsFrom": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query start time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#FROM" }, - "CamelAlibabaSlsTo": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query end time override (Unix timestamp in seconds)", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#TO" }, - "CamelAlibabaSlsLine": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Maximum number of log lines to return", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#LINE" }, - "CamelAlibabaSlsOffset": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log query offset", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#OFFSET" }, - "CamelAlibabaSlsTopic": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log topic filter override", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#TOPIC" }, - "CamelAlibabaSlsReverse": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether to return logs in reverse order", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#REVERSE" }, - "CamelAlibabaSlsLogstoreName": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Log store name prefix filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#LOGSTORE_NAME" }, - "CamelAlibabaSlsMode": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List mode for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#MODE" }, - "CamelAlibabaSlsSize": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Page size for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#SIZE" }, - "CamelAlibabaSlsTelemetryType": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Telemetry type filter for listLogStores", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#TELEMETRY_TYPE" }, - "CamelAlibabaSlsRequestId": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud request id", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#REQUEST_ID" }, - "CamelAlibabaSlsStatusCode": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "HTTP status code from SLS response", "constantName": "org.apache.camel.component.alibaba.sls.constants.AlibabaSlsHeaders#STATUS_CODE" } - }, - "properties": { - "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "putLogs", "getLogs", "listLogStores" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to perform" }, - "endpoint": { "index": 1, "kind": "parameter", "displayName": "Endpoint", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS endpoint URL (e.g. cn-hangzhou.log.aliyuncs.com). Carries higher precedence than region based client initialization" }, - "logStoreName": { "index": 2, "kind": "parameter", "displayName": "Log Store Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS log store name" }, - "project": { "index": 3, "kind": "parameter", "displayName": "Project", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS project name" }, - "region": { "index": 4, "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud region" }, - "lazyStartProducer": { "index": 5, "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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, - "slsClient": { "index": 6, "kind": "parameter", "displayName": "SLS Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.aliyun.sls20201230.Client", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "description": "Autowire an existing SLS client instance" }, - "from": { "index": 7, "kind": "parameter", "displayName": "From", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Query start time for getLogs (Unix timestamp in seconds)" }, - "line": { "index": 8, "kind": "parameter", "displayName": "Line", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "Maximum number of log lines to return for getLogs" }, - "offset": { "index": 9, "kind": "parameter", "displayName": "Offset", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "Log query offset for getLogs" }, - "query": { "index": 10, "kind": "parameter", "displayName": "Query", "group": "getLogs", "label": "getLogs", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Log query string for getLogs" }, - "reverse": { "index": 11, "kind": "parameter", "displayName": "Reverse", "group": "getLogs", "label": "getLogs", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to return logs in reverse order for getLogs" }, - "to": { "index": 12, "kind": "parameter", "displayName": "To", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Query end time for getLogs (Unix timestamp in seconds)" }, - "topic": { "index": 13, "kind": "parameter", "displayName": "Topic", "group": "getLogs", "label": "getLogs", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Log topic filter for getLogs" }, - "accessKey": { "index": 14, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Access key for the cloud user" }, - "secretKey": { "index": 15, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Secret key for the cloud user" }, - "serviceKeys": { "index": 16, "kind": "parameter", "displayName": "Service Keys", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.component.alibaba.common.models.ServiceKeys", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Configuration object for cloud service authentication" } - } -} diff --git a/docs/components/modules/ROOT/examples/json/alibaba-sls.json b/docs/components/modules/ROOT/examples/json/alibaba-sls.json new file mode 120000 index 0000000000000..c448c257d4fac --- /dev/null +++ b/docs/components/modules/ROOT/examples/json/alibaba-sls.json @@ -0,0 +1 @@ +../../../../../../components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json \ No newline at end of file diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc index fefbf92be65c0..f6a500277ddfc 100644 --- a/docs/components/modules/ROOT/nav.adoc +++ b/docs/components/modules/ROOT/nav.adoc @@ -37,7 +37,7 @@ *** xref:alibaba-mns-component.adoc[Alibaba Message Service (MNS)] *** xref:alibaba-oss-component.adoc[Alibaba Object Storage Service (OSS)] *** xref:alibaba-sls-component.adoc[Alibaba Simple Log Service (SLS)] -*** xref:alibaba-ots-component.adoc[Alibaba Table Store (OTS)] +*** xref:alibaba-ots-component.adoc[Alibaba Tablestore (OTS)] *** xref:alibaba-sms-component.adoc[Alibaba Short Message Service (SMS)] ** xref:amqp-component.adoc[AMQP] ** xref:arangodb-component.adoc[ArangoDb] From 18959c6cd46daa9deac769fbfe27e3185a7c9971 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 15 Aug 2026 16:09:30 +0000 Subject: [PATCH 7/9] CAMEL-24373: Address davsclaus review feedback on Phase 3 - Remove required metadata from SLS region (endpoint alone is valid) - Delegate OTS credential resolution to OpenApiClientSupport - Use mock-based OTS endpoint cache test (no real SyncClient) - Add STATUS_CODE to AlibabaSlsProperties for header consistency - Fix alphabetical ordering of OTS/SLS in coverage and nav.adoc Co-authored-by: Omar Atie --- .../alibaba/ots/AlibabaOtsUtils.java | 25 ++----------------- .../alibaba/ots/AlibabaOtsEndpointTest.java | 9 +++---- .../alibaba/sls/AlibabaSlsEndpoint.java | 1 - .../sls/constants/AlibabaSlsHeaders.java | 2 +- .../sls/constants/AlibabaSlsProperties.java | 3 +++ coverage/pom.xml | 4 +-- docs/components/modules/ROOT/nav.adoc | 2 +- 7 files changed, 12 insertions(+), 34 deletions(-) diff --git a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsUtils.java b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsUtils.java index 676a662491231..5b22737f1ab16 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsUtils.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/main/java/org/apache/camel/component/alibaba/ots/AlibabaOtsUtils.java @@ -37,7 +37,6 @@ import com.alicloud.openservices.tablestore.model.UpdateRowResponse; import org.apache.camel.Exchange; import org.apache.camel.component.alibaba.common.OpenApiClientSupport; -import org.apache.camel.component.alibaba.common.models.ServiceKeys; import org.apache.camel.component.alibaba.ots.constants.AlibabaOtsProperties; import org.apache.camel.component.alibaba.ots.models.ClientConfigurations; import org.apache.camel.util.ObjectHelper; @@ -57,31 +56,11 @@ public static SyncClient createClient(AlibabaOtsEndpoint endpoint) { return new SyncClient( endpoint.getEndpoint(), - resolveAccessKey(endpoint.getAccessKey(), endpoint.getServiceKeys()), - resolveSecretKey(endpoint.getSecretKey(), endpoint.getServiceKeys()), + OpenApiClientSupport.resolveAccessKey(endpoint.getAccessKey(), endpoint.getServiceKeys()), + OpenApiClientSupport.resolveSecretKey(endpoint.getSecretKey(), endpoint.getServiceKeys()), endpoint.getInstanceName()); } - public static String resolveAccessKey(String accessKey, ServiceKeys serviceKeys) { - if (ObjectHelper.isNotEmpty(accessKey)) { - return accessKey; - } - if (serviceKeys != null && ObjectHelper.isNotEmpty(serviceKeys.getAccessKey())) { - return serviceKeys.getAccessKey(); - } - throw new IllegalArgumentException("Authentication parameter 'access key (AK)' not found"); - } - - public static String resolveSecretKey(String secretKey, ServiceKeys serviceKeys) { - if (ObjectHelper.isNotEmpty(secretKey)) { - return secretKey; - } - if (serviceKeys != null && ObjectHelper.isNotEmpty(serviceKeys.getSecretKey())) { - return serviceKeys.getSecretKey(); - } - throw new IllegalArgumentException("Authentication parameter 'secret key (SK)' not found"); - } - public static ClientConfigurations createClientConfigurations(AlibabaOtsEndpoint endpoint, Exchange exchange) { ClientConfigurations configuration = new ClientConfigurations(); configuration.setOperation( diff --git a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointTest.java b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointTest.java index 5435230325ca5..76a9ead32c03f 100644 --- a/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointTest.java +++ b/components/camel-alibaba/camel-alibaba-ots/src/test/java/org/apache/camel/component/alibaba/ots/AlibabaOtsEndpointTest.java @@ -29,16 +29,13 @@ class AlibabaOtsEndpointTest { @Test void initClientReturnsCachedInstance() throws Exception { AlibabaOtsEndpoint endpoint = new AlibabaOtsEndpoint(); - endpoint.setAccessKey("ak"); - endpoint.setSecretKey("sk"); - endpoint.setEndpoint("https://test-instance.cn-hangzhou.ots.aliyuncs.com"); - endpoint.setInstanceName("test-instance"); + SyncClient client = mock(SyncClient.class); + endpoint.setOtsClient(client); SyncClient first = endpoint.initClient(); SyncClient second = endpoint.initClient(); - assertThat(first).isSameAs(second); - first.shutdown(); + assertThat(first).isSameAs(second).isSameAs(client); } @Test diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpoint.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpoint.java index f1d0ea33791ad..bd5ef1d9c844a 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpoint.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/AlibabaSlsEndpoint.java @@ -43,7 +43,6 @@ public class AlibabaSlsEndpoint extends DefaultEndpoint { private String operation; @UriParam(description = "Alibaba Cloud region", displayName = "Region") - @Metadata(required = true) private String region; @UriParam(description = "SLS endpoint URL (e.g. cn-hangzhou.log.aliyuncs.com). " diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsHeaders.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsHeaders.java index d802addf53156..d79826d4d8fe5 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsHeaders.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsHeaders.java @@ -63,7 +63,7 @@ public final class AlibabaSlsHeaders { public static final String REQUEST_ID = AlibabaSlsProperties.REQUEST_ID; @Metadata(label = "producer", description = "HTTP status code from SLS response", javaType = "Integer") - public static final String STATUS_CODE = "CamelAlibabaSlsStatusCode"; + public static final String STATUS_CODE = AlibabaSlsProperties.STATUS_CODE; private AlibabaSlsHeaders() { } diff --git a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsProperties.java b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsProperties.java index 278f8306fb341..fc72a04ca421a 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsProperties.java +++ b/components/camel-alibaba/camel-alibaba-sls/src/main/java/org/apache/camel/component/alibaba/sls/constants/AlibabaSlsProperties.java @@ -65,6 +65,9 @@ public final class AlibabaSlsProperties { @Metadata(label = "producer", description = "Request id returned by SLS", javaType = "String") public static final String REQUEST_ID = "CamelAlibabaSlsRequestId"; + @Metadata(label = "producer", description = "HTTP status code from SLS response", javaType = "Integer") + public static final String STATUS_CODE = "CamelAlibabaSlsStatusCode"; + private AlibabaSlsProperties() { } } diff --git a/coverage/pom.xml b/coverage/pom.xml index 835e46af00c94..198495acce49c 100644 --- a/coverage/pom.xml +++ b/coverage/pom.xml @@ -253,12 +253,12 @@ org.apache.camel - camel-alibaba-sls + camel-alibaba-ots ${project.version} org.apache.camel - camel-alibaba-ots + camel-alibaba-sls ${project.version} diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc index f6a500277ddfc..b52c3f5eb6a66 100644 --- a/docs/components/modules/ROOT/nav.adoc +++ b/docs/components/modules/ROOT/nav.adoc @@ -36,8 +36,8 @@ *** xref:alibaba-kms-component.adoc[Alibaba Key Management Service (KMS)] *** xref:alibaba-mns-component.adoc[Alibaba Message Service (MNS)] *** xref:alibaba-oss-component.adoc[Alibaba Object Storage Service (OSS)] -*** xref:alibaba-sls-component.adoc[Alibaba Simple Log Service (SLS)] *** xref:alibaba-ots-component.adoc[Alibaba Tablestore (OTS)] +*** xref:alibaba-sls-component.adoc[Alibaba Simple Log Service (SLS)] *** xref:alibaba-sms-component.adoc[Alibaba Short Message Service (SMS)] ** xref:amqp-component.adoc[AMQP] ** xref:arangodb-component.adoc[ArangoDb] From 11fda28f78c427ef7052040b70ac2ebef6cf4896 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 15 Aug 2026 16:19:02 +0000 Subject: [PATCH 8/9] CAMEL-24373: Regenerate SLS component metadata after region fix Update generated alibaba-sls.json so region is no longer marked required, matching the removal of @Metadata(required = true) on the endpoint. Co-authored-by: Omar Atie --- .../org/apache/camel/component/alibaba/sls/alibaba-sls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json index b4da0b72d0261..b09c9b2635198 100644 --- a/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json +++ b/components/camel-alibaba/camel-alibaba-sls/src/generated/resources/META-INF/org/apache/camel/component/alibaba/sls/alibaba-sls.json @@ -51,7 +51,7 @@ "endpoint": { "index": 1, "kind": "parameter", "displayName": "Endpoint", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS endpoint URL (e.g. cn-hangzhou.log.aliyuncs.com). Carries higher precedence than region based client initialization" }, "logStoreName": { "index": 2, "kind": "parameter", "displayName": "Log Store Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS log store name" }, "project": { "index": 3, "kind": "parameter", "displayName": "Project", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "SLS project name" }, - "region": { "index": 4, "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Alibaba Cloud region" }, + "region": { "index": 4, "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Alibaba Cloud region" }, "lazyStartProducer": { "index": 5, "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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, "slsClient": { "index": 6, "kind": "parameter", "displayName": "SLS Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.aliyun.sls20201230.Client", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "description": "Autowire an existing SLS client instance" }, "from": { "index": 7, "kind": "parameter", "displayName": "From", "group": "getLogs", "label": "getLogs", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Query start time for getLogs (Unix timestamp in seconds)" }, From e94670c234ee52b7503417147b6d11bc58a25d10 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 15 Aug 2026 16:20:28 +0000 Subject: [PATCH 9/9] CAMEL-24373: Fix nav.adoc order to match doc regen sort nav.adoc is auto-generated sorted by component doctitle, not artifactId. Order must be SMS, SLS, OTS (Short < Simple < Tablestore) so regen.sh leaves no uncommitted changes. Co-authored-by: Omar Atie --- docs/components/modules/ROOT/nav.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc index b52c3f5eb6a66..6d4ad09db8c0a 100644 --- a/docs/components/modules/ROOT/nav.adoc +++ b/docs/components/modules/ROOT/nav.adoc @@ -36,9 +36,9 @@ *** xref:alibaba-kms-component.adoc[Alibaba Key Management Service (KMS)] *** xref:alibaba-mns-component.adoc[Alibaba Message Service (MNS)] *** xref:alibaba-oss-component.adoc[Alibaba Object Storage Service (OSS)] -*** xref:alibaba-ots-component.adoc[Alibaba Tablestore (OTS)] -*** xref:alibaba-sls-component.adoc[Alibaba Simple Log Service (SLS)] *** xref:alibaba-sms-component.adoc[Alibaba Short Message Service (SMS)] +*** xref:alibaba-sls-component.adoc[Alibaba Simple Log Service (SLS)] +*** xref:alibaba-ots-component.adoc[Alibaba Tablestore (OTS)] ** xref:amqp-component.adoc[AMQP] ** xref:arangodb-component.adoc[ArangoDb] ** xref:as2-component.adoc[AS2]