Provide NetconfKeystoreService RPCs in clustered topology
[netconf.git] / netconf / netconf-topology-singleton / src / main / resources / org / opendaylight / blueprint / netconf-topology-singleton.xml
index 8fced1956ea89d516b1ecb6c83ec60a3f3233bb8..795981a27ab9c7ad8f756313f818f89a7d23346e 100644 (file)
@@ -9,6 +9,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 -->
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
            xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
            odl:use-default-for-reference-types="true">
 
     <reference id="dataBroker"
@@ -17,38 +18,77 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
                interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"/>
     <reference id="clusterSingletonService"
                interface="org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider"/>
-    <reference id="bindingAwareBroker"
-               interface="org.opendaylight.controller.sal.binding.api.BindingAwareBroker"/>
     <reference id="keepAliveExecutor"
-               interface="org.opendaylight.controller.config.threadpool.ScheduledThreadPool"/>
+               interface="org.opendaylight.controller.config.threadpool.ScheduledThreadPool"
+               odl:type="global-netconf-ssh-scheduled-executor"/>
     <reference id="processingExecutor"
-               interface="org.opendaylight.controller.config.threadpool.ThreadPool"/>
-    <reference id="domBroker"
-               interface="org.opendaylight.controller.sal.core.api.Broker"/>
+               interface="org.opendaylight.controller.config.threadpool.ThreadPool"
+               odl:type="global-netconf-processing-executor"/>
     <reference id="actorSystemProvider"
                interface="org.opendaylight.controller.cluster.ActorSystemProvider"/>
     <reference id="eventExecutor"
                interface="io.netty.util.concurrent.EventExecutor"
                odl:type="global-event-executor"/>
     <reference id="clientDispatcherDependency"
-               interface="org.opendaylight.netconf.client.NetconfClientDispatcher"/>
+               interface="org.opendaylight.netconf.client.NetconfClientDispatcher"
+               odl:type="netconf-client-dispatcher"/>
+    <reference id="mountPointService"
+               interface="org.opendaylight.controller.md.sal.dom.api.DOMMountPointService"
+               odl:type="default"/>
+    <odl:clustered-app-config
+            id="singletonConfig"
+            binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.topology.singleton.config.rev170419.Config"
+    />
+
+    <cm:property-placeholder persistent-id="org.opendaylight.netconf.topology.sb.keypair" update-strategy="none">
+        <cm:default-properties>
+            <cm:property name="private-key-path" value=""/>
+            <cm:property name="private-key-passphrase" value=""/>
+        </cm:default-properties>
+    </cm:property-placeholder>
+
+    <reference id="encryptionService"
+               interface="org.opendaylight.aaa.encrypt.AAAEncryptionService" />
 
     <bean id="netconfTopologyManager"
           class="org.opendaylight.netconf.topology.singleton.impl.NetconfTopologyManager"
           init-method="init" destroy-method="close">
+        <cm:managed-properties persistent-id="org.opendaylight.netconf.topology.sb.keypair"
+                               update-strategy="container-managed"/>
         <argument ref="dataBroker"/>
         <argument ref="rpcRegistry"/>
         <argument ref="clusterSingletonService"/>
-        <argument ref="bindingAwareBroker"/>
         <argument ref="keepAliveExecutor"/>
         <argument ref="processingExecutor"/>
-        <argument ref="domBroker"/>
         <argument ref="actorSystemProvider"/>
         <argument ref="eventExecutor"/>
         <argument ref="clientDispatcherDependency"/>
         <argument value="topology-netconf"/>
+        <argument ref="singletonConfig"/>
+        <argument ref="mountPointService"/>
+        <property name="privateKeyPath" value="${private-key-path}"/>
+        <property name="privateKeyPassphrase" value="${private-key-passphrase}"/>
+        <argument ref="encryptionService" />
     </bean>
     <service ref="netconfTopologyManager"
              interface="org.opendaylight.netconf.topology.singleton.api.NetconfTopologySingletonService"/>
 
+    <bean id="netconfNodeRegisterEncryptedRPC"
+          class="org.opendaylight.netconf.sal.connect.util.NetconfTopologyRPCProvider"
+          >
+        <argument value="topology-netconf"/>
+        <argument ref="dataBroker"/>
+        <argument ref="encryptionService"/>
+    </bean>
+
+    <odl:rpc-implementation ref="netconfNodeRegisterEncryptedRPC"/>
+
+    <bean id="netconfKeystoreProvider"
+          class="org.opendaylight.netconf.sal.connect.util.NetconfSalKeystoreService">
+        <argument ref="dataBroker"/>
+        <argument ref="encryptionService"/>
+    </bean>
+
+    <odl:rpc-implementation ref="netconfKeystoreProvider"/>
+
 </blueprint>