Update groupId to org.onap.ccsdk.sli
[ccsdk/sli/core.git] / dblib / provider / src / main / java / org / openecomp / sdnc / sli / resource / dblib / config / DbConfigPool.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * openecomp
4  * ================================================================================
5  * Copyright (C) 2016 - 2017 AT&T
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdnc.sli.resource.dblib.config;
22
23 import java.util.ArrayList;
24 import java.util.Properties;
25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory;
27
28 public class DbConfigPool {
29         private static Logger LOGGER = LoggerFactory.getLogger(DbConfigPool.class);
30
31         private final String type;
32
33         private ArrayList<BaseDBConfiguration> configurations = new ArrayList<BaseDBConfiguration>();
34
35         public DbConfigPool(Properties properties) {
36                 LOGGER.debug("Initializing DbConfigType");
37                 type = properties.getProperty(BaseDBConfiguration.DATABASE_TYPE, "JDBC").toUpperCase();
38         }
39
40         public int getTimeout() {
41                 // TODO Auto-generated method stub
42                 return 0;
43         }
44
45         public String getType() {
46                 return type;
47         }
48
49         public JDBCConfiguration[] getJDBCbSourceArray() {
50                 return configurations.toArray(new JDBCConfiguration[configurations.size()]);
51         }
52
53         public void addConfiguration(BaseDBConfiguration config) {
54                 configurations.add(config);
55         }
56 }