2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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 * ================================================================================
20 package org.openecomp.portalsdk.analytics.system.fusion;
25 import javax.servlet.*;
27 import org.openecomp.portalsdk.analytics.config.*;
28 import org.openecomp.portalsdk.analytics.system.*;
29 import org.openecomp.portalsdk.analytics.system.fusion.adapter.FusionAdapter;
30 import org.openecomp.portalsdk.analytics.system.fusion.adapter.RaptorAdapter;
31 import org.openecomp.portalsdk.analytics.system.fusion.adapter.SpringContext;
32 import org.openecomp.portalsdk.analytics.util.*;
33 import org.springframework.beans.factory.annotation.Autowired;
37 public class DbUtils implements IDbUtils {
40 public RaptorAdapter raptorAdapter;
42 public FusionAdapter fusionAdapter;
46 public void initializeDbUtils(ServletContext servletContext) {
47 raptorAdapter = (RaptorAdapter)SpringContext.getApplicationContext().getBean("raptorAdapter");
48 } // initializeDbUtils
50 public Connection getConnection() {
51 return raptorAdapter.getConnection();
54 public void clearConnection(Connection con) {
55 raptorAdapter.releaseConnection(con);
58 public RaptorAdapter getRaptorAdapter() {
62 public void setRaptorAdapter(RaptorAdapter raptorAdapter) {
63 this.raptorAdapter = raptorAdapter;
66 public FusionAdapter getFusionAdapter() {
70 public void setFusionAdapter(FusionAdapter fusionAdapter) {
71 this.fusionAdapter = fusionAdapter;