This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit fb0a3c350810cf3e9d6b4d029c3ff6a0158e9b2e Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Fri Jun 28 11:30:29 2024 +0200 CAMEL-20798: EndpointServiceLocation on components to make it possible to know which remote system Camel connects to to assist for monitoring and observability - Regen Signed-off-by: Andrea Cosentino <anco...@gmail.com> --- .../component/google/bigquery/GoogleBigQueryEndpoint.java | 10 +++++----- .../component/google/calendar/GoogleCalendarEndpoint.java | 6 ++++-- .../google/calendar/stream/GoogleCalendarStreamEndpoint.java | 7 ++++--- .../camel/component/google/drive/GoogleDriveEndpoint.java | 6 ++++-- .../google/functions/GoogleCloudFunctionsEndpoint.java | 8 ++++---- .../apache/camel/component/google/mail/GoogleMailEndpoint.java | 6 ++++-- .../component/google/mail/stream/GoogleMailStreamEndpoint.java | 4 ++-- .../google/secret/manager/GoogleSecretManagerEndpoint.java | 5 ++--- .../camel/component/google/sheets/GoogleSheetsEndpoint.java | 6 ++++-- .../google/sheets/stream/GoogleSheetsStreamEndpoint.java | 3 ++- .../component/google/storage/GoogleCloudStorageEndpoint.java | 9 +++++---- 11 files changed, 40 insertions(+), 30 deletions(-) diff --git a/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryEndpoint.java b/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryEndpoint.java index 948a51468cd..85b7fa44b2a 100644 --- a/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryEndpoint.java +++ b/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryEndpoint.java @@ -27,8 +27,6 @@ import org.apache.camel.spi.UriParam; import org.apache.camel.support.DefaultEndpoint; import org.apache.camel.util.ObjectHelper; -import java.util.Map; - import static org.apache.camel.component.google.bigquery.GoogleBigQueryConstants.SCHEME_BIGQUERY; /** @@ -93,9 +91,11 @@ public class GoogleBigQueryEndpoint extends DefaultEndpoint implements EndpointS @Override public String getServiceUrl() { - if (ObjectHelper.isNotEmpty(configuration.getProjectId()) && ObjectHelper.isNotEmpty(configuration.getDatasetId()) && ObjectHelper.isNotEmpty(configuration.getTableId())) { - return getServiceProtocol() + ":" + configuration.getProjectId() + ":" + configuration.getDatasetId() + ":" + configuration.getTableId(); - } + if (ObjectHelper.isNotEmpty(configuration.getProjectId()) && ObjectHelper.isNotEmpty(configuration.getDatasetId()) + && ObjectHelper.isNotEmpty(configuration.getTableId())) { + return getServiceProtocol() + ":" + configuration.getProjectId() + ":" + configuration.getDatasetId() + ":" + + configuration.getTableId(); + } return null; } diff --git a/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarEndpoint.java b/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarEndpoint.java index 57a00b0bba7..ce1874bdf54 100644 --- a/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarEndpoint.java +++ b/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarEndpoint.java @@ -41,7 +41,8 @@ import org.apache.camel.util.ObjectHelper; @UriEndpoint(firstVersion = "2.15.0", scheme = "google-calendar", title = "Google Calendar", syntax = "google-calendar:apiName/methodName", apiSyntax = "apiName/methodName", consumerPrefix = "consumer", category = { Category.API, Category.CLOUD }) -public class GoogleCalendarEndpoint extends AbstractApiEndpoint<GoogleCalendarApiName, GoogleCalendarConfiguration> implements EndpointServiceLocation { +public class GoogleCalendarEndpoint extends AbstractApiEndpoint<GoogleCalendarApiName, GoogleCalendarConfiguration> + implements EndpointServiceLocation { @UriParam private GoogleCalendarConfiguration configuration; @@ -126,7 +127,8 @@ public class GoogleCalendarEndpoint extends AbstractApiEndpoint<GoogleCalendarAp @Override public String getServiceUrl() { - if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getApiName()) && ObjectHelper.isNotEmpty(configuration.getMethodName()))) { + if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getApiName()) + && ObjectHelper.isNotEmpty(configuration.getMethodName()))) { return getServiceProtocol() + ":" + configuration.getApiName() + ":" + configuration.getMethodName(); } return null; diff --git a/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamEndpoint.java b/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamEndpoint.java index 7e8c97aea9b..c14d6783bde 100644 --- a/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamEndpoint.java +++ b/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamEndpoint.java @@ -16,6 +16,8 @@ */ package org.apache.camel.component.google.calendar.stream; +import java.util.Map; + import com.google.api.services.calendar.Calendar; import com.google.api.services.calendar.model.Event; import org.apache.camel.Category; @@ -31,8 +33,6 @@ import org.apache.camel.spi.UriParam; import org.apache.camel.support.ScheduledPollEndpoint; import org.apache.camel.util.ObjectHelper; -import java.util.Map; - /** * Poll for changes in a Google Calendar. */ @@ -93,7 +93,8 @@ public class GoogleCalendarStreamEndpoint extends ScheduledPollEndpoint implemen @Override public String getServiceUrl() { - if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getCalendarId()) && ObjectHelper.isNotEmpty(configuration.getUser()))) { + if (ObjectHelper.isNotEmpty( + ObjectHelper.isNotEmpty(configuration.getCalendarId()) && ObjectHelper.isNotEmpty(configuration.getUser()))) { return getServiceProtocol() + ":" + configuration.getUser() + ":" + configuration.getCalendarId(); } return null; diff --git a/components/camel-google/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveEndpoint.java b/components/camel-google/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveEndpoint.java index ba9f8c29de5..9a428f77400 100644 --- a/components/camel-google/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveEndpoint.java +++ b/components/camel-google/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveEndpoint.java @@ -38,7 +38,8 @@ import org.apache.camel.util.ObjectHelper; @UriEndpoint(firstVersion = "2.14.0", scheme = "google-drive", title = "Google Drive", syntax = "google-drive:apiName/methodName", apiSyntax = "apiName/methodName", consumerPrefix = "consumer", category = { Category.FILE, Category.CLOUD, Category.API }) -public class GoogleDriveEndpoint extends AbstractApiEndpoint<GoogleDriveApiName, GoogleDriveConfiguration> implements EndpointServiceLocation { +public class GoogleDriveEndpoint extends AbstractApiEndpoint<GoogleDriveApiName, GoogleDriveConfiguration> + implements EndpointServiceLocation { private Object apiProxy; @UriParam @@ -142,7 +143,8 @@ public class GoogleDriveEndpoint extends AbstractApiEndpoint<GoogleDriveApiName, @Override public String getServiceUrl() { - if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getApiName()) && ObjectHelper.isNotEmpty(configuration.getMethodName()))) { + if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getApiName()) + && ObjectHelper.isNotEmpty(configuration.getMethodName()))) { return getServiceProtocol() + ":" + configuration.getApiName() + ":" + configuration.getMethodName(); } return null; diff --git a/components/camel-google/camel-google-functions/src/main/java/org/apache/camel/component/google/functions/GoogleCloudFunctionsEndpoint.java b/components/camel-google/camel-google-functions/src/main/java/org/apache/camel/component/google/functions/GoogleCloudFunctionsEndpoint.java index 090a58f1408..a97f952fde4 100644 --- a/components/camel-google/camel-google-functions/src/main/java/org/apache/camel/component/google/functions/GoogleCloudFunctionsEndpoint.java +++ b/components/camel-google/camel-google-functions/src/main/java/org/apache/camel/component/google/functions/GoogleCloudFunctionsEndpoint.java @@ -27,8 +27,6 @@ import org.apache.camel.spi.UriParam; import org.apache.camel.support.DefaultEndpoint; import org.apache.camel.util.ObjectHelper; -import java.util.Map; - /** * Manage and invoke Google Cloud Functions * @@ -96,8 +94,10 @@ public class GoogleCloudFunctionsEndpoint extends DefaultEndpoint implements End @Override public String getServiceUrl() { - if (ObjectHelper.isNotEmpty(configuration.getFunctionName()) && ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getProject()) && ObjectHelper.isNotEmpty(configuration.getLocation()))) { - return getServiceProtocol() + ":" + configuration.getProject() + ":" + configuration.getFunctionName() + ":" + configuration.getLocation(); + if (ObjectHelper.isNotEmpty(configuration.getFunctionName()) && ObjectHelper.isNotEmpty( + ObjectHelper.isNotEmpty(configuration.getProject()) && ObjectHelper.isNotEmpty(configuration.getLocation()))) { + return getServiceProtocol() + ":" + configuration.getProject() + ":" + configuration.getFunctionName() + ":" + + configuration.getLocation(); } return null; } diff --git a/components/camel-google/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailEndpoint.java b/components/camel-google/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailEndpoint.java index baee7164ed9..979c23067f2 100644 --- a/components/camel-google/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailEndpoint.java +++ b/components/camel-google/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailEndpoint.java @@ -45,7 +45,8 @@ import org.apache.camel.util.ObjectHelper; apiSyntax = "apiName/methodName", consumerPrefix = "consumer", category = { Category.CLOUD, Category.API, Category.MAIL }) -public class GoogleMailEndpoint extends AbstractApiEndpoint<GoogleMailApiName, GoogleMailConfiguration> implements EndpointServiceLocation { +public class GoogleMailEndpoint extends AbstractApiEndpoint<GoogleMailApiName, GoogleMailConfiguration> + implements EndpointServiceLocation { private Object apiProxy; @@ -134,7 +135,8 @@ public class GoogleMailEndpoint extends AbstractApiEndpoint<GoogleMailApiName, G @Override public String getServiceUrl() { - if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getApiName()) && ObjectHelper.isNotEmpty(configuration.getMethodName()))) { + if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getApiName()) + && ObjectHelper.isNotEmpty(configuration.getMethodName()))) { return getServiceProtocol() + ":" + configuration.getApiName() + ":" + configuration.getMethodName(); } return null; diff --git a/components/camel-google/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/stream/GoogleMailStreamEndpoint.java b/components/camel-google/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/stream/GoogleMailStreamEndpoint.java index 26d98407124..3fa4d9d368e 100644 --- a/components/camel-google/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/stream/GoogleMailStreamEndpoint.java +++ b/components/camel-google/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/stream/GoogleMailStreamEndpoint.java @@ -18,7 +18,6 @@ package org.apache.camel.component.google.mail.stream; import java.util.ArrayList; import java.util.List; -import java.util.Map; import com.google.api.services.gmail.Gmail; import com.google.api.services.gmail.model.Label; @@ -109,7 +108,8 @@ public class GoogleMailStreamEndpoint extends ScheduledPollEndpoint implements E @Override public String getServiceUrl() { - if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getApplicationName()) && ObjectHelper.isNotEmpty(configuration.getIndex()))) { + if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getApplicationName()) + && ObjectHelper.isNotEmpty(configuration.getIndex()))) { return getServiceProtocol() + ":" + configuration.getApplicationName() + ":" + configuration.getIndex(); } return null; diff --git a/components/camel-google/camel-google-secret-manager/src/main/java/org/apache/camel/component/google/secret/manager/GoogleSecretManagerEndpoint.java b/components/camel-google/camel-google-secret-manager/src/main/java/org/apache/camel/component/google/secret/manager/GoogleSecretManagerEndpoint.java index 39b19f96883..cd30a79bb92 100644 --- a/components/camel-google/camel-google-secret-manager/src/main/java/org/apache/camel/component/google/secret/manager/GoogleSecretManagerEndpoint.java +++ b/components/camel-google/camel-google-secret-manager/src/main/java/org/apache/camel/component/google/secret/manager/GoogleSecretManagerEndpoint.java @@ -28,8 +28,6 @@ import org.apache.camel.spi.UriParam; import org.apache.camel.support.DefaultEndpoint; import org.apache.camel.util.ObjectHelper; -import java.util.Map; - /** * Manage Google Secret Manager Secrets * @@ -99,7 +97,8 @@ public class GoogleSecretManagerEndpoint extends DefaultEndpoint implements Endp @Override public String getServiceUrl() { - if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getProject()) && ObjectHelper.isNotEmpty(configuration.getClient()))) { + if (ObjectHelper.isNotEmpty( + ObjectHelper.isNotEmpty(configuration.getProject()) && ObjectHelper.isNotEmpty(configuration.getClient()))) { return getServiceProtocol() + ":" + configuration.getProject() + ":" + configuration.getClient(); } return null; diff --git a/components/camel-google/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/GoogleSheetsEndpoint.java b/components/camel-google/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/GoogleSheetsEndpoint.java index af14eeab322..e8b3065dc7e 100644 --- a/components/camel-google/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/GoogleSheetsEndpoint.java +++ b/components/camel-google/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/GoogleSheetsEndpoint.java @@ -41,7 +41,8 @@ import org.apache.camel.util.ObjectHelper; @UriEndpoint(firstVersion = "2.23.0", scheme = "google-sheets", title = "Google Sheets", syntax = "google-sheets:apiName/methodName", apiSyntax = "apiName/methodName", category = { Category.CLOUD, Category.DOCUMENT }) -public class GoogleSheetsEndpoint extends AbstractApiEndpoint<GoogleSheetsApiName, GoogleSheetsConfiguration> implements EndpointServiceLocation { +public class GoogleSheetsEndpoint extends AbstractApiEndpoint<GoogleSheetsApiName, GoogleSheetsConfiguration> + implements EndpointServiceLocation { @UriParam private GoogleSheetsConfiguration configuration; @@ -114,7 +115,8 @@ public class GoogleSheetsEndpoint extends AbstractApiEndpoint<GoogleSheetsApiNam @Override public String getServiceUrl() { - if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getApiName()) && ObjectHelper.isNotEmpty(configuration.getMethodName()))) { + if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getApiName()) + && ObjectHelper.isNotEmpty(configuration.getMethodName()))) { return getServiceProtocol() + ":" + configuration.getApiName() + ":" + configuration.getMethodName(); } return null; diff --git a/components/camel-google/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/stream/GoogleSheetsStreamEndpoint.java b/components/camel-google/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/stream/GoogleSheetsStreamEndpoint.java index 768ad66b948..dced6726c98 100644 --- a/components/camel-google/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/stream/GoogleSheetsStreamEndpoint.java +++ b/components/camel-google/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/stream/GoogleSheetsStreamEndpoint.java @@ -78,7 +78,8 @@ public class GoogleSheetsStreamEndpoint extends ScheduledPollEndpoint implements @Override public String getServiceUrl() { - if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getApplicationName()) && ObjectHelper.isNotEmpty(configuration.getSpreadsheetId()))) { + if (ObjectHelper.isNotEmpty(ObjectHelper.isNotEmpty(configuration.getApplicationName()) + && ObjectHelper.isNotEmpty(configuration.getSpreadsheetId()))) { return getServiceProtocol() + ":" + configuration.getApplicationName() + ":" + configuration.getSpreadsheetId(); } return null; diff --git a/components/camel-google/camel-google-storage/src/main/java/org/apache/camel/component/google/storage/GoogleCloudStorageEndpoint.java b/components/camel-google/camel-google-storage/src/main/java/org/apache/camel/component/google/storage/GoogleCloudStorageEndpoint.java index 41e3e1fea62..a0ee328b685 100644 --- a/components/camel-google/camel-google-storage/src/main/java/org/apache/camel/component/google/storage/GoogleCloudStorageEndpoint.java +++ b/components/camel-google/camel-google-storage/src/main/java/org/apache/camel/component/google/storage/GoogleCloudStorageEndpoint.java @@ -16,6 +16,8 @@ */ package org.apache.camel.component.google.storage; +import java.util.Map; + import com.google.cloud.storage.Bucket; import com.google.cloud.storage.BucketInfo; import com.google.cloud.storage.BucketInfo.Builder; @@ -33,8 +35,6 @@ import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Map; - /** * Store and retrieve objects from Google Cloud Storage Service using the google-cloud-storage library. * @@ -126,9 +126,10 @@ public class GoogleCloudStorageEndpoint extends ScheduledPollEndpoint implements @Override public String getServiceUrl() { - if (ObjectHelper.isNotEmpty(configuration.getBucketName()) && ObjectHelper.isNotEmpty(configuration.getStorageLocation())) { + if (ObjectHelper.isNotEmpty(configuration.getBucketName()) + && ObjectHelper.isNotEmpty(configuration.getStorageLocation())) { return getServiceProtocol() + ":" + configuration.getStorageLocation() + ":" - + configuration.getBucketName(); + + configuration.getBucketName(); } return null; }