b8d27c5693699974b74af957a442306eb6242e0e
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / resources / org / opendaylight / blueprint / restconf-bp.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  Copyright (c) 2017 Pantheon technologies s.r.o. and others.  All rights reserved.
4
5  This program and the accompanying materials are made available under the
6  terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  and is available at http://www.eclipse.org/legal/epl-v10.html
8 -->
9 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
10            xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
11            xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
12            xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.4.0"
13            odl:use-default-for-reference-types="true">
14
15   <!-- Restconf providers -->
16   <!--
17     This cfg file defines the type of the DOMDataBroker service to use. 'default' indicates to use
18     the default DOMDataBroker provided by MD-SAL. This setting is useful for providing a custom
19     DOMDataBroker implementation that does, e.g., validation or additional security checking on
20     top of the default DOMDataBroker.
21   -->
22   <cm:property-placeholder persistent-id="org.opendaylight.restconf.databroker"
23         placeholder-prefix = "@{" placeholder-suffix = "}" update-strategy="reload">
24     <cm:default-properties>
25       <cm:property name="databroker-service-type" value="default"/>
26     </cm:default-properties>
27   </cm:property-placeholder>
28
29   <!-- We need the AAAService available even though we don't use it -->
30   <reference interface="org.opendaylight.aaa.api.AAAService"/>
31
32   <reference id="domRpcService" interface="org.opendaylight.controller.md.sal.dom.api.DOMRpcService"/>
33   <reference id="domMountPointService" interface="org.opendaylight.controller.md.sal.dom.api.DOMMountPointService"/>
34   <reference id="domNotificationService" interface="org.opendaylight.controller.md.sal.dom.api.DOMNotificationService"/>
35   <reference id="domDataBroker" interface="org.opendaylight.controller.md.sal.dom.api.DOMDataBroker"
36           ext:filter="(type=@{databroker-service-type})"/>
37   <reference id="domSchemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService"/>
38
39   <bean id="wrapper" class="org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServicesWrapperImpl"
40           factory-method="getInstance" />
41
42   <bean id="transactionChainHandler" class="org.opendaylight.restconf.nb.rfc8040.handlers.TransactionChainHandler"
43           destroy-method="close">
44     <argument ref="domDataBroker"/>
45   </bean>
46
47   <bean id="schemaContextHandler" class="org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler"
48       factory-method="newInstance" init-method="init" destroy-method="close">
49     <argument ref="transactionChainHandler"/>
50     <argument ref="domSchemaService"/>
51   </bean>
52
53   <bean id="mountPointServiceHandler" class="org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler"
54       factory-method="newInstance">
55     <argument ref="domMountPointService"/>
56   </bean>
57
58   <bean id="restconfProvider" class="org.opendaylight.restconf.nb.rfc8040.RestConnectorProvider"
59           init-method="start" destroy-method="close">
60     <argument ref="domDataBroker"/>
61     <argument ref="domSchemaService"/>
62     <argument ref="domRpcService"/>
63     <argument ref="domNotificationService"/>
64     <argument ref="transactionChainHandler"/>
65     <argument ref="schemaContextHandler"/>
66     <argument ref="mountPointServiceHandler"/>
67     <argument ref="wrapper"/>
68   </bean>
69
70   <service ref="restconfProvider"
71       interface="org.opendaylight.restconf.nb.rfc8040.RestconfConnector" />
72
73   <!-- JSONRestconfService -->
74   <bean id="jsonRestconfService" depends-on="restconfProvider"
75       class="org.opendaylight.restconf.nb.rfc8040.rests.services.impl.JSONRestconfServiceRfc8040Impl"
76       destroy-method="close">
77     <argument ref="wrapper"/>
78     <argument ref="mountPointServiceHandler"/>
79     <argument ref="schemaContextHandler"/>
80   </bean>
81
82   <service ref="jsonRestconfService" odl:type="rfc8040"
83       interface="org.opendaylight.restconf.nb.rfc8040.rests.services.api.JSONRestconfService" />
84
85 </blueprint>