use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.ExtensionBuilder in project netvirt by opendaylight.
the class OpenFlow13Utils method addExtension.
private static void addExtension(MatchBuilder match, Class<? extends ExtensionKey> extensionKey, NxAugMatchNodesNodeTableFlow am) {
GeneralAugMatchNodesNodeTableFlow existingAugmentations = match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
List<ExtensionList> extensions = null;
if (existingAugmentations != null) {
extensions = existingAugmentations.getExtensionList();
}
if (extensions == null) {
extensions = new ArrayList<>();
}
extensions.add(new ExtensionListBuilder().setExtensionKey(extensionKey).setExtension(new ExtensionBuilder().addAugmentation(NxAugMatchNodesNodeTableFlow.class, am).build()).build());
GeneralAugMatchNodesNodeTableFlow generalAugMatchNodesNode = new GeneralAugMatchNodesNodeTableFlowBuilder().setExtensionList(extensions).build();
match.addAugmentation(GeneralAugMatchNodesNodeTableFlow.class, generalAugMatchNodesNode);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.ExtensionBuilder in project openflowplugin by opendaylight.
the class MatchExtensionHelper method processExtension.
/**
* Processes an extension.
*
* @param ofVersion openflow version
* @param matchPath match path
* @param matchEntry match entry
* @return an ExtensionListBuilder
*/
private static ExtensionListBuilder processExtension(MatchEntry matchEntry, short ofVersion, MatchPath matchPath) {
ExtensionListBuilder extListBld = null;
// TODO: EXTENSION PROPOSAL (match, OFJava to MD-SAL)
MatchEntrySerializerKey<? extends OxmClassBase, ? extends MatchField> key = new MatchEntrySerializerKey<>(ofVersion, matchEntry.getOxmClass(), matchEntry.getOxmMatchField());
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());
}
}
return extListBld;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.ExtensionBuilder in project genius by opendaylight.
the class NxMatchInfoHelper method generalAugMatchBuilder.
private GeneralAugMatchNodesNodeTableFlow generalAugMatchBuilder(GeneralAugMatchNodesNodeTableFlow existingAugmentations, NxAugMatchNodesNodeTableFlow nxAugMatch, Class<? extends ExtensionKey> extentionKey) {
List<ExtensionList> extensions = null;
if (existingAugmentations != null) {
extensions = existingAugmentations.getExtensionList();
}
if (extensions == null) {
extensions = new ArrayList<>();
}
extensions.add(new ExtensionListBuilder().setExtensionKey(extentionKey).setExtension(new ExtensionBuilder().addAugmentation(NxAugMatchNodesNodeTableFlow.class, nxAugMatch).build()).build());
return new GeneralAugMatchNodesNodeTableFlowBuilder().setExtensionList(extensions).build();
}
Aggregations