1 <?xml version="1.0" encoding="utf-8"?>
3 ============LICENSE_START=======================================================
5 ================================================================================
6 Copyright (C) 2017 ONAP Intellectual Property. All rights
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 <beans xmlns="http://www.springframework.org/schema/beans"
24 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
25 xmlns:context="http://www.springframework.org/schema/context"
26 xsi:schemaLocation="http://www.springframework.org/schema/beans
27 http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
28 http://www.springframework.org/schema/jdbc
29 http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
30 http://www.springframework.org/schema/context
31 http://www.springframework.org/schema/context/spring-context-3.1.xsd
34 <context:annotation-config />
38 <bean id="test.dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="false">
39 <property name="driverClassName" value="org.h2.Driver" />
40 <property name="url" value="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;MODE=MySQL" />
43 <jdbc:initialize-database data-source="test.dataSource">
44 <jdbc:script location="sql/schema.sql" />
45 <jdbc:script location="sql/data.sql" />
46 </jdbc:initialize-database>
48 <bean id="rm.jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
49 <property name="dataSource" ref="test.dataSource" />
52 <bean id="testDb" class="jtest.util.org.openecomp.sdnc.ra.TestDb">
53 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
56 <bean id="dataSetup" class="jtest.org.openecomp.sdnc.ra.DataSetup">
57 <property name="testDb" ref="testDb" />
60 <!-- Utils Configuration -->
62 <bean id="speedUtil" class="org.openecomp.sdnc.util.speed.SpeedUtil">
63 <property name="unitFactor" value="1000" />
66 <!-- Resource Lock Configuration -->
68 <bean id="resourceLockDao" class="org.openecomp.sdnc.lock.dao.ResourceLockDaoImpl">
69 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
70 <property name="testing" value="true" />
73 <bean id="lockHelper" class="org.openecomp.sdnc.lock.comp.LockHelperImpl">
74 <property name="resourceLockDao" ref="resourceLockDao" />
75 <property name="retryCount" value="10" />
76 <property name="lockWait" value="5" /> <!-- Seconds -->
79 <!-- RM Configuration -->
81 <bean id="resourceJdbcDao" class="org.openecomp.sdnc.rm.dao.jdbc.ResourceJdbcDaoImpl">
82 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
85 <bean id="allocationItemJdbcDao" class="org.openecomp.sdnc.rm.dao.jdbc.AllocationItemJdbcDaoImpl">
86 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
89 <bean id="resourceLoadJdbcDao" class="org.openecomp.sdnc.rm.dao.jdbc.ResourceLoadJdbcDaoImpl">
90 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
93 <bean id="resourceDao" class="org.openecomp.sdnc.rm.dao.jdbc.ResourceDaoImpl">
94 <property name="resourceJdbcDao" ref="resourceJdbcDao" />
95 <property name="allocationItemJdbcDao" ref="allocationItemJdbcDao" />
96 <property name="resourceLoadJdbcDao" ref="resourceLoadJdbcDao" />
99 <bean id="resourceManager" class="org.openecomp.sdnc.rm.comp.ResourceManagerImpl">
100 <property name="lockHelper" ref="lockHelper" />
101 <property name="resourceDao" ref="resourceDao" />
102 <property name="applicationId" value="SDNC" />
103 <property name="lockTimeout" value="600" /> <!-- Seconds -->
106 <!-- Equipment DAO Configuration -->
108 <bean id="serverDao" class="org.openecomp.sdnc.ra.equip.dao.ServerDaoImpl">
109 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
112 <bean id="vpePortDao" class="org.openecomp.sdnc.ra.equip.dao.VpePortDaoImpl">
113 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
116 <bean id="vplspePortDao" class="org.openecomp.sdnc.ra.equip.dao.VplspePortDaoImpl">
117 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
120 <!-- Rule DAO Configuration -->
122 <bean id="maxPortSpeedDao" class="org.openecomp.sdnc.ra.rule.dao.MaxPortSpeedDaoImpl">
123 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
124 <property name="speedUtil" ref="speedUtil" />
127 <bean id="maxServerSpeedDao" class="org.openecomp.sdnc.ra.rule.dao.MaxServerSpeedDaoImpl">
128 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
129 <property name="speedUtil" ref="speedUtil" />
132 <bean id="resourceRuleDao" class="org.openecomp.sdnc.ra.rule.dao.ResourceRuleDaoImpl">
133 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
136 <bean id="rangeRuleDao" class="org.openecomp.sdnc.ra.rule.dao.RangeRuleDaoImpl">
137 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
140 <bean id="vpeLockDao" class="org.openecomp.sdnc.ra.rule.dao.VpeLockDaoImpl">
141 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
144 <bean id="parameterDao" class="org.openecomp.sdnc.ra.rule.dao.ParameterDaoImpl">
145 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
148 <!-- Service DAO Configuration -->
150 <bean id="serviceResourceDao" class="org.openecomp.sdnc.ra.service.dao.ServiceResourceDaoImpl">
151 <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
154 <!-- ResourceAllocator Configuration -->
156 <bean id="allocationRequestBuilder" class="org.openecomp.sdnc.ra.rule.comp.AllocationRequestBuilderImpl">
157 <property name="resourceRuleDao" ref="resourceRuleDao" />
158 <property name="rangeRuleDao" ref="rangeRuleDao" />
161 <bean id="resourceAllocator" class="org.openecomp.sdnc.ra.ResourceAllocator">
162 <property name="speedUtil" ref="speedUtil" />
163 <property name="parameterDao" ref="parameterDao" />
164 <property name="serverDao" ref="serverDao" />
165 <property name="vpePortDao" ref="vpePortDao" />
166 <property name="vplspePortDao" ref="vplspePortDao" />
167 <property name="maxPortSpeedDao" ref="maxPortSpeedDao" />
168 <property name="maxServerSpeedDao" ref="maxServerSpeedDao" />
169 <property name="serviceResourceDao" ref="serviceResourceDao" />
170 <property name="allocationRequestBuilder" ref="allocationRequestBuilder" />
171 <property name="resourceManager" ref="resourceManager" />
172 <property name="endPointAllocator" ref="endPointAllocator" />
175 <!-- EndPointAllocator Configuration -->
177 <bean id="endPointAllocator" class="org.openecomp.sdnc.ra.comp.EndPointAllocatorImpl">
178 <property name="resourceManager" ref="resourceManager" />
179 <property name="endPointAllocationDefinitionMap">
181 <entry key="L3AVPN-PORT">
183 <bean class="org.openecomp.sdnc.ra.comp.EndPointAllocationDefinition">
184 <property name="serviceModel" value="L3AVPN-PORT" />
185 <property name="endPointPosition" value="VPE-Cust" />
186 <property name="equipmentReader" ref="vpePortReader" />
187 <property name="equipmentCheckList">
189 <ref bean="provStatusCheck" />
190 <ref bean="excludeVpeCheck" />
191 <ref bean="anyVrfPresentCheck" />
194 <property name="preferenceRuleList">
196 <ref bean="affinityLinkPref" />
199 <property name="allocationRuleList">
201 <ref bean="dbAllocationRule" />
202 <ref bean="affinityAllocationRule" />
208 <entry key="L3AVPN-EVC">
210 <bean class="org.openecomp.sdnc.ra.comp.EndPointAllocationDefinition">
211 <property name="serviceModel" value="L3AVPN-EVC" />
212 <property name="endPointPosition" value="VPE-Cust" />
213 <property name="equipmentReader" ref="vpePortReader" />
214 <property name="equipmentCheckList">
216 <ref bean="provStatusCheck" />
217 <ref bean="excludeVpeCheck" />
218 <ref bean="vpeLockCheck" />
219 <ref bean="anyVrfPresentCheck" />
220 <ref bean="oneMVrfCheck" />
221 <ref bean="hubWithRgCheck" />
224 <property name="preferenceRuleList">
226 <ref bean="affinityLinkPref" />
229 <property name="allocationRuleList">
231 <ref bean="dbAllocationRule" />
232 <ref bean="vrfAllocationRule" />
233 <ref bean="servingSiteAllocationRule" />
234 <ref bean="affinityAllocationRule" />
244 <!-- Equipment Readers Configuration -->
246 <bean id="vpePortReader" class="org.openecomp.sdnc.ra.reader.VpePortReader">
247 <property name="vpePortDao" ref="vpePortDao" />
250 <!-- Equipment Checks Configuration -->
252 <bean id="provStatusCheck" class="org.openecomp.sdnc.ra.check.ProvStatusCheck">
255 <bean id="excludeVpeCheck" class="org.openecomp.sdnc.ra.check.ExcludeVpeCheck">
258 <bean id="vpeLockCheck" class="org.openecomp.sdnc.ra.check.VpeLockCheck">
259 <property name="vpeLockDao" ref="vpeLockDao" />
260 <property name="resourceManager" ref="resourceManager" />
263 <bean id="anyVrfPresentCheck" class="org.openecomp.sdnc.ra.check.AnyVrfPresentCheck">
264 <property name="resourceManager" ref="resourceManager" />
267 <bean id="oneMVrfCheck" class="org.openecomp.sdnc.ra.check.OneMVrfCheck">
268 <property name="resourceManager" ref="resourceManager" />
271 <bean id="hubWithRgCheck" class="org.openecomp.sdnc.ra.check.HubWithRgCheck">
272 <property name="resourceManager" ref="resourceManager" />
275 <!-- Preference Rule Configuration -->
277 <bean id="affinityLinkPref" class="org.openecomp.sdnc.ra.pref.AffinityLinkPref">
278 <property name="resourceManager" ref="resourceManager" />
281 <!-- Resource Allocation Rule Configuration -->
283 <bean id="dbAllocationRule" class="org.openecomp.sdnc.ra.alloc.DbAllocationRule">
284 <property name="resourceRuleDao" ref="resourceRuleDao" />
285 <property name="rangeRuleDao" ref="rangeRuleDao" />
288 <bean id="vrfAllocationRule" class="org.openecomp.sdnc.ra.alloc.VrfAllocationRule">
291 <bean id="servingSiteAllocationRule" class="org.openecomp.sdnc.ra.alloc.ServingSiteAllocationRule">
294 <bean id="affinityAllocationRule" class="org.openecomp.sdnc.ra.alloc.AffinityAllocationRule">