2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2016 - 2017 ONAP
6 * ================================================================================
7 * Modifications Copyright (C) 2018 IBM.
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.ccsdk.sli.core.dblib.config;
25 import java.util.ArrayList;
26 import java.util.Properties;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
30 public class DbConfigPool {
31 private static Logger log = LoggerFactory.getLogger(DbConfigPool.class);
32 private final String type;
33 private static final int timeOut=0;
34 private ArrayList<BaseDBConfiguration> configurations = new ArrayList<>();
36 public DbConfigPool(Properties properties) {
37 log.debug("Initializing DbConfigType");
38 type = properties.getProperty(BaseDBConfiguration.DATABASE_TYPE, "JDBC").toUpperCase();
41 public int getTimeout() {
45 public String getType() {
49 public JDBCConfiguration[] getJDBCbSourceArray() {
50 return configurations.toArray(new JDBCConfiguration[configurations.size()]);
53 public void addConfiguration(BaseDBConfiguration config) {
54 configurations.add(config);