Skip to content

Commit

Permalink
Rename module
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenneg committed Feb 2, 2024
1 parent 1d6be15 commit d073fa7
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<artifactId>notifications-connector-common-sources</artifactId>
<artifactId>notifications-connector-common-secrets</artifactId>

<parent>
<groupId>com.redhat.cloud.notifications</groupId>
Expand All @@ -16,6 +16,14 @@

<!-- Scope: compile -->

<!-- notifications modules -->
<dependency>
<groupId>com.redhat.cloud.notifications</groupId>
<artifactId>notifications-connector-common</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Quarkus -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-validator</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redhat.cloud.notifications.connector.sources;
package com.redhat.cloud.notifications.connector.secrets;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

Expand Down
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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")
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion connector-servicenow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</dependency>
<dependency>
<groupId>com.redhat.cloud.notifications</groupId>
<artifactId>notifications-connector-common-sources</artifactId>
<artifactId>notifications-connector-common-secrets</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion connector-splunk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</dependency>
<dependency>
<groupId>com.redhat.cloud.notifications</groupId>
<artifactId>notifications-connector-common-sources</artifactId>
<artifactId>notifications-connector-common-secrets</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand 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 + "}"))
Expand Down
2 changes: 1 addition & 1 deletion connector-webhook/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</dependency>
<dependency>
<groupId>com.redhat.cloud.notifications</groupId>
<artifactId>notifications-connector-common-sources</artifactId>
<artifactId>notifications-connector-common-secrets</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<module>common-aggregator</module>
<module>connector-common</module>
<module>connector-common-http</module>
<module>connector-common-sources</module>
<module>connector-common-secrets</module>
<module>connector-drawer</module>
<module>connector-email</module>
<module>connector-google-chat</module>
Expand Down

0 comments on commit d073fa7

Please sign in to comment.