Merge bierman02-auth and bierman02-base features
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / resources / OSGI-INF / 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   <reference id="schemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService"/>
38   <reference id="domRpcService" interface="org.opendaylight.mdsal.dom.api.DOMRpcService"/>
39   <reference id="domMountPointService" interface="org.opendaylight.mdsal.dom.api.DOMMountPointService"/>
40   <reference id="domNotificationService" interface="org.opendaylight.mdsal.dom.api.DOMNotificationService"/>
41   <reference id="domDataBroker" interface="org.opendaylight.mdsal.dom.api.DOMDataBroker"
42           ext:filter="(type=@{databroker-service-type})"/>
43   <reference id="domSchemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService"/>
44
45   <bean id="webSocketPort" class="org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber">
46     <argument value="${websocket-port}"/>
47   </bean>
48
49   <bean id="webSocketAddress" class="org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress">
50     <argument value="${websocket-address}"/>
51   </bean>
52
53   <bean id="controllerContext" class="org.opendaylight.netconf.sal.restconf.impl.ControllerContext"
54       factory-method="newInstance" destroy-method="close">
55     <argument ref="schemaService"/>
56     <argument ref="domMountPointService"/>
57     <argument ref="domSchemaService"/>
58   </bean>
59
60   <bean id="brokerFacade" class="org.opendaylight.netconf.sal.restconf.impl.BrokerFacade"
61       factory-method="newInstance" destroy-method="close">
62     <argument ref="domRpcService"/>
63     <argument ref="domDataBroker"/>
64     <argument ref="domNotificationService"/>
65     <argument ref="controllerContext"/>
66   </bean>
67
68   <bean id="restconfImpl" class="org.opendaylight.netconf.sal.restconf.impl.RestconfImpl"
69       factory-method="newInstance">
70     <argument ref="brokerFacade"/>
71     <argument ref="controllerContext"/>
72   </bean>
73
74   <bean id="statsServiceWrapper" class="org.opendaylight.netconf.sal.restconf.impl.StatisticsRestconfServiceWrapper"
75       factory-method="newInstance">
76     <argument ref="restconfImpl"/>
77   </bean>
78
79   <bean id="restconfProviderDraft02" class="org.opendaylight.netconf.sal.restconf.impl.RestconfProviderImpl"
80           init-method="start" destroy-method="close">
81     <argument ref="statsServiceWrapper"/>
82     <argument ref="webSocketAddress"/>
83     <argument ref="webSocketPort"/>
84   </bean>
85
86   <bean id="restconfApplication" class="org.opendaylight.netconf.sal.rest.impl.RestconfApplication">
87     <argument ref="controllerContext"/>
88     <argument ref="statsServiceWrapper"/>
89   </bean>
90
91   <!-- JSONRestconfService -->
92   <bean id="jsonRestconfServiceDraft02"
93       class="org.opendaylight.netconf.sal.restconf.impl.JSONRestconfServiceImpl"
94       destroy-method="close">
95     <argument ref="controllerContext"/>
96     <argument ref="restconfImpl"/>
97   </bean>
98
99   <service ref="jsonRestconfServiceDraft02" odl:type="default"
100       interface="org.opendaylight.netconf.sal.restconf.api.JSONRestconfService" />
101
102   <!-- Web app registration -->
103
104   <reference id="customFilterAdapterConfig"
105       interface="org.opendaylight.aaa.filterchain.configuration.CustomFilterAdapterConfiguration"/>
106
107   <reference id="webServer" interface="org.opendaylight.aaa.web.WebServer" />
108
109   <reference id="webContextSecurer" interface="org.opendaylight.aaa.web.WebContextSecurer" />
110
111   <reference id="servletSupport" interface="org.opendaylight.aaa.web.servlet.ServletSupport" />
112
113   <bean class="org.opendaylight.netconf.sal.restconf.web.WebInitializer">
114     <argument ref="webServer"/>
115     <argument ref="webContextSecurer"/>
116     <argument ref="servletSupport"/>
117     <argument ref="restconfApplication"/>
118     <argument ref="customFilterAdapterConfig"/>
119   </bean>
120
121 </blueprint>