[CCSDK-245] RA: Refactor RA to make it generic
[ccsdk/sli/adaptors.git] / resource-assignment / provider / src / main / resources / org / opendaylight / blueprint / resource-assignment.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3   ============LICENSE_START=======================================================
4   openECOMP : SDN-C
5   ================================================================================
6   Copyright (C) 2017 AT&T Intellectual Property. All rights
7                                                         reserved.
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
12
13        http://www.apache.org/licenses/LICENSE-2.0
14
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=========================================================
21   -->
22
23 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
24            xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
25            odl:use-default-for-reference-types="true">
26
27         <!-- JDBC setup -->
28
29         <bean id="rm.dataSource" class="org.onap.ccsdk.sli.adaptors.util.db.DataSourceWrap">
30                 <property name="dataSource" ref="dblib.dataSource" />
31         </bean>
32
33         <bean id="lock.dataSource" class="org.onap.ccsdk.sli.adaptors.util.db.CachedDataSourceWrap">
34                 <property name="dataSource" ref="rm.dataSource" />
35         </bean>
36
37         <bean id="rm.jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
38                 <property name="dataSource" ref="rm.dataSource" />
39         </bean>
40
41         <bean id="lock.jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
42                 <property name="dataSource" ref="lock.dataSource" />
43         </bean>
44
45         <!-- Resource Lock Configuration -->
46
47         <bean id="resourceLockDao" class="org.onap.ccsdk.sli.adaptors.lock.dao.ResourceLockDaoImpl">
48                 <property name="jdbcTemplate" ref="lock.jdbcTemplate" />
49         </bean>
50
51         <bean id="lockHelper" class="org.onap.ccsdk.sli.adaptors.lock.comp.LockHelperImpl">
52                 <property name="resourceLockDao" ref="resourceLockDao" />
53                 <property name="retryCount" value="10" />
54                 <property name="lockWait" value="5" /> <!-- Seconds -->
55         </bean>
56
57         <!-- RM Configuration -->
58
59         <bean id="resourceJdbcDao" class="org.onap.ccsdk.sli.adaptors.rm.dao.jdbc.ResourceJdbcDaoImpl">
60                 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
61         </bean>
62
63         <bean id="allocationItemJdbcDao" class="org.onap.ccsdk.sli.adaptors.rm.dao.jdbc.AllocationItemJdbcDaoImpl">
64                 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
65         </bean>
66
67         <bean id="resourceLoadJdbcDao" class="org.onap.ccsdk.sli.adaptors.rm.dao.jdbc.ResourceLoadJdbcDaoImpl">
68                 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
69         </bean>
70
71         <bean id="resourceDao" class="org.onap.ccsdk.sli.adaptors.rm.dao.jdbc.ResourceDaoImpl">
72                 <property name="resourceJdbcDao" ref="resourceJdbcDao" />
73                 <property name="allocationItemJdbcDao" ref="allocationItemJdbcDao" />
74                 <property name="resourceLoadJdbcDao" ref="resourceLoadJdbcDao" />
75         </bean>
76
77         <bean id="resourceManager" class="org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManagerImpl">
78                 <property name="lockHelper" ref="lockHelper" />
79                 <property name="resourceDao" ref="resourceDao" />
80                 <property name="lockTimeout" value="600" /> <!-- Seconds -->
81         </bean>
82
83         <!-- Rule DAO Configuration -->
84
85         <bean id="resourceRuleDao" class="org.onap.ccsdk.sli.adaptors.ra.rule.dao.ResourceRuleDaoImpl">
86                 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
87         </bean>
88
89         <bean id="rangeRuleDao" class="org.onap.ccsdk.sli.adaptors.ra.rule.dao.RangeRuleDaoImpl">
90                 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
91         </bean>
92
93         <!-- ResourceAllocator Configuration -->
94
95         <bean id="resourceAllocator" class="org.onap.ccsdk.sli.adaptors.ra.ResourceAllocator">
96                 <property name="resourceManager" ref="resourceManager" />
97                 <property name="endPointAllocator" ref="endPointAllocator" />
98                 <property name="speedUtil" ref="speedUtil" />
99         </bean>
100
101         <bean id="speedUtil" class="org.onap.ccsdk.sli.adaptors.util.speed.SpeedUtil" />
102
103         <!-- EndPointAllocator Configuration -->
104
105         <bean id="endPointAllocator" class="org.onap.ccsdk.sli.adaptors.ra.comp.EndPointAllocatorImpl">
106                 <property name="resourceManager" ref="resourceManager" />
107                 <property name="allocationRuleMap">
108                         <map>
109                                 <entry key="DEFAULT">
110                                         <list>
111                                                 <ref component-id="dbAllocationRule" />
112                                         </list>
113                                 </entry>
114                         </map>
115                 </property>
116         </bean>
117
118         <!-- Resource Allocation Rule Configuration -->
119
120         <bean id="dbAllocationRule" class="org.onap.ccsdk.sli.adaptors.ra.alloc.DbAllocationRule">
121                 <property name="resourceRuleDao" ref="resourceRuleDao" />
122                 <property name="rangeRuleDao" ref="rangeRuleDao" />
123         </bean>
124
125 </blueprint>