Add JSONRestconfService impl for the restconf Draft18 impl
[netconf.git] / restconf / sal-rest-connector / src / main / resources / org / opendaylight / blueprint / restconf-config.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  Copyright (c) 2017 Inocybe Technologies Inc. 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   <cm:property-placeholder persistent-id="org.opendaylight.restconf" update-strategy="reload">
18     <cm:default-properties>
19       <cm:property name="websocket-port" value="8185"/>
20     </cm:default-properties>
21   </cm:property-placeholder>
22
23   <!--
24     This cfg file defines the type of the DOMDataBroker service to use. 'default' indicates to use
25     the default DOMDataBroker provided by MD-SAL. This setting is useful for providing a custom
26     DOMDataBroker implementation that does, e.g., validation or additional security checking on
27     top of the default DOMDataBroker.
28   -->
29   <cm:property-placeholder persistent-id="org.opendaylight.restconf.databroker"
30         placeholder-prefix = "@{" placeholder-suffix = "}" update-strategy="reload">
31     <cm:default-properties>
32       <cm:property name="databroker-service-type" value="default"/>
33     </cm:default-properties>
34   </cm:property-placeholder>
35
36   <!-- We need the AAAService available even though we don't use it -->
37   <reference interface="org.opendaylight.aaa.api.AAAService"/>
38
39   <reference id="schemaService" interface="org.opendaylight.controller.sal.core.api.model.SchemaService"/>
40   <reference id="domRpcService" interface="org.opendaylight.controller.md.sal.dom.api.DOMRpcService"/>
41   <reference id="domMountPointService" interface="org.opendaylight.controller.md.sal.dom.api.DOMMountPointService"/>
42   <reference id="domNotificationService" interface="org.opendaylight.controller.md.sal.dom.api.DOMNotificationService"/>
43   <reference id="domDataBroker" interface="org.opendaylight.controller.md.sal.dom.api.DOMDataBroker"
44           ext:filter="(type=@{databroker-service-type})"/>
45
46   <bean id="webSocketPort" class="org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber">
47     <argument value="${websocket-port}"/>
48   </bean>
49
50   <bean id="restconfProviderDraft02" class="org.opendaylight.netconf.sal.restconf.impl.RestconfProviderImpl"
51           init-method="start" destroy-method="close">
52     <argument ref="domDataBroker"/>
53     <argument ref="schemaService"/>
54     <argument ref="domRpcService"/>
55     <argument ref="domNotificationService"/>
56     <argument ref="domMountPointService"/>
57     <argument ref="webSocketPort"/>
58   </bean>
59
60   <bean id="restconfProviderDraft18" class="org.opendaylight.restconf.RestConnectorProvider"
61           init-method="start" destroy-method="close">
62     <argument ref="domDataBroker"/>
63     <argument ref="schemaService"/>
64     <argument ref="domRpcService"/>
65     <argument ref="domNotificationService"/>
66     <argument ref="domMountPointService"/>
67   </bean>
68
69   <service ref="restconfProviderDraft18"
70       interface="org.opendaylight.netconf.sal.rest.api.RestConnector" />
71
72   <!-- JSONRestconfService -->
73
74   <bean id="jsonRestconfServiceDraft02"
75       class="org.opendaylight.netconf.sal.restconf.impl.JSONRestconfServiceImpl"
76       destroy-method="close"/>
77
78   <service ref="jsonRestconfServiceDraft02" odl:type="default"
79       interface="org.opendaylight.netconf.sal.restconf.api.JSONRestconfService" />
80
81   <bean id="jsonRestconfServiceDraft18" depends-on="restconfProviderDraft18"
82       class="org.opendaylight.netconf.sal.restconf.impl.JSONRestconfServiceDraft18"
83       destroy-method="close">
84     <argument>
85       <bean class="org.opendaylight.restconf.common.wrapper.services.ServicesWrapperImpl"
86           factory-method="getInstance" />
87     </argument>
88     <argument>
89       <bean factory-ref="restconfProviderDraft18" factory-method="getMountPointServiceHandler" />
90     </argument>
91   </bean>
92
93   <service ref="jsonRestconfServiceDraft18" odl:type="draft18"
94       interface="org.opendaylight.netconf.sal.restconf.api.JSONRestconfService" />
95
96 </blueprint>