# ============LICENSE_START=======================================================\r
# feature-active-standby-management\r
# ================================================================================\r
-# Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved.\r
+# Copyright (C) 2017, 2019, 2021 AT&T Intellectual Property. All rights reserved.\r
# ================================================================================\r
# Licensed under the Apache License, Version 2.0 (the "License");\r
# you may not use this file except in compliance with the License.\r
###\r
\r
# DB properties\r
+eclipselink.target-database=MySQL\r
javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver\r
javax.persistence.jdbc.url=jdbc:mariadb://${env:SQL_HOST}:3306/activestandbymanagement\r
javax.persistence.jdbc.user=${env:SQL_USER}\r
# Need long timeout, because testTransaction is only run every 10 seconds.\r
pdp.timeout=15000\r
#how long do we wait for the pdp table to populate on initial startup\r
-pdp.initialWait=20000
\ No newline at end of file
+pdp.initialWait=20000\r
* ============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.
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;
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);
* ============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.
package org.onap.policy.drools.activestandby;
import java.util.Properties;
+import org.eclipse.persistence.config.PersistenceUnitProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* 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;
# ============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.
###
# 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
# 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
# ============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.
###
# 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
# ============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.
###
# 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
# 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
# ============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.
###
# 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
# ============LICENSE_START=======================================================
# feature-distributed-locking
# ================================================================================
-# Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2018-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.
###
#Database properties
+eclipselink.target-database=MySQL
javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver
javax.persistence.jdbc.url=jdbc:mariadb://${env:SQL_HOST}:3306/pooling
javax.persistence.jdbc.user=${env:SQL_USER}
* ============LICENSE_START=======================================================
* feature-distributed-locking
* ================================================================================
- * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-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.
import java.util.Properties;
import lombok.Getter;
import lombok.Setter;
+import org.eclipse.persistence.config.PersistenceUnitProperties;
import org.onap.policy.common.utils.properties.BeanConfigurator;
import org.onap.policy.common.utils.properties.Property;
import org.onap.policy.common.utils.properties.exception.PropertyException;
public class DistributedLockProperties {
public static final String PREFIX = "distributed.locking.";
- 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_PASS = "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_PASS = PersistenceUnitProperties.JDBC_PASSWORD;
public static final String EXPIRE_CHECK_SEC = PREFIX + "expire.check.seconds";
public static final String RETRY_SEC = PREFIX + "retry.seconds";
public static final String MAX_RETRIES = PREFIX + "max.retries";
# ============LICENSE_START=======================================================
# feature-distributed-locking
# ================================================================================
-# Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2018-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.
# ============LICENSE_END=========================================================
###
+eclipselink.target-database=Auto
javax.persistence.jdbc.driver=org.h2.Driver
javax.persistence.jdbc.url=jdbc:h2:mem:pooling
javax.persistence.jdbc.user=user
============LICENSE_START=======================================================
ONAP Policy Engine - Drools PDP
================================================================================
- 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.
Modifications Copyright (C) 2020 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<scope>provided</scope>
+ <!--
+ Exclude this because it's incompatible with eclipselink, which already
+ includes the same classes.
+ -->
+ <exclusions>
+ <exclusion>
+ <groupId>javax.persistence</groupId>
+ <artifactId>javax.persistence-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.hibernate.common</groupId>
# ============LICENSE_START=======================================================
# feature-session-persistence
# ================================================================================
-# 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.
# ============LICENSE_END=========================================================
###
+eclipselink.target-database=MySQL
javax.persistence.jdbc.driver= org.mariadb.jdbc.Driver
javax.persistence.jdbc.url=jdbc:mariadb://${env:SQL_HOST}:3306/sessionpersistence
javax.persistence.jdbc.user=${env:SQL_USER}
* ============LICENSE_START=======================================================
* feature-session-persistence
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018, 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.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
package org.onap.policy.drools.persistence;
+import org.eclipse.persistence.config.PersistenceUnitProperties;
+
public class DroolsPersistenceProperties {
/*
* feature-session-persistence.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_SESSIONINFO_TIMEOUT = "persistence.sessioninfo.timeout";
public static final String JTA_OBJECTSTORE_DIR = "persistence.objectstore.dir";
# ============LICENSE_START=======================================================
# feature-session-persistence
# ================================================================================
-# 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.
# ============LICENSE_END=========================================================
###
+eclipselink.target-database=Auto
javax.persistence.jdbc.driver=org.h2.Driver
javax.persistence.jdbc.url=jdbc:h2:mem:TestPersistenceFeature
javax.persistence.jdbc.user=testuser
# ============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.
###
# 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}
* ============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.
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);
* ============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.
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;
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";
# ============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.
###
# 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
============LICENSE_START=======================================================
ONAP Policy Engine - Drools PDP
================================================================================
- Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
+ Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2019 Bell Canada.
Modifications Copyright (C) 2020 Nordix Foundation.
================================================================================
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-persistence-jpa</artifactId>
+ <!--
+ Exclude this because it's incompatible with eclipselink, which already
+ includes the same classes.
+ -->
+ <exclusions>
+ <exclusion>
+ <groupId>javax.persistence</groupId>
+ <artifactId>javax.persistence-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
============LICENSE_START=======================================================
ONAP Policy Engine - Drools PDP
================================================================================
- Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
+ Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2020 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
+ <!--
+ Exclude this because it's incompatible with eclipselink, which already
+ includes the same classes.
+ -->
+ <exclusions>
+ <exclusion>
+ <groupId>javax.persistence</groupId>
+ <artifactId>javax.persistence-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>