aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop')
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImpl.java9
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParams.java14
-rw-r--r--controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml2
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImplTest.java1
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java8
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties1
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties1
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-CL-topic.properties2
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-READ-topic.properties1
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-WRITE-topic.properties1
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_CL_RSP-topic.properties1
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_TOPIC-topic.properties1
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/POLICY-CL-MGT-topic.properties1
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-RSP-topic.properties1
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-topic.properties1
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties3
16 files changed, 21 insertions, 27 deletions
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImpl.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImpl.java
index 16cf527d5..1f6dfdca3 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImpl.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImpl.java
@@ -3,7 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -85,14 +85,14 @@ public class OperationHistoryDataManagerImpl implements OperationHistoryDataMana
/**
* Number of records that have been inserted into the DB by this data manager
- * instance, whether or not they were committed.
+ * instance, whether they were committed.
*/
@Getter
private long recordsInserted = 0;
/**
* Number of records that have been updated within the DB by this data manager
- * instance, whether or not they were committed.
+ * instance, whether they were committed.
*/
@Getter
private long recordsUpdated = 0;
@@ -317,7 +317,6 @@ public class OperationHistoryDataManagerImpl implements OperationHistoryDataMana
props.put("jakarta.persistence.jdbc.url", params.getUrl());
props.put("jakarta.persistence.jdbc.user", params.getUserName());
props.put("jakarta.persistence.jdbc.password", params.getPassword());
- props.put("hibernate.dialect", params.getDbHibernateDialect());
return props;
}
@@ -337,6 +336,8 @@ public class OperationHistoryDataManagerImpl implements OperationHistoryDataMana
// the following may be overridden by junit tests
protected EntityManagerFactory makeEntityManagerFactory(String opsHistPu, Properties props) {
+ logger.info("Starting persistence unit {}", opsHistPu);
+ logger.info("Properties {}", props);
return Persistence.createEntityManagerFactory(opsHistPu, props);
}
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParams.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParams.java
index 054f4b1c1..1ea83761c 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParams.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParams.java
@@ -3,7 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,7 +42,6 @@ import org.onap.policy.common.parameters.annotations.NotNull;
public class OperationHistoryDataManagerParams {
public static final String DEFAULT_PU = "OperationsHistoryPU";
public static final String DEFAULT_DRIVER = "org.mariadb.jdbc.Driver";
- public static final String DEFAULT_TYPE = "MariaDB";
@NotBlank
private String url;
@@ -58,9 +57,6 @@ public class OperationHistoryDataManagerParams {
@Builder.Default
private String driver = DEFAULT_DRIVER;
- @Builder.Default
- private String dbType = DEFAULT_TYPE;
-
/**
* Maximum number of records that can be waiting to be inserted into the DB. When the
* limit is reached, the oldest records are discarded.
@@ -86,12 +82,4 @@ public class OperationHistoryDataManagerParams {
public ValidationResult validate(String resultName) {
return new BeanValidator().validateTop(resultName, this);
}
-
- /**
- * Return the Hibernate dialect for the database type.
- * @return the dialect
- */
- public Object getDbHibernateDialect() {
- return "org.hibernate.dialect." + dbType + "Dialect";
- }
}
diff --git a/controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml b/controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml
index fd0ab088b..9a3e03488 100644
--- a/controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml
+++ b/controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml
@@ -27,7 +27,7 @@
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>org.onap.policy.guard.OperationsHistory</class>
<properties>
- <property name="jakarta.persistence.schema-generation.database.action" value="create"/>
+ <property name="jakarta.persistence.schema-generation.database.action" value="none"/>
<property name="hibernate.show_sql" value="false"/>
</properties>
</persistence-unit>
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImplTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImplTest.java
index a9d05bdaf..397c1c5fe 100644
--- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImplTest.java
+++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImplTest.java
@@ -387,7 +387,6 @@ class OperationHistoryDataManagerImplTest {
private static OperationHistoryDataManagerParamsBuilder makeBuilder() {
return OperationHistoryDataManagerParams.builder()
.url("jdbc:h2:mem:" + OperationHistoryDataManagerImplTest.class.getSimpleName())
- .dbType("H2")
.driver("org.h2.Driver")
.userName("sa")
.password("")
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java
index f0159aaff..623df93d0 100644
--- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java
+++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java
@@ -3,7 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,6 @@ class OperationHistoryDataManagerParamsTest {
private static final String MY_PASS = "my-pass";
private static final String MY_PU = "my-pu";
private static final String MY_DRIVER = "my-driver";
- private static final String MY_DB_TYPE = "my-db-type";
private static final String MY_URL = "my-url";
private static final String MY_USER = "my-user";
@@ -56,7 +55,6 @@ class OperationHistoryDataManagerParamsTest {
assertEquals(MY_PASS, params.getPassword());
assertEquals(OperationHistoryDataManagerParams.DEFAULT_PU, params.getPersistenceUnit());
assertEquals(OperationHistoryDataManagerParams.DEFAULT_DRIVER, params.getDriver());
- assertEquals(OperationHistoryDataManagerParams.DEFAULT_TYPE, params.getDbType());
assertEquals(MY_URL, params.getUrl());
assertEquals(MY_USER, params.getUserName());
@@ -65,9 +63,6 @@ class OperationHistoryDataManagerParamsTest {
// use specified driver
assertEquals(MY_DRIVER, makeBuilder().driver(MY_DRIVER).build().getDriver());
-
- // use specified DB type
- assertEquals(MY_DB_TYPE, makeBuilder().dbType(MY_DB_TYPE).build().getDbType());
}
@Test
@@ -79,7 +74,6 @@ class OperationHistoryDataManagerParamsTest {
testValidateField("password", "null", params2 -> params2.setPassword(null));
testValidateField("persistenceUnit", "null", params2 -> params2.setPersistenceUnit(null));
testValidateField("driver", "null", params2 -> params2.setDriver(null));
- testValidateField("dbType", "null", params2 -> params2.setDbType(null));
// check edge cases
params.setBatchSize(0);
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties
index 93f564f97..c089e3645 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties
@@ -20,4 +20,5 @@
kafka.source.topics=a1-p-rsp
kafka.source.topics.a1-p-rsp.servers=${env:KAFKA_SERVERS}
kafka.source.topics.a1-p-rsp.https=${env:KAFKA_HTTPS:false}
+kafka.source.topics.a1-p-rsp.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties
index fc1bcf688..360db50bc 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties
@@ -20,4 +20,5 @@
kafka.sink.topics=a1-p
kafka.sink.topics.a1-p.servers=${env:KAFKA_SERVERS}
kafka.sink.topics.a1-p.https=${env:KAFKA_HTTPS:false}
+kafka.sink.topics.a1-p.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-CL-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-CL-topic.properties
index 8ca73734b..b8401e145 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-CL-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-CL-topic.properties
@@ -20,7 +20,9 @@
kafka.source.topics=appc-cl
kafka.source.topics.appc-cl.servers=${env:KAFKA_SERVERS}
kafka.source.topics.appc-cl.https=${env:KAFKA_HTTPS:false}
+kafka.source.topics.appc-cl.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
kafka.sink.topics=appc-cl
kafka.sink.topics.appc-cl.servers=${env:KAFKA_SERVERS}
kafka.sink.topics.appc-cl.https=${env:KAFKA_HTTPS:false}
+kafka.sink.topics.appc-cl.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-READ-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-READ-topic.properties
index bc775195d..448d16aa2 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-READ-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-READ-topic.properties
@@ -20,3 +20,4 @@
kafka.sink.topics=appc-lcm-read
kafka.sink.topics.appc-lcm-read.servers=${env:KAFKA_SERVERS}
kafka.sink.topics.appc-lcm-read.https=${env:KAFKA_HTTPS:false}
+kafka.sink.topics.appc-lcm-read.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-WRITE-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-WRITE-topic.properties
index 22457f54f..4c75043f0 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-WRITE-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-WRITE-topic.properties
@@ -20,3 +20,4 @@
kafka.source.topics=appc-lcm-write
kafka.source.topics.appc-lcm-write.servers=${env:KAFKA_SERVERS}
kafka.source.topics.appc-lcm-write.https=${env:KAFKA_HTTPS:false}
+kafka.source.topics.appc-lcm-write.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_CL_RSP-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_CL_RSP-topic.properties
index e3572c9c0..9f5a400eb 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_CL_RSP-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_CL_RSP-topic.properties
@@ -20,3 +20,4 @@
kafka.sink.topics=dcae_cl_rsp
kafka.sink.topics.dcae_cl_rsp.servers=${env:KAFKA_SERVERS}
kafka.sink.topics.dcae_cl_rsp.https=${envd:KAFKA_HTTPS:false}
+kafka.sink.topics.dcae_cl_rsp.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_TOPIC-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_TOPIC-topic.properties
index 14fd442be..c7b433cc1 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_TOPIC-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_TOPIC-topic.properties
@@ -22,3 +22,4 @@ kafka.source.topics.dcae_topic.effectiveTopic=${envd:DCAE_TOPIC}
kafka.source.topics.dcae_topic.servers=${env:KAFKA_SERVERS}
kafka.source.topics.dcae_topic.consumerGroup=${envd:DCAE_CONSUMER_GROUP}
kafka.source.topics.dcae_topic.https=${env:KAFKA_HTTPS:false}
+kafka.source.topics.dcae_topic.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/POLICY-CL-MGT-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/POLICY-CL-MGT-topic.properties
index b6c15fc71..477a9da38 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/POLICY-CL-MGT-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/POLICY-CL-MGT-topic.properties
@@ -20,3 +20,4 @@
kafka.sink.topics=policy-cl-mgt
kafka.sink.topics.policy-cl-mgt.servers=${env:KAFKA_SERVERS}
kafka.sink.topics.policy-cl-mgt.https=${env:KAFKA_HTTPS:false}
+kafka.sink.topics.policy-cl-mgt.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-RSP-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-RSP-topic.properties
index 033a6f068..abba1bf09 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-RSP-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-RSP-topic.properties
@@ -20,3 +20,4 @@
kafka.source.topics=sdnr-cl-rsp
kafka.source.topics.sdnr-cl-rsp.servers=${env:KAFKA_SERVERS}
kafka.source.topics.sdnr-cl-rsp.https=${env:KAFKA_HTTPS:false}
+kafka.source.topics.sdnr-cl-rsp.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-topic.properties
index 566070751..f78fe76b7 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-topic.properties
@@ -20,3 +20,4 @@
kafka.sink.topics=sdnr-cl
kafka.sink.topics.sdnr-cl.servers=${env:KAFKA_SERVERS}
kafka.sink.topics.sdnr-cl.https=${env:KAFKA_HTTPS:false}
+kafka.sink.topics.sdnr-cl.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties
index 7124989b5..96d2f9aea 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties
@@ -24,12 +24,13 @@
operation.history.url=${envd:JDBC_URL}operationshistory${envd:JDBC_OPTS}
operation.history.userName=${envd:SQL_USER}
operation.history.password=${envd:SQL_PASSWORD}
+operation.history.driver=${envd:JDBC_DRIVER}
#
# Actor parameters
#
# Note: every operation must have at least one entry, otherwise it will not be
-# configured and started. Thus some of them have a "placeholder" property.
+# configured and started. Thus, some of them have a "placeholder" property.
#
actor.service.XACML.disabled=${envd:GUARD_DISABLED:false}