write node to DS when connected 33/17733/4
authorMartin Bobak <mbobak@cisco.com>
Fri, 3 Apr 2015 20:17:43 +0000 (22:17 +0200)
committerMartin Bobak <mbobak@cisco.com>
Sat, 4 Apr 2015 08:58:37 +0000 (10:58 +0200)
Change-Id: I6681393442968150ac5e743b8beac949f2cc246a
Signed-off-by: Martin Bobak <mbobak@cisco.com>
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/TransactionChainManager.java

index 802e928cf1326937044195efd5b8e8d85801f9c8..b9f6493ee6c9ceb0b8a2d278be3656a06cb12b7e 100644 (file)
@@ -46,6 +46,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.ta
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupFeatures;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterFeatures;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
@@ -122,6 +123,9 @@ public class DeviceManagerImpl implements DeviceManager {
         final DeviceState deviceState = new DeviceStateImpl(connectionContext.getFeatures(), connectionContext.getNodeId());
 
         final DeviceContextImpl deviceContext = new DeviceContextImpl(connectionContext, deviceState, dataBroker, hashedWheelTimer);
+
+        deviceContext.writeToTransaction(LogicalDatastoreType.OPERATIONAL, deviceState.getNodeInstanceIdentifier(), new NodeBuilder().setId(deviceState.getNodeId()).build());
+
         deviceContext.setTranslatorLibrary(translatorLibrary);
 
         final OpenflowProtocolListenerFullImpl messageListener = new OpenflowProtocolListenerFullImpl(
index 93b2bc4ff172502484dc3ee67bec9576e87e3baa..69af87db6f092931273be8da4da9ecc89ad3ec0b 100644 (file)
@@ -56,7 +56,7 @@ class TransactionChainManager implements TransactionChainListener {
         if (wTx == null) {
             wTx = txChainFactory.newWriteOnlyTransaction();
         }
-        wTx.put(store, path, data);
+        wTx.put(store, path, data, true);
         if ( ! counterIsEnabled) {
             return;
         }