Replace mysql connector with MariaDB connector
[vfc/nfvo/driver/vnfm/svnfm.git] / huawei / vnfmadapter / VnfmadapterService / service / src / main / resources / spring / Vnfmadapter / services.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3     Copyright (c) 2016-2017, Huawei Technologies Co., Ltd.
4
5     Licensed under the Apache License, Version 2.0 (the "License");
6     you may not use this file except in compliance with the License.
7     You may obtain a copy of the License at
8
9     http://www.apache.org/licenses/LICENSE-2.0
10
11     Unless required by applicable law or agreed to in writing, software
12     distributed under the License is distributed on an "AS IS" BASIS,
13     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14     See the License for the specific language governing permissions and
15     limitations under the License.
16  -->
17
18 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19     xmlns:osgi="http://www.springframework.org/schema/osgi" xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
20     xmlns:ctx="http://www.springframework.org/schema/context"
21     xmlns:jaxrs="http://cxf.apache.org/jaxrs"
22     xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
23     xsi:schemaLocation="
24     http://www.springframework.org/schema/beans
25     http://www.springframework.org/schema/beans/spring-beans.xsd
26     http://www.springframework.org/schema/osgi
27     http://www.springframework.org/schema/osgi/spring-osgi.xsd
28     http://www.springframework.org/schema/context
29     http://www.springframework.org/schema/context/spring-context.xsd
30     http://www.springframework.org/schema/osgi-compendium
31     http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
32     http://cxf.apache.org/jaxrs
33     http://cxf.apache.org/schemas/jaxrs.xsd
34     http://cxf.apache.org/transports/http/configuration
35     http://cxf.apache.org/schemas/configuration/http-conf.xsd
36     http://www.springframework.org/schema/aop
37     http://www.springframework.org/schema/aop/spring-aop-3.0.xsd ">
38
39     <!-- these are included in the dependency jar -->
40     <import resource="classpath:META-INF/cxf/cxf.xml" />
41     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
42
43     <bean id="jsonProvider" class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
44
45     <bean id="source"  class="org.springframework.jdbc.datasource.DriverManagerDataSource">
46         <!-- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
47         <property name="url" value="jdbc:mysql://localhost:3306/vnfmdb"/> -->
48         <property name="driverClassName" value="org.mariadb.jdbc.Driver"/>
49         <property name="url" value="jdbc:mariadb://localhost:3306/vnfmdb"/>
50         <property name="username" value="root"/>
51         <property name="password" value="rootpass"/>
52     </bean>
53
54     <bean id="sessionFactory"  class="org.mybatis.spring.SqlSessionFactoryBean">
55         <property name="dataSource" ref="source" />
56         <property name="mapperLocations" value="classpath*:mybatis/mysql/*.xml" />
57         <!-- <property name="configLocation" value="classpath:mybatis-config.xml" />  -->
58     </bean>
59
60     <bean id="session" class="org.mybatis.spring.SqlSessionTemplate">
61         <constructor-arg index="0" ref="sessionFactory" />
62     </bean>
63
64
65     <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
66         <property name="dataSource" ref="source" />
67     </bean>
68
69     <bean id="vnfmDao"
70         class="org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.dao.impl.VnfmDaoImpl">
71         <property name="session" ref="session"></property>
72     </bean>
73
74     <bean id="vnfMgr" class="org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.process.VnfMgr">
75         <property name="vnfmDao" ref="vnfmDao"></property>
76     </bean>
77
78     <bean id="VnfRoa" class="org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.rest.VnfRoa">
79         <property name="vnfMgr" ref="vnfMgr"></property>
80     </bean>
81
82     <bean id="vnfResourceMgr"
83         class="org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.process.VnfResourceMgr">
84     </bean>
85
86     <bean id="VnfResourceRoa" class="org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.rest.VnfResourceRoa">
87         <property name="vnfResourceMgr" ref="vnfResourceMgr"></property>
88     </bean>
89
90     <bean id="authMgr" class="org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.process.AuthMgr" />
91
92     <bean id="AuthRoa" class="org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.rest.AuthRoa">
93         <property name="authMgr" ref="authMgr"></property>
94     </bean>
95
96     <bean id="VnfAdaResRoa" class="org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.rest.VnfAdapterResourceRoa">
97     </bean>
98
99     <bean id="SwaggerRoa" class="org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.rest.SwaggerRoa"></bean>
100
101     <!-- bean id="registerMgr" class="org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.process.RegisterMgr"
102         init-method="register" destroy-method="unRegister">
103     </bean-->
104
105     <jaxrs:server id="restContainer" address="/">
106         <jaxrs:serviceBeans>
107             <ref bean="AuthRoa" />
108             <ref bean="VnfResourceRoa" />
109             <ref bean="VnfRoa" />
110             <ref bean="VnfAdaResRoa" />
111             <ref bean="SwaggerRoa" />
112         </jaxrs:serviceBeans>
113         <jaxrs:providers>
114             <ref bean="jsonProvider" />
115             <bean class="org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.rest.exceptionmapper.ServiceExceptionMapper" />
116             <bean class="org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.rest.exceptionmapper.GenericExceptionMapper" />
117         </jaxrs:providers>
118     </jaxrs:server>
119 </beans>