+ Futures.addCallback(multipartFuture, new CallBackImpl());
+
+ return finalFuture;
+ }
+
+ /**
+ * @param multipartReplies
+ */
+ private void writeResponseToOperationalDatastore(final List<MultipartReply> multipartReplies) throws Exception {
+
+ final List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures> salTableFeatures = convertToSalTableFeatures(multipartReplies);
+
+ final InstanceIdentifier<FlowCapableNode> flowCapableNodeII = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, new NodeKey(getDeviceInfo().getNodeId())).augmentation(FlowCapableNode.class);
+ for (final org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures tableFeatureData : salTableFeatures) {
+ final Short tableId = tableFeatureData.getTableId();
+ final KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures, TableFeaturesKey> tableFeaturesII = flowCapableNodeII
+ .child(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures.class,
+ new TableFeaturesKey(tableId));
+ txFacade.writeToTransaction(LogicalDatastoreType.OPERATIONAL, tableFeaturesII,
+ tableFeatureData);
+ }
+
+ txFacade.submitTransaction();
+ }
+
+ protected List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures> convertToSalTableFeatures(
+ final List<MultipartReply> multipartReplies) {
+ final List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures> salTableFeaturesAll = new ArrayList<>();
+ for (final MultipartReply multipartReply : multipartReplies) {
+ if (multipartReply.getType().equals(MultipartType.OFPMPTABLEFEATURES)) {
+ final MultipartReplyBody multipartReplyBody = multipartReply.getMultipartReplyBody();
+ if (multipartReplyBody instanceof MultipartReplyTableFeaturesCase) {
+ final MultipartReplyTableFeaturesCase tableFeaturesCase = ((MultipartReplyTableFeaturesCase) multipartReplyBody);
+ final MultipartReplyTableFeatures salTableFeatures = tableFeaturesCase
+ .getMultipartReplyTableFeatures();
+
+ final Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures>> salTableFeaturesPartial =
+ convertorExecutor.convert(salTableFeatures, data);
+
+ if (salTableFeaturesPartial.isPresent()) {
+ salTableFeaturesAll.addAll(salTableFeaturesPartial.get());
+ }
+
+ LOG.debug("TableFeature {} for xid {}.", salTableFeatures, multipartReply.getXid());
+ }
+ }
+ }
+ return salTableFeaturesAll;