This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch ra in repository https://gitbox.apache.org/repos/asf/camel.git
commit b300239d7110c3a19a47ff3e3a3b46a5f55a38d6 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Mon May 27 17:48:15 2024 +0200 CAMEL-20798: Add RemoteAddress to endpoints so they can tell the url/hostname etc for the system it connects. This is needed for better monitoring, tracing and management. Add this information into camel-tracer as tags. --- .../org/apache/camel/catalog/components/etcd3.json | 4 +- .../org/apache/camel/catalog/CamelCatalogTest.java | 1 - .../atmosphere/websocket/WebsocketEndpoint.java | 5 + .../camel/component/dhis2/Dhis2Endpoint.java | 21 ++++- .../digitalocean/DigitalOceanEndpoint.java | 13 ++- .../camel/component/docker/DockerEndpoint.java | 23 ++++- .../camel/component/drill/DrillEndpoint.java | 13 ++- .../camel/component/dropbox/DropboxEndpoint.java | 13 ++- .../org/apache/camel/component/etcd3/etcd3.json | 4 +- .../camel/component/etcd3/Etcd3Configuration.java | 2 +- .../camel/component/etcd3/Etcd3Endpoint.java | 23 ++++- .../camel/component/geocoder/GeoCoderEndpoint.java | 12 ++- .../camel/component/github/GitHubEndpoint.java | 13 ++- .../camel/component/graphql/GraphqlEndpoint.java | 25 ++++- .../dsl/Etcd3ComponentBuilderFactory.java | 2 +- .../dsl/InfinispanComponentBuilderFactory.java | 39 ++++---- .../dsl/MinioComponentBuilderFactory.java | 102 ++++++++++----------- .../endpoint/dsl/Etcd3EndpointBuilderFactory.java | 12 +-- 18 files changed, 235 insertions(+), 92 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/etcd3.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/etcd3.json index 3e65d97cc31..b6c4b242513 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/etcd3.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/etcd3.json @@ -24,7 +24,7 @@ }, "componentProperties": { "configuration": { "index": 0, "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.etcd3.Etcd3Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration." }, - "endpoints": { "index": 1, "kind": "property", "displayName": "Endpoints", "group": "common", "label": "common", "required": false, "type": "array", "javaType": "java.lang.String[]", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Etcd3Constants.ETCD_DEFAULT_ENDPOINTS", "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure etcd server endpoints using the IPNameResolver." }, + "endpoints": { "index": 1, "kind": "property", "displayName": "Endpoints", "group": "common", "label": "common", "required": false, "type": "array", "javaType": "java.lang.String[]", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "http:\/\/localhost:2379", "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure etcd server endpoints using the IPNameResolver." }, "keyCharset": { "index": 2, "kind": "property", "displayName": "Key Charset", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "UTF-8", "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure the charset to use for the keys." }, "namespace": { "index": 3, "kind": "property", "displayName": "Namespace", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure the namespace of keys used. \/ will be treated as no namespace." }, "prefix": { "index": 4, "kind": "property", "displayName": "Prefix", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "To apply an action on all the key-value pairs whose key that starts with the target path." }, @@ -58,7 +58,7 @@ }, "properties": { "path": { "index": 0, "kind": "path", "displayName": "Path", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The path the endpoint refers to" }, - "endpoints": { "index": 1, "kind": "parameter", "displayName": "Endpoints", "group": "common", "label": "common", "required": false, "type": "array", "javaType": "java.lang.String[]", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Etcd3Constants.ETCD_DEFAULT_ENDPOINTS", "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure etcd server endpoints using the IPNameResolver." }, + "endpoints": { "index": 1, "kind": "parameter", "displayName": "Endpoints", "group": "common", "label": "common", "required": false, "type": "array", "javaType": "java.lang.String[]", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "http:\/\/localhost:2379", "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure etcd server endpoints using the IPNameResolver." }, "keyCharset": { "index": 2, "kind": "parameter", "displayName": "Key Charset", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "UTF-8", "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure the charset to use for the keys." }, "namespace": { "index": 3, "kind": "parameter", "displayName": "Namespace", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure the namespace of keys used. \/ will be treated as no namespace." }, "prefix": { "index": 4, "kind": "parameter", "displayName": "Prefix", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "To apply an action on all the key-value pairs whose key that starts with the target path." }, diff --git a/catalog/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java b/catalog/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java index b7acdf5948d..fd2611359b8 100644 --- a/catalog/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java +++ b/catalog/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java @@ -162,7 +162,6 @@ public class CamelCatalogTest { assertTrue(names.contains("aws-secrets")); assertTrue(names.contains("gc")); assertTrue(names.contains("inflight")); - assertTrue(names.contains("mina")); assertTrue(names.contains("platform-http")); assertTrue(names.contains("variables")); } diff --git a/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpoint.java b/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpoint.java index 5b155b456da..fdf8894059b 100644 --- a/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpoint.java +++ b/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpoint.java @@ -64,6 +64,11 @@ public class WebsocketEndpoint extends ServletEndpoint { this.store = component.getWebSocketStore(servicePath); } + @Override + public String getServiceProtocol() { + return "ws"; + } + @Override public Producer createProducer() throws Exception { return new WebsocketProducer(this); diff --git a/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java b/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java index af8ec5f031f..dc1afd26eda 100644 --- a/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java +++ b/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java @@ -31,6 +31,7 @@ import org.apache.camel.component.dhis2.internal.Dhis2ApiCollection; import org.apache.camel.component.dhis2.internal.Dhis2ApiName; import org.apache.camel.component.dhis2.internal.Dhis2Constants; import org.apache.camel.component.dhis2.internal.Dhis2PropertiesHelper; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.component.AbstractApiEndpoint; @@ -43,7 +44,7 @@ import org.hisp.dhis.integration.sdk.api.Dhis2Client; */ @UriEndpoint(firstVersion = "4.0.0", scheme = "dhis2", title = "DHIS2", syntax = "dhis2:apiName/methodName", apiSyntax = "apiName/methodName", category = { Category.API }) -public class Dhis2Endpoint extends AbstractApiEndpoint<Dhis2ApiName, Dhis2Configuration> { +public class Dhis2Endpoint extends AbstractApiEndpoint<Dhis2ApiName, Dhis2Configuration> implements EndpointServiceLocation { @UriParam private final Dhis2Configuration configuration; @@ -77,6 +78,24 @@ public class Dhis2Endpoint extends AbstractApiEndpoint<Dhis2ApiName, Dhis2Config return Dhis2PropertiesHelper.getHelper(getCamelContext()); } + @Override + public String getServiceUrl() { + return configuration.getBaseApiUrl(); + } + + @Override + public Map<String, String> getServiceMetadata() { + if (configuration.getUsername() != null) { + return Map.of("username", configuration.getUsername()); + } + return null; + } + + @Override + public String getServiceProtocol() { + return "http"; + } + protected String getThreadProfileName() { return Dhis2Constants.THREAD_PROFILE_NAME; } diff --git a/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/DigitalOceanEndpoint.java b/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/DigitalOceanEndpoint.java index a0e23ac479a..bf3c61df3a6 100644 --- a/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/DigitalOceanEndpoint.java +++ b/components/camel-digitalocean/src/main/java/org/apache/camel/component/digitalocean/DigitalOceanEndpoint.java @@ -33,6 +33,7 @@ import org.apache.camel.component.digitalocean.producer.DigitalOceanRegionsProdu import org.apache.camel.component.digitalocean.producer.DigitalOceanSizesProducer; import org.apache.camel.component.digitalocean.producer.DigitalOceanSnapshotsProducer; import org.apache.camel.component.digitalocean.producer.DigitalOceanTagsProducer; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.DefaultEndpoint; @@ -50,7 +51,7 @@ import org.slf4j.LoggerFactory; */ @UriEndpoint(firstVersion = "2.19.0", scheme = "digitalocean", title = "DigitalOcean", syntax = "digitalocean:operation", producerOnly = true, category = { Category.CLOUD, Category.MANAGEMENT }, headersClass = DigitalOceanHeaders.class) -public class DigitalOceanEndpoint extends DefaultEndpoint { +public class DigitalOceanEndpoint extends DefaultEndpoint implements EndpointServiceLocation { private static final transient Logger LOG = LoggerFactory.getLogger(DigitalOceanEndpoint.class); @@ -64,6 +65,16 @@ public class DigitalOceanEndpoint extends DefaultEndpoint { this.configuration = configuration; } + @Override + public String getServiceUrl() { + return "api.digitalocean.com"; + } + + @Override + public String getServiceProtocol() { + return "rest"; + } + @Override public Producer createProducer() throws Exception { LOG.trace("Resolve producer digitalocean endpoint {{}}", configuration.getResource()); diff --git a/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerEndpoint.java b/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerEndpoint.java index 34060de6743..b86840289c4 100644 --- a/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerEndpoint.java +++ b/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerEndpoint.java @@ -16,6 +16,8 @@ */ package org.apache.camel.component.docker; +import java.util.Map; + import org.apache.camel.Category; import org.apache.camel.Consumer; import org.apache.camel.Processor; @@ -25,6 +27,7 @@ import org.apache.camel.component.docker.consumer.DockerStatsConsumer; import org.apache.camel.component.docker.exception.DockerException; import org.apache.camel.component.docker.producer.AsyncDockerProducer; import org.apache.camel.component.docker.producer.DockerProducer; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.DefaultEndpoint; @@ -35,7 +38,7 @@ import org.apache.camel.support.DefaultEndpoint; @UriEndpoint(firstVersion = "2.15.0", scheme = "docker", title = "Docker", syntax = "docker:operation", category = { Category.CLOUD, Category.CONTAINER }, lenientProperties = true, headersClass = DockerConstants.class) -public class DockerEndpoint extends DefaultEndpoint { +public class DockerEndpoint extends DefaultEndpoint implements EndpointServiceLocation { @UriParam private DockerConfiguration configuration; @@ -48,6 +51,24 @@ public class DockerEndpoint extends DefaultEndpoint { this.configuration = configuration; } + @Override + public String getServiceUrl() { + return configuration.getHost() + ":" + configuration.getPort(); + } + + @Override + public String getServiceProtocol() { + return "rest"; + } + + @Override + public Map<String, String> getServiceMetadata() { + if (configuration.getUsername() != null) { + return Map.of("username", configuration.getUsername()); + } + return null; + } + @Override public Producer createProducer() throws Exception { DockerOperation operation = configuration.getOperation(); diff --git a/components/camel-drill/src/main/java/org/apache/camel/component/drill/DrillEndpoint.java b/components/camel-drill/src/main/java/org/apache/camel/component/drill/DrillEndpoint.java index 7ab54876dc6..1c71dd656e3 100644 --- a/components/camel-drill/src/main/java/org/apache/camel/component/drill/DrillEndpoint.java +++ b/components/camel-drill/src/main/java/org/apache/camel/component/drill/DrillEndpoint.java @@ -26,6 +26,7 @@ import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.component.drill.util.StringUtils; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -39,7 +40,7 @@ import org.springframework.jdbc.core.RowMapperResultSetExtractor; */ @UriEndpoint(firstVersion = "2.19.0", scheme = "drill", title = "Drill", syntax = "drill:host", producerOnly = true, category = { Category.DATABASE, Category.BIGDATA }, headersClass = DrillConstants.class) -public class DrillEndpoint extends DefaultPollingEndpoint { +public class DrillEndpoint extends DefaultPollingEndpoint implements EndpointServiceLocation { @UriPath(description = "Host name or IP address") @Metadata(required = true) @@ -64,6 +65,16 @@ public class DrillEndpoint extends DefaultPollingEndpoint { super(uri, component); } + @Override + public String getServiceUrl() { + return host + ":" + port; + } + + @Override + public String getServiceProtocol() { + return "jdbc"; + } + @Override public Consumer createConsumer(Processor processor) throws Exception { throw new UnsupportedOperationException("DrillConsumer is not supported!"); diff --git a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java index 14c86250c83..4755b343859 100644 --- a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java +++ b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java @@ -31,6 +31,7 @@ import org.apache.camel.component.dropbox.integration.producer.DropboxSearchProd import org.apache.camel.component.dropbox.util.DropboxConstants; import org.apache.camel.component.dropbox.util.DropboxException; import org.apache.camel.component.dropbox.util.DropboxOperation; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.DefaultEndpoint; @@ -42,7 +43,7 @@ import org.slf4j.LoggerFactory; */ @UriEndpoint(firstVersion = "2.14.0", scheme = "dropbox", title = "Dropbox", syntax = "dropbox:operation", category = { Category.CLOUD, Category.FILE, Category.API }, headersClass = DropboxConstants.class) -public class DropboxEndpoint extends DefaultEndpoint { +public class DropboxEndpoint extends DefaultEndpoint implements EndpointServiceLocation { private static final Logger LOG = LoggerFactory.getLogger(DropboxEndpoint.class); @@ -57,6 +58,16 @@ public class DropboxEndpoint extends DefaultEndpoint { this.configuration = configuration; } + @Override + public String getServiceUrl() { + return "api.dropboxapi.com"; + } + + @Override + public String getServiceProtocol() { + return "rest"; + } + public DropboxConfiguration getConfiguration() { return configuration; } diff --git a/components/camel-etcd3/src/generated/resources/META-INF/org/apache/camel/component/etcd3/etcd3.json b/components/camel-etcd3/src/generated/resources/META-INF/org/apache/camel/component/etcd3/etcd3.json index 3e65d97cc31..b6c4b242513 100644 --- a/components/camel-etcd3/src/generated/resources/META-INF/org/apache/camel/component/etcd3/etcd3.json +++ b/components/camel-etcd3/src/generated/resources/META-INF/org/apache/camel/component/etcd3/etcd3.json @@ -24,7 +24,7 @@ }, "componentProperties": { "configuration": { "index": 0, "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.etcd3.Etcd3Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration." }, - "endpoints": { "index": 1, "kind": "property", "displayName": "Endpoints", "group": "common", "label": "common", "required": false, "type": "array", "javaType": "java.lang.String[]", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Etcd3Constants.ETCD_DEFAULT_ENDPOINTS", "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure etcd server endpoints using the IPNameResolver." }, + "endpoints": { "index": 1, "kind": "property", "displayName": "Endpoints", "group": "common", "label": "common", "required": false, "type": "array", "javaType": "java.lang.String[]", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "http:\/\/localhost:2379", "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure etcd server endpoints using the IPNameResolver." }, "keyCharset": { "index": 2, "kind": "property", "displayName": "Key Charset", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "UTF-8", "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure the charset to use for the keys." }, "namespace": { "index": 3, "kind": "property", "displayName": "Namespace", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure the namespace of keys used. \/ will be treated as no namespace." }, "prefix": { "index": 4, "kind": "property", "displayName": "Prefix", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "To apply an action on all the key-value pairs whose key that starts with the target path." }, @@ -58,7 +58,7 @@ }, "properties": { "path": { "index": 0, "kind": "path", "displayName": "Path", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The path the endpoint refers to" }, - "endpoints": { "index": 1, "kind": "parameter", "displayName": "Endpoints", "group": "common", "label": "common", "required": false, "type": "array", "javaType": "java.lang.String[]", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Etcd3Constants.ETCD_DEFAULT_ENDPOINTS", "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure etcd server endpoints using the IPNameResolver." }, + "endpoints": { "index": 1, "kind": "parameter", "displayName": "Endpoints", "group": "common", "label": "common", "required": false, "type": "array", "javaType": "java.lang.String[]", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "http:\/\/localhost:2379", "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure etcd server endpoints using the IPNameResolver." }, "keyCharset": { "index": 2, "kind": "parameter", "displayName": "Key Charset", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "UTF-8", "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure the charset to use for the keys." }, "namespace": { "index": 3, "kind": "parameter", "displayName": "Namespace", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "Configure the namespace of keys used. \/ will be treated as no namespace." }, "prefix": { "index": 4, "kind": "parameter", "displayName": "Prefix", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.etcd3.Etcd3Configuration", "configurationField": "configuration", "description": "To apply an action on all the key-value pairs whose key that starts with the target path." }, diff --git a/components/camel-etcd3/src/main/java/org/apache/camel/component/etcd3/Etcd3Configuration.java b/components/camel-etcd3/src/main/java/org/apache/camel/component/etcd3/Etcd3Configuration.java index fcf7940fbe8..e25994030ea 100644 --- a/components/camel-etcd3/src/main/java/org/apache/camel/component/etcd3/Etcd3Configuration.java +++ b/components/camel-etcd3/src/main/java/org/apache/camel/component/etcd3/Etcd3Configuration.java @@ -33,7 +33,7 @@ import static org.apache.camel.component.etcd3.Etcd3Constants.ETCD_DEFAULT_ENDPO @UriParams public class Etcd3Configuration implements Cloneable { - @UriParam(label = "common", defaultValue = "Etcd3Constants.ETCD_DEFAULT_ENDPOINTS") + @UriParam(label = "common", defaultValue = "http://localhost:2379") private String[] endpoints = ETCD_DEFAULT_ENDPOINTS; @UriParam(label = "security", secret = true) private String userName; diff --git a/components/camel-etcd3/src/main/java/org/apache/camel/component/etcd3/Etcd3Endpoint.java b/components/camel-etcd3/src/main/java/org/apache/camel/component/etcd3/Etcd3Endpoint.java index ab640c095ca..00d2fd5aa2c 100644 --- a/components/camel-etcd3/src/main/java/org/apache/camel/component/etcd3/Etcd3Endpoint.java +++ b/components/camel-etcd3/src/main/java/org/apache/camel/component/etcd3/Etcd3Endpoint.java @@ -20,18 +20,21 @@ import org.apache.camel.Category; import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.spi.UriPath; import org.apache.camel.support.DefaultEndpoint; +import java.util.Map; + /** * Get, set, delete or watch keys in etcd key-value store. */ @UriEndpoint(firstVersion = "3.19.0", scheme = "etcd3", title = "Etcd v3", syntax = "etcd3:path", category = { Category.CLUSTERING, Category.DATABASE }, headersClass = Etcd3Constants.class) -public class Etcd3Endpoint extends DefaultEndpoint { +public class Etcd3Endpoint extends DefaultEndpoint implements EndpointServiceLocation { @UriPath(label = "common", description = "The path the endpoint refers to") private final String path; @@ -44,6 +47,24 @@ public class Etcd3Endpoint extends DefaultEndpoint { this.configuration = configuration; } + @Override + public String getServiceUrl() { + return configuration.getEndpoints()[0]; + } + + @Override + public String getServiceProtocol() { + return "etcd"; + } + + @Override + public Map<String, String> getServiceMetadata() { + if (configuration.getUserName() != null) { + return Map.of("username", configuration.getUserName()); + } + return null; + } + public Etcd3Configuration getConfiguration() { return configuration; } diff --git a/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java index 6e3a970f512..c845d9e53f7 100644 --- a/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java +++ b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java @@ -25,6 +25,7 @@ import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.component.geocoder.http.AuthenticationMethod; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.spi.UriPath; @@ -35,7 +36,7 @@ import org.apache.camel.support.DefaultEndpoint; */ @UriEndpoint(firstVersion = "2.12.0", scheme = "geocoder", title = "Geocoder", syntax = "geocoder:address:latlng", producerOnly = true, category = { Category.API, Category.SEARCH }, headersClass = GeoCoderConstants.class) -public class GeoCoderEndpoint extends DefaultEndpoint { +public class GeoCoderEndpoint extends DefaultEndpoint implements EndpointServiceLocation { @UriPath private String address; @@ -76,7 +77,16 @@ public class GeoCoderEndpoint extends DefaultEndpoint { public GeoCoderEndpoint(String uri, GeoCoderComponent component) { super(uri, component); + } + @Override + public String getServiceUrl() { + return "https://www.googleapis.com"; + } + + @Override + public String getServiceProtocol() { + return "rest"; } @Override diff --git a/components/camel-github/src/main/java/org/apache/camel/component/github/GitHubEndpoint.java b/components/camel-github/src/main/java/org/apache/camel/component/github/GitHubEndpoint.java index 25434b42b9e..8d101acbbdb 100644 --- a/components/camel-github/src/main/java/org/apache/camel/component/github/GitHubEndpoint.java +++ b/components/camel-github/src/main/java/org/apache/camel/component/github/GitHubEndpoint.java @@ -32,6 +32,7 @@ import org.apache.camel.component.github.producer.GetCommitFileProducer; import org.apache.camel.component.github.producer.PullRequestCommentProducer; import org.apache.camel.component.github.producer.PullRequestFilesProducer; import org.apache.camel.component.github.producer.PullRequestStateProducer; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -62,7 +63,7 @@ import org.apache.camel.util.StringHelper; */ @UriEndpoint(firstVersion = "2.15.0", scheme = "github", title = "GitHub", syntax = "github:type/branchName", category = { Category.FILE, Category.CLOUD, Category.API }, headersClass = GitHubConstants.class) -public class GitHubEndpoint extends ScheduledPollEndpoint { +public class GitHubEndpoint extends ScheduledPollEndpoint implements EndpointServiceLocation { @UriPath @Metadata(required = true) @@ -92,6 +93,16 @@ public class GitHubEndpoint extends ScheduledPollEndpoint { super(uri, component); } + @Override + public String getServiceUrl() { + return "api.github.com"; + } + + @Override + public String getServiceProtocol() { + return "rest"; + } + @Override public Producer createProducer() throws Exception { if (type == GitHubType.CLOSEPULLREQUEST) { diff --git a/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlEndpoint.java b/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlEndpoint.java index d28dd044f73..31e513f2195 100644 --- a/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlEndpoint.java +++ b/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlEndpoint.java @@ -19,6 +19,7 @@ package org.apache.camel.component.graphql; import java.io.IOException; import java.net.URI; import java.util.Arrays; +import java.util.Map; import org.apache.camel.Category; import org.apache.camel.Component; @@ -26,6 +27,7 @@ import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.RuntimeCamelException; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -50,7 +52,7 @@ import org.apache.hc.core5.http.message.BasicHeader; */ @UriEndpoint(firstVersion = "3.0.0", scheme = "graphql", title = "GraphQL", syntax = "graphql:httpUri", category = { Category.API }, producerOnly = true, lenientProperties = true) -public class GraphqlEndpoint extends DefaultEndpoint { +public class GraphqlEndpoint extends DefaultEndpoint implements EndpointServiceLocation { @UriPath @Metadata(required = true) @@ -84,6 +86,27 @@ public class GraphqlEndpoint extends DefaultEndpoint { super(uri, component); } + @Override + public String getServiceUrl() { + if (httpUri != null) { + return httpUri.toString(); + } + return null; + } + + @Override + public Map<String, String> getServiceMetadata() { + if (username != null) { + return Map.of("username", username); + } + return null; + } + + @Override + public String getServiceProtocol() { + return "rest"; + } + @Override protected void doStop() throws Exception { if (httpClient != null) { diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Etcd3ComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Etcd3ComponentBuilderFactory.java index 9785379b0d1..12edd6be167 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Etcd3ComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Etcd3ComponentBuilderFactory.java @@ -72,7 +72,7 @@ public interface Etcd3ComponentBuilderFactory { * * The option is a: <code>java.lang.String[]</code> type. * - * Default: Etcd3Constants.ETCD_DEFAULT_ENDPOINTS + * Default: http://localhost:2379 * Group: common * * @param endpoints the value to set diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanComponentBuilderFactory.java index 58b83d063cf..070cd50c7b2 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanComponentBuilderFactory.java @@ -68,7 +68,8 @@ public interface InfinispanComponentBuilderFactory { } /** - * Specifies the host of the cache on Infinispan instance. + * Specifies the host of the cache on Infinispan instance. Multiple + * hosts can be separated by semicolon. * * The option is a: <code>java.lang.String</code> type. * @@ -99,23 +100,6 @@ public interface InfinispanComponentBuilderFactory { } - /** - * Define if we are connecting to a secured Infinispan instance. - * - * The option is a: <code>boolean</code> type. - * - * Default: false - * Group: common - * - * @param secure the value to set - * @return the dsl builder - */ - default InfinispanComponentBuilder secure(boolean secure) { - doSetProperty("secure", secure); - return this; - } - - /** * Allows for bridging the consumer to the Camel routing Error Handler, * which mean any exceptions (if possible) occurred while the Camel @@ -453,6 +437,23 @@ public interface InfinispanComponentBuilderFactory { return this; } + + /** + * Define if we are connecting to a secured Infinispan instance. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: security + * + * @param secure the value to set + * @return the dsl builder + */ + default InfinispanComponentBuilder secure(boolean secure) { + doSetProperty("secure", secure); + return this; + } + /** * Define the security realm to access the infinispan instance. * @@ -521,7 +522,6 @@ public interface InfinispanComponentBuilderFactory { case "configuration": ((InfinispanRemoteComponent) component).setConfiguration((org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration) value); return true; case "hosts": getOrCreateConfiguration((InfinispanRemoteComponent) component).setHosts((java.lang.String) value); return true; case "queryBuilder": getOrCreateConfiguration((InfinispanRemoteComponent) component).setQueryBuilder((org.apache.camel.component.infinispan.InfinispanQueryBuilder) value); return true; - case "secure": getOrCreateConfiguration((InfinispanRemoteComponent) component).setSecure((boolean) value); return true; case "bridgeErrorHandler": ((InfinispanRemoteComponent) component).setBridgeErrorHandler((boolean) value); return true; case "customListener": getOrCreateConfiguration((InfinispanRemoteComponent) component).setCustomListener((org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener) value); return true; case "eventTypes": getOrCreateConfiguration((InfinispanRemoteComponent) component).setEventTypes((java.lang.String) value); return true; @@ -541,6 +541,7 @@ public interface InfinispanComponentBuilderFactory { case "resultHeader": getOrCreateConfiguration((InfinispanRemoteComponent) component).setResultHeader((java.lang.String) value); return true; case "password": getOrCreateConfiguration((InfinispanRemoteComponent) component).setPassword((java.lang.String) value); return true; case "saslMechanism": getOrCreateConfiguration((InfinispanRemoteComponent) component).setSaslMechanism((java.lang.String) value); return true; + case "secure": getOrCreateConfiguration((InfinispanRemoteComponent) component).setSecure((boolean) value); return true; case "securityRealm": getOrCreateConfiguration((InfinispanRemoteComponent) component).setSecurityRealm((java.lang.String) value); return true; case "securityServerName": getOrCreateConfiguration((InfinispanRemoteComponent) component).setSecurityServerName((java.lang.String) value); return true; case "username": getOrCreateConfiguration((InfinispanRemoteComponent) component).setUsername((java.lang.String) value); return true; diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MinioComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MinioComponentBuilderFactory.java index ce2b9a10740..54c30e4c76e 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MinioComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MinioComponentBuilderFactory.java @@ -83,21 +83,6 @@ public interface MinioComponentBuilderFactory { return this; } - /** - * Set custom HTTP client for authenticated access. - * - * The option is a: <code>okhttp3.OkHttpClient</code> type. - * - * Group: common - * - * @param customHttpClient the value to set - * @return the dsl builder - */ - default MinioComponentBuilder customHttpClient(okhttp3.OkHttpClient customHttpClient) { - doSetProperty("customHttpClient", customHttpClient); - return this; - } - /** * Endpoint can be an URL, domain name, IPv4 address or IPv6 address. * @@ -211,39 +196,6 @@ public interface MinioComponentBuilderFactory { return this; } - /** - * Server-side encryption. - * - * The option is a: - * <code>io.minio.ServerSideEncryption</code> type. - * - * Group: common - * - * @param serverSideEncryption the value to set - * @return the dsl builder - */ - default MinioComponentBuilder serverSideEncryption(io.minio.ServerSideEncryption serverSideEncryption) { - doSetProperty("serverSideEncryption", serverSideEncryption); - return this; - } - - /** - * Server-side encryption for source object while copy/move objects. - * - * The option is a: - * <code>io.minio.ServerSideEncryptionCustomerKey</code> - * type. - * - * Group: common - * - * @param serverSideEncryptionCustomerKey the value to set - * @return the dsl builder - */ - default MinioComponentBuilder serverSideEncryptionCustomerKey(io.minio.ServerSideEncryptionCustomerKey serverSideEncryptionCustomerKey) { - doSetProperty("serverSideEncryptionCustomerKey", serverSideEncryptionCustomerKey); - return this; - } - /** * If this option is true and includeBody is true, then the @@ -830,6 +782,21 @@ public interface MinioComponentBuilderFactory { return this; } + /** + * Set custom HTTP client for authenticated access. + * + * The option is a: <code>okhttp3.OkHttpClient</code> type. + * + * Group: advanced + * + * @param customHttpClient the value to set + * @return the dsl builder + */ + default MinioComponentBuilder customHttpClient(okhttp3.OkHttpClient customHttpClient) { + doSetProperty("customHttpClient", customHttpClient); + return this; + } + /** * Used for enabling or disabling all consumer based health checks from @@ -899,6 +866,39 @@ public interface MinioComponentBuilderFactory { doSetProperty("secretKey", secretKey); return this; } + + /** + * Server-side encryption. + * + * The option is a: + * <code>io.minio.ServerSideEncryption</code> type. + * + * Group: security + * + * @param serverSideEncryption the value to set + * @return the dsl builder + */ + default MinioComponentBuilder serverSideEncryption(io.minio.ServerSideEncryption serverSideEncryption) { + doSetProperty("serverSideEncryption", serverSideEncryption); + return this; + } + + /** + * Server-side encryption for source object while copy/move objects. + * + * The option is a: + * <code>io.minio.ServerSideEncryptionCustomerKey</code> + * type. + * + * Group: security + * + * @param serverSideEncryptionCustomerKey the value to set + * @return the dsl builder + */ + default MinioComponentBuilder serverSideEncryptionCustomerKey(io.minio.ServerSideEncryptionCustomerKey serverSideEncryptionCustomerKey) { + doSetProperty("serverSideEncryptionCustomerKey", serverSideEncryptionCustomerKey); + return this; + } } class MinioComponentBuilderImpl @@ -922,7 +922,6 @@ public interface MinioComponentBuilderFactory { switch (name) { case "autoCreateBucket": getOrCreateConfiguration((MinioComponent) component).setAutoCreateBucket((boolean) value); return true; case "configuration": ((MinioComponent) component).setConfiguration((org.apache.camel.component.minio.MinioConfiguration) value); return true; - case "customHttpClient": getOrCreateConfiguration((MinioComponent) component).setCustomHttpClient((okhttp3.OkHttpClient) value); return true; case "endpoint": getOrCreateConfiguration((MinioComponent) component).setEndpoint((java.lang.String) value); return true; case "minioClient": getOrCreateConfiguration((MinioComponent) component).setMinioClient((io.minio.MinioClient) value); return true; case "objectLock": getOrCreateConfiguration((MinioComponent) component).setObjectLock((boolean) value); return true; @@ -930,8 +929,6 @@ public interface MinioComponentBuilderFactory { case "proxyPort": getOrCreateConfiguration((MinioComponent) component).setProxyPort((java.lang.Integer) value); return true; case "region": getOrCreateConfiguration((MinioComponent) component).setRegion((java.lang.String) value); return true; case "secure": getOrCreateConfiguration((MinioComponent) component).setSecure((boolean) value); return true; - case "serverSideEncryption": getOrCreateConfiguration((MinioComponent) component).setServerSideEncryption((io.minio.ServerSideEncryption) value); return true; - case "serverSideEncryptionCustomerKey": getOrCreateConfiguration((MinioComponent) component).setServerSideEncryptionCustomerKey((io.minio.ServerSideEncryptionCustomerKey) value); return true; case "autoCloseBody": getOrCreateConfiguration((MinioComponent) component).setAutoCloseBody((boolean) value); return true; case "bridgeErrorHandler": ((MinioComponent) component).setBridgeErrorHandler((boolean) value); return true; case "bypassGovernanceMode": getOrCreateConfiguration((MinioComponent) component).setBypassGovernanceMode((boolean) value); return true; @@ -965,10 +962,13 @@ public interface MinioComponentBuilderFactory { case "pojoRequest": getOrCreateConfiguration((MinioComponent) component).setPojoRequest((boolean) value); return true; case "storageClass": getOrCreateConfiguration((MinioComponent) component).setStorageClass((java.lang.String) value); return true; case "autowiredEnabled": ((MinioComponent) component).setAutowiredEnabled((boolean) value); return true; + case "customHttpClient": getOrCreateConfiguration((MinioComponent) component).setCustomHttpClient((okhttp3.OkHttpClient) value); return true; case "healthCheckConsumerEnabled": ((MinioComponent) component).setHealthCheckConsumerEnabled((boolean) value); return true; case "healthCheckProducerEnabled": ((MinioComponent) component).setHealthCheckProducerEnabled((boolean) value); return true; case "accessKey": getOrCreateConfiguration((MinioComponent) component).setAccessKey((java.lang.String) value); return true; case "secretKey": getOrCreateConfiguration((MinioComponent) component).setSecretKey((java.lang.String) value); return true; + case "serverSideEncryption": getOrCreateConfiguration((MinioComponent) component).setServerSideEncryption((io.minio.ServerSideEncryption) value); return true; + case "serverSideEncryptionCustomerKey": getOrCreateConfiguration((MinioComponent) component).setServerSideEncryptionCustomerKey((io.minio.ServerSideEncryptionCustomerKey) value); return true; default: return false; } } diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Etcd3EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Etcd3EndpointBuilderFactory.java index 51e6425872c..6cb4f4381df 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Etcd3EndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Etcd3EndpointBuilderFactory.java @@ -48,7 +48,7 @@ public interface Etcd3EndpointBuilderFactory { * * The option is a: <code>java.lang.String[]</code> type. * - * Default: Etcd3Constants.ETCD_DEFAULT_ENDPOINTS + * Default: http://localhost:2379 * Group: common * * @param endpoints the value to set @@ -64,7 +64,7 @@ public interface Etcd3EndpointBuilderFactory { * The option will be converted to a <code>java.lang.String[]</code> * type. * - * Default: Etcd3Constants.ETCD_DEFAULT_ENDPOINTS + * Default: http://localhost:2379 * Group: common * * @param endpoints the value to set @@ -696,7 +696,7 @@ public interface Etcd3EndpointBuilderFactory { * * The option is a: <code>java.lang.String[]</code> type. * - * Default: Etcd3Constants.ETCD_DEFAULT_ENDPOINTS + * Default: http://localhost:2379 * Group: common * * @param endpoints the value to set @@ -712,7 +712,7 @@ public interface Etcd3EndpointBuilderFactory { * The option will be converted to a <code>java.lang.String[]</code> * type. * - * Default: Etcd3Constants.ETCD_DEFAULT_ENDPOINTS + * Default: http://localhost:2379 * Group: common * * @param endpoints the value to set @@ -1258,7 +1258,7 @@ public interface Etcd3EndpointBuilderFactory { * * The option is a: <code>java.lang.String[]</code> type. * - * Default: Etcd3Constants.ETCD_DEFAULT_ENDPOINTS + * Default: http://localhost:2379 * Group: common * * @param endpoints the value to set @@ -1274,7 +1274,7 @@ public interface Etcd3EndpointBuilderFactory { * The option will be converted to a <code>java.lang.String[]</code> * type. * - * Default: Etcd3Constants.ETCD_DEFAULT_ENDPOINTS + * Default: http://localhost:2379 * Group: common * * @param endpoints the value to set