*/
package org.opendaylight.openflowplugin.openflow.md.core.extension;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.openflowplugin.extension.api.AugmentTuple;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNotifSwitchFlowRemovedBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNotifUpdateFlowStats;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNotifUpdateFlowStatsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchRpcOutputFlowStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchRpcOutputFlowStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.ExtensionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.list.grouping.ExtensionList;
import org.opendaylight.yangtools.yang.binding.Augmentation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
/**
*
}
/**
- * @param matchEntries
- * @param ofVersion
- * @param matchPath
+ * @param matchEntries match entries
+ * @param ofVersion openflow version
+ * @param matchPath match path
+ * @param <EXT_POINT> extension point
* @return augmentation wrapper containing augmentation depending on matchPath
*/
@SuppressWarnings("unchecked")
new AugmentTuple<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.mod.removed.Match>(
GeneralAugMatchNotifSwitchFlowRemoved.class, generalExtMatchAugBld3.build());
break;
+ case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+ GeneralAugMatchRpcOutputFlowStatsBuilder generalExtMatchAugBld4 = new GeneralAugMatchRpcOutputFlowStatsBuilder();
+ generalExtMatchAugBld4.setExtensionList(extensionsList);
+ augmentTuple = (AugmentTuple<EXT_POINT>)
+ new AugmentTuple<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match>(
+ GeneralAugMatchRpcOutputFlowStats.class, generalExtMatchAugBld4.build());
+ break;
default:
LOG.warn("matchPath not supported: {}", matchPath);
}
/** TODO: EXTENSION PROPOSAL (match, OFJava to MD-SAL) */
MatchEntrySerializerKey<? extends OxmClassBase, ? extends MatchField> key = new MatchEntrySerializerKey<>(
ofVersion.getVersion(), matchEntry.getOxmClass(), matchEntry.getOxmMatchField());
- ConvertorFromOFJava<MatchEntry, MatchPath> convertor = OFSessionUtil.getExtensionConvertorProvider().getConverter(key);
- if (convertor != null) {
- ExtensionAugment<? extends Augmentation<Extension>> extensionMatch =
- convertor.convert(matchEntry, matchPath);
- ExtensionBuilder extBld = new ExtensionBuilder();
- extBld.addAugmentation(extensionMatch.getAugmentationClass(), extensionMatch.getAugmentationObject());
+ if (null != OFSessionUtil.getExtensionConvertorProvider()) {
+ ConvertorFromOFJava<MatchEntry, MatchPath> convertor = OFSessionUtil.getExtensionConvertorProvider().getConverter(key);
+ if (convertor != null) {
+ ExtensionAugment<? extends Augmentation<Extension>> extensionMatch =
+ convertor.convert(matchEntry, matchPath);
+ ExtensionBuilder extBld = new ExtensionBuilder();
+ extBld.addAugmentation(extensionMatch.getAugmentationClass(), extensionMatch.getAugmentationObject());
- extListBld = new ExtensionListBuilder();
- extListBld.setExtension(extBld.build());
- extListBld.setExtensionKey(extensionMatch.getKey());
+ extListBld = new ExtensionListBuilder();
+ extListBld.setExtension(extBld.build());
+ extListBld.setExtensionKey(extensionMatch.getKey());
+ }
}
-
-
return extListBld;
}