diff options
author | Ram Krishna Verma <ram_krishna.verma@bell.ca> | 2021-02-09 21:53:28 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-02-09 21:53:28 +0000 |
commit | c3c83896d877602ead85c32215761b3d3555facb (patch) | |
tree | 65071b96574d23609b64384a2e18b5018508a79b /feature-active-standby-management/src | |
parent | 13ab17b2050ecfe5265c8fc347fa0960bac185d7 (diff) | |
parent | 6127b4d50fccaa2e59f9e40910861260eb695c15 (diff) |
Merge "Upgrade dependencies"
Diffstat (limited to 'feature-active-standby-management/src')
7 files changed, 32 insertions, 22 deletions
diff --git a/feature-active-standby-management/src/main/feature/config/feature-active-standby-management.properties b/feature-active-standby-management/src/main/feature/config/feature-active-standby-management.properties index abd76fc0..e01dc9d9 100644 --- a/feature-active-standby-management/src/main/feature/config/feature-active-standby-management.properties +++ b/feature-active-standby-management/src/main/feature/config/feature-active-standby-management.properties @@ -2,7 +2,7 @@ # ============LICENSE_START=======================================================
# feature-active-standby-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/activestandbymanagement
javax.persistence.jdbc.user=${env:SQL_USER}
@@ -36,4 +37,4 @@ pdp.updateInterval=2500 # Need long timeout, because testTransaction is only run every 10 seconds.
pdp.timeout=15000
#how long do we wait for the pdp table to populate on initial startup
-pdp.initialWait=20000
\ No newline at end of file +pdp.initialWait=20000
diff --git a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java index 7e853990..bd3f0215 100644 --- a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java +++ b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * feature-active-standby-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. @@ -26,6 +26,7 @@ import java.util.Map; import java.util.Properties; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; +import org.eclipse.persistence.config.PersistenceUnitProperties; import org.onap.policy.common.im.MonitorTime; import org.onap.policy.drools.core.PolicySessionFeatureApi; import org.onap.policy.drools.features.PolicyEngineFeatureApi; @@ -187,14 +188,16 @@ public class ActiveStandbyFeature implements ActiveStandbyFeatureApi, public static DroolsPdpsConnector getDroolsPdpsConnector(String pu) { Map<String, Object> propMap = new HashMap<>(); - propMap.put("javax.persistence.jdbc.driver", ActiveStandbyProperties - .getProperty(ActiveStandbyProperties.DB_DRIVER)); - propMap.put("javax.persistence.jdbc.url", - ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_URL)); - propMap.put("javax.persistence.jdbc.user", ActiveStandbyProperties - .getProperty(ActiveStandbyProperties.DB_USER)); - propMap.put("javax.persistence.jdbc.password", - ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_PWD)); + propMap.put(PersistenceUnitProperties.JDBC_DRIVER, + ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_DRIVER)); + propMap.put(PersistenceUnitProperties.JDBC_URL, + ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_URL)); + propMap.put(PersistenceUnitProperties.JDBC_USER, + ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_USER)); + propMap.put(PersistenceUnitProperties.JDBC_PASSWORD, + ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_PWD)); + propMap.put(PersistenceUnitProperties.TARGET_DATABASE, + ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_TYPE)); EntityManagerFactory emf = Persistence.createEntityManagerFactory( pu, propMap); diff --git a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyProperties.java b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyProperties.java index 3a0ba4d1..ebe57567 100644 --- a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyProperties.java +++ b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyProperties.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * feature-active-standby-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. @@ -21,6 +21,7 @@ package org.onap.policy.drools.activestandby; import java.util.Properties; +import org.eclipse.persistence.config.PersistenceUnitProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,10 +40,11 @@ public class ActiveStandbyProperties { /* * feature-active-standby-management.properties parameter key values */ - 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; private static Properties properties = null; diff --git a/feature-active-standby-management/src/test/resources/asw/feature-active-standby-management.properties b/feature-active-standby-management/src/test/resources/asw/feature-active-standby-management.properties index 9b01736c..23a1f6db 100644 --- a/feature-active-standby-management/src/test/resources/asw/feature-active-standby-management.properties +++ b/feature-active-standby-management/src/test/resources/asw/feature-active-standby-management.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-active-standby-management # ================================================================================ -# Copyright (C) 2017 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. @@ -19,6 +19,7 @@ ### # DB properties +eclipselink.target-database=Auto javax.persistence.jdbc.driver = org.h2.Driver javax.persistence.jdbc.url = jdbc:h2:mem:asw_activestandbymanagement javax.persistence.jdbc.user = sa @@ -36,4 +37,4 @@ pdp.updateInterval=1000 # Need long timeout, because testTransaction is only run every 1 seconds. pdp.timeout=3000 #how long do we wait for the pdp table to populate on initial startup -pdp.initialWait=1000
\ No newline at end of file +pdp.initialWait=1000 diff --git a/feature-active-standby-management/src/test/resources/asw/feature-state-management.properties b/feature-active-standby-management/src/test/resources/asw/feature-state-management.properties index a5403c9f..e03ebd2b 100644 --- a/feature-active-standby-management/src/test/resources/asw/feature-state-management.properties +++ b/feature-active-standby-management/src/test/resources/asw/feature-state-management.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-active-standby-management # ================================================================================ -# Copyright (C) 2017 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. @@ -19,6 +19,7 @@ ### # DB properties +eclipselink.target-database=Auto javax.persistence.jdbc.driver = org.h2.Driver javax.persistence.jdbc.url = jdbc:h2:mem:asw_statemanagement javax.persistence.jdbc.user = sa diff --git a/feature-active-standby-management/src/test/resources/feature-active-standby-management.properties b/feature-active-standby-management/src/test/resources/feature-active-standby-management.properties index 9e481b59..5a1f9607 100644 --- a/feature-active-standby-management/src/test/resources/feature-active-standby-management.properties +++ b/feature-active-standby-management/src/test/resources/feature-active-standby-management.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-active-standby-management # ================================================================================ -# Copyright (C) 2017 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. @@ -19,6 +19,7 @@ ### # DB properties +eclipselink.target-database=Auto javax.persistence.jdbc.driver = org.h2.Driver javax.persistence.jdbc.url = jdbc:h2:mem:activestandbymanagement javax.persistence.jdbc.user = sa @@ -35,4 +36,4 @@ pdp.updateInterval=1000 # Need long timeout, because testTransaction is only run every 10 seconds. pdp.timeout=3000 #how long do we wait for the pdp table to populate on initial startup -pdp.initialWait=1000
\ No newline at end of file +pdp.initialWait=1000 diff --git a/feature-active-standby-management/src/test/resources/feature-state-management.properties b/feature-active-standby-management/src/test/resources/feature-state-management.properties index d6843919..6e4f61f3 100644 --- a/feature-active-standby-management/src/test/resources/feature-state-management.properties +++ b/feature-active-standby-management/src/test/resources/feature-state-management.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-active-standby-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=Auto javax.persistence.jdbc.driver = org.h2.Driver javax.persistence.jdbc.url = jdbc:h2:mem:statemanagement javax.persistence.jdbc.user = sa |