summaryrefslogtreecommitdiffstats
path: root/feature-state-management
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-02-09 11:01:43 -0500
committerJim Hahn <jrh3@att.com>2021-02-09 15:45:13 -0500
commit6127b4d50fccaa2e59f9e40910861260eb695c15 (patch)
tree0bd2ee574316e82db5538332bb7bd87f4b479a10 /feature-state-management
parent208be1c545895cf61bc38fbc7bc5e9e45d085016 (diff)
Upgrade dependencies
Changes to eclipselink are incompatible with javax-persistence-api so removed the latter. Also added target-database property. Also replaced string constants with eclipselink constants. Per review comments, moved target-database values to property files. Issue-ID: POLICY-3005 Change-Id: I043203a952d54406a5996c1e8b5ba8936bf558c0 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'feature-state-management')
-rw-r--r--feature-state-management/src/main/feature/config/feature-state-management.properties3
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java3
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java12
-rw-r--r--feature-state-management/src/test/resources/feature-state-management.properties3
4 files changed, 13 insertions, 8 deletions
diff --git a/feature-state-management/src/main/feature/config/feature-state-management.properties b/feature-state-management/src/main/feature/config/feature-state-management.properties
index d2df6c52..84309e41 100644
--- a/feature-state-management/src/main/feature/config/feature-state-management.properties
+++ b/feature-state-management/src/main/feature/config/feature-state-management.properties
@@ -2,7 +2,7 @@
# ============LICENSE_START=======================================================
# feature-state-management
# ================================================================================
-# Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
###
# DB properties
+eclipselink.target-database=MySQL
javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver
javax.persistence.jdbc.url=jdbc:mariadb://${env:SQL_HOST}:3306/statemanagement
javax.persistence.jdbc.user=${env:SQL_USER}
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java
index 08c8e3a5..081a8292 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* feature-state-management
* ================================================================================
- * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -116,6 +116,7 @@ public class DroolsPdpIntegrityMonitor extends IntegrityMonitor {
checkPropError(stateManagementProperties, StateManagementProperties.SITE_NAME);
checkPropError(stateManagementProperties, StateManagementProperties.NODE_TYPE);
checkPropError(stateManagementProperties, StateManagementProperties.DEPENDENCY_GROUPS);
+ checkPropError(stateManagementProperties, StateManagementProperties.DB_TYPE);
checkPropError(stateManagementProperties, StateManagementProperties.DB_DRIVER);
checkPropError(stateManagementProperties, StateManagementProperties.DB_URL);
checkPropError(stateManagementProperties, StateManagementProperties.DB_USER);
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java
index d7f15883..20494b0f 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* feature-state-management
* ================================================================================
- * Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018, 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
package org.onap.policy.drools.statemanagement;
import java.util.Properties;
+import org.eclipse.persistence.config.PersistenceUnitProperties;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -33,10 +34,11 @@ public class StateManagementProperties {
public static final String NODE_TYPE = "node_type";
public static final String SITE_NAME = "site_name";
- public static final String DB_DRIVER = "javax.persistence.jdbc.driver";
- public static final String DB_URL = "javax.persistence.jdbc.url";
- public static final String DB_USER = "javax.persistence.jdbc.user";
- public static final String DB_PWD = "javax.persistence.jdbc.password";
+ public static final String DB_DRIVER = PersistenceUnitProperties.JDBC_DRIVER;
+ public static final String DB_URL = PersistenceUnitProperties.JDBC_URL;
+ public static final String DB_USER = PersistenceUnitProperties.JDBC_USER;
+ public static final String DB_PWD = PersistenceUnitProperties.JDBC_PASSWORD;
+ public static final String DB_TYPE = PersistenceUnitProperties.TARGET_DATABASE;
public static final String TEST_SERVICES = PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES;
public static final String TEST_SERVICES_DEFAULT = "TEST";
diff --git a/feature-state-management/src/test/resources/feature-state-management.properties b/feature-state-management/src/test/resources/feature-state-management.properties
index 5e1864a3..ef7b805a 100644
--- a/feature-state-management/src/test/resources/feature-state-management.properties
+++ b/feature-state-management/src/test/resources/feature-state-management.properties
@@ -2,7 +2,7 @@
# ============LICENSE_START=======================================================
# feature-state-management
# ================================================================================
-# Copyright (C) 2017, 2020 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017, 2020-2021 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
###
# DB properties
+eclipselink.target-database=Auto
javax.persistence.jdbc.driver = org.h2.Driver
javax.persistence.jdbc.url = jdbc:h2:mem:statemanagement
javax.persistence.jdbc.user = sa