0e523d0d4f55676fda6a2bb74982555dd99950be
[netconf.git] / restconf / restconf-nb-bierman02 / 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-address" value="0.0.0.0"/>
20       <cm:property name="websocket-port" value="8185"/>
21     </cm:default-properties>
22   </cm:property-placeholder>
23
24   <!--
25     This cfg file defines the type of the DOMDataBroker service to use. 'default' indicates to use
26     the default DOMDataBroker provided by MD-SAL. This setting is useful for providing a custom
27     DOMDataBroker implementation that does, e.g., validation or additional security checking on
28     top of the default DOMDataBroker.
29   -->
30   <cm:property-placeholder persistent-id="org.opendaylight.restconf.databroker"
31         placeholder-prefix = "@{" placeholder-suffix = "}" update-strategy="reload">
32     <cm:default-properties>
33       <cm:property name="databroker-service-type" value="default"/>
34     </cm:default-properties>
35   </cm:property-placeholder>
36
37   <!-- We need the AAAService available even though we don't use it -->
38   <reference interface="org.opendaylight.aaa.api.AAAService"/>
39
40   <reference id="schemaService" interface="org.opendaylight.controller.sal.core.api.model.SchemaService"/>
41   <reference id="domRpcService" interface="org.opendaylight.controller.md.sal.dom.api.DOMRpcService"/>
42   <reference id="domMountPointService" interface="org.opendaylight.controller.md.sal.dom.api.DOMMountPointService"/>
43   <reference id="domNotificationService" interface="org.opendaylight.controller.md.sal.dom.api.DOMNotificationService"/>
44   <reference id="domDataBroker" interface="org.opendaylight.controller.md.sal.dom.api.DOMDataBroker"
45           ext:filter="(type=@{databroker-service-type})"/>
46   <reference id="domSchemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService"/>
47
48   <bean id="webSocketPort" class="org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber">
49     <argument value="${websocket-port}"/>
50   </bean>
51
52   <bean id="webSocketAddress" class="org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress">
53     <argument value="${websocket-address}"/>
54   </bean>
55
56   <bean id="controllerContext" class="org.opendaylight.netconf.sal.restconf.impl.ControllerContext"
57       factory-method="newInstance" destroy-method="close">
58     <argument ref="schemaService"/>
59     <argument ref="domMountPointService"/>
60     <argument ref="domSchemaService"/>
61   </bean>
62
63   <bean id="restconfProviderDraft02" class="org.opendaylight.netconf.sal.restconf.impl.RestconfProviderImpl"
64           init-method="start" destroy-method="close">
65     <argument ref="domDataBroker"/>
66     <argument ref="domRpcService"/>
67     <argument ref="domNotificationService"/>
68     <argument ref="controllerContext"/>
69     <argument ref="webSocketAddress"/>
70     <argument ref="webSocketPort"/>
71   </bean>
72
73   <!-- JSONRestconfService -->
74   <bean id="jsonRestconfServiceDraft02"
75       class="org.opendaylight.netconf.sal.restconf.impl.JSONRestconfServiceImpl"
76       destroy-method="close">
77     <argument ref="controllerContext"/>
78   </bean>
79
80   <service ref="jsonRestconfServiceDraft02" odl:type="default"
81       interface="org.opendaylight.netconf.sal.restconf.api.JSONRestconfService" />
82
83 </blueprint>