Bug 5540 - TableFeaturesResponseConvertor
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / services / SalTableServiceImpl.java
index 86d1e7892228ac1d337708366ee9f1255c366742..7282896ea765f68dba5552f1f17ec668d2ac7399 100644 (file)
@@ -23,7 +23,6 @@ import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.device.TxFacade;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.TableFeaturesReplyConvertor;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
@@ -145,9 +144,14 @@ public final class SalTableServiceImpl extends AbstractMultipartService<UpdateTa
                     final MultipartReplyTableFeaturesCase tableFeaturesCase = ((MultipartReplyTableFeaturesCase) multipartReplyBody);
                     final MultipartReplyTableFeatures salTableFeatures = tableFeaturesCase
                             .getMultipartReplyTableFeatures();
-                    final List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures> salTableFeaturesPartial = TableFeaturesReplyConvertor
-                            .toTableFeaturesReply(salTableFeatures);
-                    salTableFeaturesAll.addAll(salTableFeaturesPartial);
+
+                    final Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures>> salTableFeaturesPartial =
+                            ConvertorManager.getInstance().convert(salTableFeatures);
+
+                    if (salTableFeaturesPartial.isPresent()) {
+                        salTableFeaturesAll.addAll(salTableFeaturesPartial.get());
+                    }
+
                     LOG.debug("TableFeature {} for xid {}.", salTableFeatures, multipartReply.getXid());
                 }
             }