diff options
Diffstat (limited to 'dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config')
2 files changed, 44 insertions, 3 deletions
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/BaseDBConfiguration.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/BaseDBConfiguration.java index 967059a3..ea6bc450 100755 --- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/BaseDBConfiguration.java +++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/BaseDBConfiguration.java @@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory; */ public abstract class BaseDBConfiguration { - private Logger logger = LoggerFactory.getLogger(BaseDBConfiguration.class); + private static final Logger LOGGER = LoggerFactory.getLogger(BaseDBConfiguration.class); /** * Property key within a properties configuration File for db type */ @@ -134,7 +134,7 @@ public abstract class BaseDBConfiguration { String value = properties.getProperty(CONNECTION_TIMEOUT, DEFAULT_REJECT_CHANGE_VALUE); return Integer.parseInt(value); } catch (Exception exc) { - logger.error("Exception",exc); + LOGGER.error("Exception",exc); return Integer.parseInt(DEFAULT_REJECT_CHANGE_VALUE); } } @@ -150,7 +150,7 @@ public abstract class BaseDBConfiguration { String value = properties.getProperty(REQUEST_TIMEOUT, DEFAULT_REJECT_CHANGE_VALUE); return Integer.parseInt(value); } catch (Exception exc) { - logger.error("Exception",exc); + LOGGER.error("Exception",exc); return Integer.parseInt(DEFAULT_REJECT_CHANGE_VALUE); } } @@ -247,4 +247,12 @@ public abstract class BaseDBConfiguration { public String getDbUrl() { return properties.getProperty(DATABASE_URL); } + + public boolean containsKey(String propertyname) { + return properties.containsKey(propertyname); + } + + public String getProperty(String propertyname) { + return properties.getProperty(propertyname); + } } diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/TerminatingConfiguration.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/TerminatingConfiguration.java new file mode 100755 index 00000000..1ebd1441 --- /dev/null +++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/TerminatingConfiguration.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * onap + * ================================================================================ + * Copyright (C) 2016 - 2017 ONAP + * ================================================================================ + * Modifications Copyright (C) 2018 IBM. + * ================================================================================ + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.core.dblib.config; + +import java.util.Properties; + +public class TerminatingConfiguration extends BaseDBConfiguration { + + public TerminatingConfiguration() { + super(new Properties()); + } + +} |