diff options
Diffstat (limited to 'controlloop/common/eventmanager/src/main/java')
2 files changed, 12 insertions, 2 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 f2feef666..52a869597 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 @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 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. @@ -321,9 +321,11 @@ public class OperationHistoryDataManagerImpl implements OperationHistoryDataMana */ private Properties toProperties(OperationHistoryDataManagerParams params) { Properties props = new Properties(); + props.put(PersistenceUnitProperties.JDBC_DRIVER, params.getDriver()); props.put(PersistenceUnitProperties.JDBC_URL, params.getUrl()); props.put(PersistenceUnitProperties.JDBC_USER, params.getUserName()); props.put(PersistenceUnitProperties.JDBC_PASSWORD, params.getPassword()); + props.put(PersistenceUnitProperties.TARGET_DATABASE, params.getDbType()); props.put(PersistenceUnitProperties.CLASSLOADER, getClass().getClassLoader()); return 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 fc919d845..c93ac8b58 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 @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 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. @@ -40,6 +40,8 @@ import org.onap.policy.common.parameters.annotations.NotNull; @AllArgsConstructor 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 = "MySQL"; @NotBlank private String url; @@ -52,6 +54,12 @@ public class OperationHistoryDataManagerParams { @Builder.Default private String persistenceUnit = DEFAULT_PU; + @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. |