BUG-1764: default config for OF switch - fix 98/12598/2
authorMichal Rehak <mirehak@cisco.com>
Fri, 7 Nov 2014 11:41:13 +0000 (12:41 +0100)
committermichal rehak <mirehak@cisco.com>
Fri, 7 Nov 2014 13:52:06 +0000 (13:52 +0000)
- added routed registration
- added missing version property

Change-Id: I1ddfaa08672b7f9492b3951a44ab22513074c925
Signed-off-by: Michal Rehak <mirehak@cisco.com>
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/AbstractModelDrivenSwitch.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OFRpcTaskFactory.java

index 1bfa98f43285b279816189dd6813a4f21f264613..5afd47efab980603427ed5e37d9fb89cd17645b1 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeCon
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.NodeConfigService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.SalPortService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
@@ -45,6 +46,8 @@ public abstract class AbstractModelDrivenSwitch implements ModelDrivenSwitch {
     private RoutedRpcRegistration<SalMeterService> meterRegistration;
     
     private RoutedRpcRegistration<SalPortService> portRegistration;
+    
+    private RoutedRpcRegistration<NodeConfigService> nodeConfigRegistration;
 
     private RoutedRpcRegistration<PacketProcessingService> packetRegistration;
 
@@ -117,6 +120,10 @@ public abstract class AbstractModelDrivenSwitch implements ModelDrivenSwitch {
         portStatisticsRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(portStatisticsRegistration);
 
+        nodeConfigRegistration = ctx.addRoutedRpcImplementation(NodeConfigService.class, this);
+        nodeConfigRegistration.registerPath(NodeContext.class, getIdentifier());
+        builder.add(nodeConfigRegistration);
+        
         flowTableStatisticsRegistration = ctx.addRoutedRpcImplementation(OpendaylightFlowTableStatisticsService.class, this);
         flowTableStatisticsRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(flowTableStatisticsRegistration);
index b9607d59791a4b5e00965c44e057b05271a3031c..15043c3c10cd0b12ce4630204f2168b0ddd2389c 100644 (file)
@@ -1915,6 +1915,7 @@ public abstract class OFRpcTaskFactory {
                 builder.setXid(xid);
                 builder.setFlags(flag);
                 builder.setMissSendLen(input.getMissSearchLength());
+                builder.setVersion(getVersion());
                 ListenableFuture<RpcResult<Void>> resultLib = JdkFutureAdapters.listenInPoolThread(taskContext.getSession().getPrimaryConductor().getConnectionAdapter().setConfig(builder.build()));
                 Futures.addCallback(resultLib, new ResultCallback<SetConfigOutput>(result) {
                     @Override