Wire entity ownership service to OVSDB southbound plugin 31/27231/1
authorAnil Vishnoi <vishnoianil@gmail.com>
Mon, 21 Sep 2015 18:35:49 +0000 (00:05 +0530)
committerAnil Vishnoi <vishnoianil@gmail.com>
Mon, 21 Sep 2015 18:58:01 +0000 (18:58 +0000)
Change-Id: I8baa3b31f9762c4b5656b399a1a7f705c1aed9c1
Signed-off-by: Anil Vishnoi <vishnoianil@gmail.com>
southbound/southbound-impl/src/main/config/default-config.xml
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundProvider.java
southbound/southbound-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/southbound/impl/rev141210/SouthboundImplModule.java
southbound/southbound-impl/src/main/yang/southbound-impl.yang

index b552df5cd4787bdc53cb632b7df54fdc658e66db..547f31ca685dacb094f8a938adea851ac62d6cef 100644 (file)
@@ -30,6 +30,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
             <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-normalized-node-serializer</type>
             <name>runtime-mapping-singleton</name>
           </binding-normalized-node-serializer>
+          <clustering-entity-ownership-service>
+             <type xmlns:ns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:entity-ownership-service">ns:entity-ownership-service</type>
+             <name>entity-ownership-service</name>
+          </clustering-entity-ownership-service>
         </module>
       </modules>
     </data>
index 0ba25b4aec730e04a3616714d63b59ee8c05408a..abb9a627a7165303301c1c55c9eca5d9d2b7b7c7 100644 (file)
@@ -9,12 +9,12 @@ package org.opendaylight.ovsdb.southbound;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.clustering.CandidateAlreadyRegisteredException;
+import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.ovsdb.lib.OvsdbConnection;
-import org.opendaylight.ovsdb.lib.impl.OvsdbConnectionService;
 import org.opendaylight.ovsdb.southbound.transactions.md.TransactionInvoker;
 import org.opendaylight.ovsdb.southbound.transactions.md.TransactionInvokerImpl;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
@@ -23,6 +23,8 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.ovsdb.lib.OvsdbConnection;
+import org.opendaylight.ovsdb.lib.impl.OvsdbConnectionService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -45,7 +47,13 @@ public class SouthboundProvider implements BindingAwareProvider, AutoCloseable {
 //    private OvsdbTerminationPointDataChangeListener ovsdbTerminationPointListener;
     private TransactionInvoker txInvoker;
     private OvsdbDataChangeListener ovsdbDataChangeListener;
+    private EntityOwnershipService entityOwnershipService;
+
 
+    public SouthboundProvider(
+            EntityOwnershipService entityOwnershipServiceDependency) {
+        this.entityOwnershipService = entityOwnershipServiceDependency;
+    }
 
     @Override
     public void onSessionInitiated(ProviderContext session) {
index 1f6fae12ab6c339f6a252dbcfd9bca2f8f74b74a..5014d144549a43120d1f984a965540077020b698 100644 (file)
@@ -31,7 +31,7 @@ public class SouthboundImplModule extends org.opendaylight.yang.gen.v1.urn.opend
     public java.lang.AutoCloseable createInstance() {
         SouthboundUtil.setInstanceIdentifierCodec(new InstanceIdentifierCodec(getSchemaServiceDependency(),
                 getBindingNormalizedNodeSerializerDependency()));
-        SouthboundProvider provider = new SouthboundProvider();
+        SouthboundProvider provider = new SouthboundProvider(getClusteringEntityOwnershipServiceDependency());
         getBrokerDependency().registerProvider(provider);
         return provider;
     }
index d5e30f570cfb42731941df75247273d4b871286a..89a2eac74f8fe0e88981eb50bd0d79e46a257e35 100644 (file)
@@ -6,6 +6,7 @@ module southbound-impl {
     import config { prefix config; revision-date 2013-04-05; }
     import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
     import opendaylight-md-sal-dom {prefix dom; revision-date 2013-10-28;}
+    import opendaylight-entity-ownership-service {prefix eos; revision-date 2015-08-10;}
 
     description
         "Service definition for southbound project";
@@ -47,6 +48,14 @@ module southbound-impl {
                     }
                 }
             }
+            container clustering-entity-ownership-service {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity eos:entity-ownership-service;
+                    }
+                }
+            }
         }
     }
 }