From d073fa7702f1b2017912fef37d7c28b1982d8c62 Mon Sep 17 00:00:00 2001 From: Gwenneg Lepage Date: Fri, 2 Feb 2024 10:51:12 +0100 Subject: [PATCH] Rename module --- .../pom.xml | 10 +++++++++- .../notifications/connector/secrets}/Secret.java | 2 +- .../connector/secrets/SecretsExchangeProperty.java | 4 ++-- .../connector/secrets/SecretsProcessor.java | 13 ++++++------- .../connector/secrets}/SourcesClient.java | 2 +- connector-servicenow/pom.xml | 2 +- connector-splunk/pom.xml | 2 +- .../splunk/SplunkCloudEventDataExtractor.java | 4 ++-- .../connector/splunk/SplunkRouteBuilder.java | 8 ++++---- connector-webhook/pom.xml | 2 +- pom.xml | 2 +- 11 files changed, 29 insertions(+), 22 deletions(-) rename {connector-common-sources => connector-common-secrets}/pom.xml (87%) rename {connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources => connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets}/Secret.java (76%) rename connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/SourcesExchangeProperty.java => connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/SecretsExchangeProperty.java (66%) rename connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/SourcesProcessor.java => connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/SecretsProcessor.java (75%) rename {connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources => connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets}/SourcesClient.java (98%) diff --git a/connector-common-sources/pom.xml b/connector-common-secrets/pom.xml similarity index 87% rename from connector-common-sources/pom.xml rename to connector-common-secrets/pom.xml index 10135ea3c6..098435a348 100644 --- a/connector-common-sources/pom.xml +++ b/connector-common-secrets/pom.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - notifications-connector-common-sources + notifications-connector-common-secrets com.redhat.cloud.notifications @@ -16,6 +16,14 @@ + + + com.redhat.cloud.notifications + notifications-connector-common + ${project.version} + + + io.quarkus quarkus-hibernate-validator diff --git a/connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/Secret.java b/connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/Secret.java similarity index 76% rename from connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/Secret.java rename to connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/Secret.java index 90c8220f8c..b057f4ec1e 100644 --- a/connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/Secret.java +++ b/connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/Secret.java @@ -1,4 +1,4 @@ -package com.redhat.cloud.notifications.connector.sources; +package com.redhat.cloud.notifications.connector.secrets; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; diff --git a/connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/SourcesExchangeProperty.java b/connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/SecretsExchangeProperty.java similarity index 66% rename from connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/SourcesExchangeProperty.java rename to connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/SecretsExchangeProperty.java index bd9f052239..dbc97f1cfe 100644 --- a/connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/SourcesExchangeProperty.java +++ b/connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/SecretsExchangeProperty.java @@ -1,6 +1,6 @@ -package com.redhat.cloud.notifications.connector.sources; +package com.redhat.cloud.notifications.connector.secrets; -public class SourcesExchangeProperty { +public class SecretsExchangeProperty { public static final String SECRET_ID = "secretId"; public static final String SECRET_PASSWORD = "secretPassword"; diff --git a/connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/SourcesProcessor.java b/connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/SecretsProcessor.java similarity index 75% rename from connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/SourcesProcessor.java rename to connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/SecretsProcessor.java index 109a0fd283..779b487eda 100644 --- a/connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/SourcesProcessor.java +++ b/connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/SecretsProcessor.java @@ -1,6 +1,5 @@ -package com.redhat.cloud.notifications.connector.sources; +package com.redhat.cloud.notifications.connector.secrets; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import org.apache.camel.Exchange; @@ -9,14 +8,14 @@ import org.eclipse.microprofile.rest.client.inject.RestClient; import static com.redhat.cloud.notifications.connector.ExchangeProperty.ORG_ID; -import static com.redhat.cloud.notifications.connector.sources.SourcesExchangeProperty.SECRET_ID; -import static com.redhat.cloud.notifications.connector.sources.SourcesExchangeProperty.SECRET_PASSWORD; -import static com.redhat.cloud.notifications.connector.sources.SourcesExchangeProperty.SECRET_USERNAME; +import static com.redhat.cloud.notifications.connector.secrets.SecretsExchangeProperty.SECRET_ID; +import static com.redhat.cloud.notifications.connector.secrets.SecretsExchangeProperty.SECRET_PASSWORD; +import static com.redhat.cloud.notifications.connector.secrets.SecretsExchangeProperty.SECRET_USERNAME; @ApplicationScoped -public class SourcesProcessor implements Processor { +public class SecretsProcessor implements Processor { - private static final String SOURCES_ENABLED = "notifications.connector.sources.enabled"; + private static final String SOURCES_ENABLED = "notifications.connector.secrets.enabled"; private static final String SOURCES_PSK = "notifications.connector.sources.psk"; @ConfigProperty(name = SOURCES_ENABLED, defaultValue = "false") diff --git a/connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/SourcesClient.java b/connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/SourcesClient.java similarity index 98% rename from connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/SourcesClient.java rename to connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/SourcesClient.java index 2ea4ebfbb7..92e74a5d36 100644 --- a/connector-common-sources/src/main/java/com/redhat/cloud/notifications/connector/sources/SourcesClient.java +++ b/connector-common-secrets/src/main/java/com/redhat/cloud/notifications/connector/secrets/SourcesClient.java @@ -1,4 +1,4 @@ -package com.redhat.cloud.notifications.connector.sources; +package com.redhat.cloud.notifications.connector.secrets; import io.quarkus.rest.client.reactive.ClientExceptionMapper; import jakarta.validation.constraints.NotBlank; diff --git a/connector-servicenow/pom.xml b/connector-servicenow/pom.xml index c84b87789f..e01c47cb37 100644 --- a/connector-servicenow/pom.xml +++ b/connector-servicenow/pom.xml @@ -61,7 +61,7 @@ com.redhat.cloud.notifications - notifications-connector-common-sources + notifications-connector-common-secrets ${project.version} diff --git a/connector-splunk/pom.xml b/connector-splunk/pom.xml index 8244be9015..fa2f6535fe 100644 --- a/connector-splunk/pom.xml +++ b/connector-splunk/pom.xml @@ -61,7 +61,7 @@ com.redhat.cloud.notifications - notifications-connector-common-sources + notifications-connector-common-secrets ${project.version} diff --git a/connector-splunk/src/main/java/com/redhat/cloud/notifications/connector/splunk/SplunkCloudEventDataExtractor.java b/connector-splunk/src/main/java/com/redhat/cloud/notifications/connector/splunk/SplunkCloudEventDataExtractor.java index ef720673ec..577d9bc4c0 100644 --- a/connector-splunk/src/main/java/com/redhat/cloud/notifications/connector/splunk/SplunkCloudEventDataExtractor.java +++ b/connector-splunk/src/main/java/com/redhat/cloud/notifications/connector/splunk/SplunkCloudEventDataExtractor.java @@ -8,8 +8,8 @@ import org.apache.http.ProtocolException; import static com.redhat.cloud.notifications.connector.ExchangeProperty.TARGET_URL; -import static com.redhat.cloud.notifications.connector.sources.SourcesExchangeProperty.SECRET_ID; -import static com.redhat.cloud.notifications.connector.sources.SourcesExchangeProperty.SECRET_PASSWORD; +import static com.redhat.cloud.notifications.connector.secrets.SecretsExchangeProperty.SECRET_ID; +import static com.redhat.cloud.notifications.connector.secrets.SecretsExchangeProperty.SECRET_PASSWORD; import static com.redhat.cloud.notifications.connector.splunk.ExchangeProperty.ACCOUNT_ID; import static com.redhat.cloud.notifications.connector.splunk.ExchangeProperty.TARGET_URL_NO_SCHEME; import static com.redhat.cloud.notifications.connector.splunk.ExchangeProperty.TRUST_ALL; diff --git a/connector-splunk/src/main/java/com/redhat/cloud/notifications/connector/splunk/SplunkRouteBuilder.java b/connector-splunk/src/main/java/com/redhat/cloud/notifications/connector/splunk/SplunkRouteBuilder.java index bc3450422a..f5b0fac12b 100644 --- a/connector-splunk/src/main/java/com/redhat/cloud/notifications/connector/splunk/SplunkRouteBuilder.java +++ b/connector-splunk/src/main/java/com/redhat/cloud/notifications/connector/splunk/SplunkRouteBuilder.java @@ -2,7 +2,7 @@ import com.redhat.cloud.notifications.connector.EngineToConnectorRouteBuilder; import com.redhat.cloud.notifications.connector.http.HttpConnectorConfig; -import com.redhat.cloud.notifications.connector.sources.SourcesProcessor; +import com.redhat.cloud.notifications.connector.secrets.SecretsProcessor; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import org.apache.http.conn.ssl.NoopHostnameVerifier; @@ -12,7 +12,7 @@ import static com.redhat.cloud.notifications.connector.ExchangeProperty.ORG_ID; import static com.redhat.cloud.notifications.connector.ExchangeProperty.TARGET_URL; import static com.redhat.cloud.notifications.connector.http.SslTrustAllManager.getSslContextParameters; -import static com.redhat.cloud.notifications.connector.sources.SourcesExchangeProperty.SECRET_PASSWORD; +import static com.redhat.cloud.notifications.connector.secrets.SecretsExchangeProperty.SECRET_PASSWORD; import static com.redhat.cloud.notifications.connector.splunk.ExchangeProperty.ACCOUNT_ID; import static com.redhat.cloud.notifications.connector.splunk.ExchangeProperty.TARGET_URL_NO_SCHEME; import static com.redhat.cloud.notifications.connector.splunk.ExchangeProperty.TRUST_ALL; @@ -33,14 +33,14 @@ public class SplunkRouteBuilder extends EngineToConnectorRouteBuilder { EventsSplitter eventsSplitter; @Inject - SourcesProcessor sourcesProcessor; + SecretsProcessor secretsProcessor; @Override public void configureRoutes() { from(seda(ENGINE_TO_CONNECTOR)) .routeId(connectorConfig.getConnectorName()) - .process(sourcesProcessor) + .process(secretsProcessor) // Events are split to be sent in batch to Splunk HEC. .process(eventsSplitter) .setHeader("Authorization", simple("Splunk ${exchangeProperty." + SECRET_PASSWORD + "}")) diff --git a/connector-webhook/pom.xml b/connector-webhook/pom.xml index d566cc26e3..12c0a6a2f8 100644 --- a/connector-webhook/pom.xml +++ b/connector-webhook/pom.xml @@ -61,7 +61,7 @@ com.redhat.cloud.notifications - notifications-connector-common-sources + notifications-connector-common-secrets ${project.version} diff --git a/pom.xml b/pom.xml index a482ec600c..571c7c7334 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ common-aggregator connector-common connector-common-http - connector-common-sources + connector-common-secrets connector-drawer connector-email connector-google-chat