Extract mastership blueprint service
[openflowplugin.git] / openflowplugin-blueprint-config / src / main / resources / org / opendaylight / blueprint / openflowplugin.xml
index db68c3b0184c9762fcc9c66f57500901915ca172..08181d3c963ba720b0829ed3dc20a1b5626f9f7c 100644 (file)
@@ -1,85 +1,78 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
            xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
-        odl:use-default-for-reference-types="true">
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+           odl:use-default-for-reference-types="true">
 
-  <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" odl:type="pingpong"/>
-  <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"/>
-  <reference id="notificationService" interface="org.opendaylight.controller.md.sal.binding.api.NotificationService"/>
-  <reference id="notificationPublishService" interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"/>
-  <reference id="entityOwnershipService" interface="org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService"/>
+    <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" odl:type="pingpong"/>
+    <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"/>
+    <reference id="notificationPublishService" interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"/>
+    <reference id="entityOwnershipService" interface="org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService"/>
+    <reference id="clusterSingletonServiceProvider" interface="org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider"/>
 
-  <reference id="switchConnProviderFactory"
-          interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderFactory"/>
+    <reference id="defaultSwitchConnProvider" interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider"
+               odl:type="openflow-switch-connection-provider-default-impl"/>
 
-  <!-- Create OF switch connection provider on port 6633 -->
-  <odl:clustered-app-config id="defaultSwitchConnConfig"
-      binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfig"
-      list-key-value="openflow-switch-connection-provider-default-impl">
-    <odl:default-config><![CDATA[
-      <switch-connection-config xmlns="urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:config">
-        <instance-name>openflow-switch-connection-provider-default-impl</instance-name>
-        <port>6633</port>
-        <transport-protocol>TCP</transport-protocol>
-      </switch-connection-config>
-    ]]></odl:default-config>
-  </odl:clustered-app-config>
+    <reference id="legacySwitchConnProvider" interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider"
+               odl:type="openflow-switch-connection-provider-legacy-impl"/>
 
-  <bean id="defaultSwitchConnProvider" factory-ref="switchConnProviderFactory" factory-method="newInstance">
-    <argument ref="defaultSwitchConnConfig"/>
-  </bean>
+    <reference id="openflowPluginProviderFactory"
+               interface="org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProviderFactory"/>
 
-  <service ref="defaultSwitchConnProvider" interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider"
-          odl:type="openflow-switch-connection-provider-default-impl"/>
+    <reference id="configurationServiceFactory"
+               interface="org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationServiceFactory"/>
 
-  <!-- Create OF switch connection provider on port 6653 -->
-  <odl:clustered-app-config id="legacySwitchConnConfig"
-      binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfig"
-      list-key-value="openflow-switch-connection-provider-legacy-impl">
-    <odl:default-config><![CDATA[
-      <switch-connection-config xmlns="urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:config">
-        <instance-name>openflow-switch-connection-provider-legacy-impl</instance-name>
-        <port>6653</port>
-        <transport-protocol>TCP</transport-protocol>
-      </switch-connection-config>
-    ]]></odl:default-config>
-  </odl:clustered-app-config>
+    <reference id="mastershipChangeServiceManagerFactory"
+               interface="org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManagerFactory"/>
 
-  <bean id="legacySwitchConnProvider" factory-ref="switchConnProviderFactory" factory-method="newInstance">
-    <argument ref="legacySwitchConnConfig"/>
-  </bean>
+    <odl:clustered-app-config id="openflowProviderConfig"
+                              binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig"/>
 
-  <service ref="legacySwitchConnProvider" interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider"
-          odl:type="openflow-switch-connection-provider-legacy-impl"/>
+    <bean id="configurationService"
+          factory-ref="configurationServiceFactory"
+          factory-method="newInstance"
+          destroy-method="close">
+        <argument ref="openflowProviderConfig" />
+        <argument ref="blueprintBundleContext" />
+        <cm:managed-properties persistent-id="org.opendaylight.openflowplugin"
+                               update-strategy="component-managed"
+                               update-method="update"/>
+    </bean>
 
-  <!-- Create OpenflowPluginProvider instance -->
+    <bean id="mastershipChangeServiceManager"
+          factory-ref="mastershipChangeServiceManagerFactory"
+          factory-method="newInstance"
+          destroy-method="close"
+    />
 
-  <odl:clustered-app-config id="openflowProviderConfig"
-      binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig"/>
+    <service ref="mastershipChangeServiceManager" interface="org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager"/>
 
-  <reference id="openflowPluginProviderFactory"
-          interface="org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProviderFactory"/>
+    <service ref="configurationService" interface="org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService"/>
 
-  <bean id="openflowPluginProvider" factory-ref="openflowPluginProviderFactory" factory-method="newInstance">
-    <argument ref="openflowProviderConfig"/>
-    <argument ref="dataBroker"/>
-    <argument ref="rpcRegistry"/>
-    <argument ref="notificationService"/>
-    <argument ref="notificationPublishService"/>
-    <argument ref="entityOwnershipService"/>
-    <argument>
-      <list>
-        <ref component-id="defaultSwitchConnProvider"/>
-        <ref component-id="legacySwitchConnProvider"/>
-      </list>
-    </argument>
-  </bean>
+    <bean id="openflowPluginProvider"
+          factory-ref="openflowPluginProviderFactory"
+          factory-method="newInstance"
+          destroy-method="close">
+        <argument ref="configurationService"/>
+        <argument ref="dataBroker"/>
+        <argument ref="rpcRegistry"/>
+        <argument ref="notificationPublishService"/>
+        <argument ref="entityOwnershipService"/>
+        <argument>
+            <list>
+                <ref component-id="defaultSwitchConnProvider"/>
+                <ref component-id="legacySwitchConnProvider"/>
+            </list>
+        </argument>
+        <argument ref="clusterSingletonServiceProvider"/>
+        <argument ref="mastershipChangeServiceManager"/>
+    </bean>
 
-  <service ref="openflowPluginProvider" odl:type="openflow-plugin-provider-impl">
-    <interfaces>
-      <value>org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider</value>
-      <value>org.opendaylight.openflowplugin.extension.api.OpenFlowPluginExtensionRegistratorProvider</value>
-    </interfaces>
-  </service>
+    <service ref="openflowPluginProvider" odl:type="openflow-plugin-provider-impl">
+        <interfaces>
+            <value>org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider</value>
+            <value>org.opendaylight.openflowplugin.extension.api.OpenFlowPluginExtensionRegistratorProvider</value>
+        </interfaces>
+    </service>
 
-</blueprint>
\ No newline at end of file
+</blueprint>