use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder in project netvirt by opendaylight.
the class NodeConnectedHandler method copyHANodeConfigToChild.
/**
* Copy HA global node data to Child HA node of config data tree .
*
* @param srcNode Node which to be transformed
* @param childPath Path to which source node will be transformed
* @param tx Transaction
*/
private void copyHANodeConfigToChild(Node srcNode, InstanceIdentifier<Node> childPath, ReadWriteTransaction tx) {
if (srcNode == null) {
return;
}
HwvtepGlobalAugmentation src = srcNode.getAugmentation(HwvtepGlobalAugmentation.class);
if (src == null) {
return;
}
NodeBuilder nodeBuilder = HwvtepHAUtil.getNodeBuilderForPath(childPath);
HwvtepGlobalAugmentationBuilder dstBuilder = new HwvtepGlobalAugmentationBuilder();
globalAugmentationMerger.mergeConfigData(dstBuilder, src, childPath);
globalNodeMerger.mergeConfigData(nodeBuilder, srcNode, childPath);
nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, dstBuilder.build());
Node dstNode = nodeBuilder.build();
tx.put(CONFIGURATION, childPath, dstNode, WriteTransaction.CREATE_MISSING_PARENTS);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder in project netvirt by opendaylight.
the class NodeConnectedHandler method copyHAPSConfigToChildPS.
/**
* Copy HA physical switch data to Child Physical switch node of config data tree.
*
* @param haPsNode HA physical Switch Node
* @param childPath HA Child Node path
* @param tx Transaction
*/
public void copyHAPSConfigToChildPS(Node haPsNode, InstanceIdentifier<Node> childPath, ReadWriteTransaction tx) {
InstanceIdentifier<Node> childPsPath = HwvtepHAUtil.convertPsPath(haPsNode, childPath);
NodeBuilder childPsBuilder = HwvtepHAUtil.getNodeBuilderForPath(childPsPath);
PhysicalSwitchAugmentationBuilder dstBuilder = new PhysicalSwitchAugmentationBuilder();
PhysicalSwitchAugmentation src = haPsNode.getAugmentation(PhysicalSwitchAugmentation.class);
psAugmentationMerger.mergeConfigData(dstBuilder, src, childPath);
psNodeMerger.mergeConfigData(childPsBuilder, haPsNode, childPath);
childPsBuilder.addAugmentation(PhysicalSwitchAugmentation.class, dstBuilder.build());
Node childPSNode = childPsBuilder.build();
tx.put(CONFIGURATION, childPsPath, childPSNode, WriteTransaction.CREATE_MISSING_PARENTS);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder in project openflowplugin by opendaylight.
the class Test method createNxActionBld.
private static ActionBuilder createNxActionBld(int actionKeyVal) {
// vendor part
DstNxRegCaseBuilder nxRegCaseBld = new DstNxRegCaseBuilder().setNxReg(NxmNxReg0.class);
DstBuilder dstBld = new DstBuilder().setDstChoice(nxRegCaseBld.build()).setStart(0).setEnd(5);
NxRegLoadBuilder nxRegLoadBuilder = new NxRegLoadBuilder();
nxRegLoadBuilder.setDst(dstBld.build());
nxRegLoadBuilder.setValue(BigInteger.valueOf(55L));
NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder topNxActionCaseBld = new NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder();
topNxActionCaseBld.setNxRegLoad(nxRegLoadBuilder.build());
// base part
ActionBuilder abExt = new ActionBuilder();
abExt.setKey(new ActionKey(actionKeyVal));
abExt.setAction(topNxActionCaseBld.build());
return abExt;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder in project genius by opendaylight.
the class MDSALUtil method createNxOfInPortAction.
public static Action createNxOfInPortAction(final int actionKey, final int inPortVal) {
NxRegLoad regLoad = new NxRegLoadBuilder().setDst(new DstBuilder().setDstChoice(new DstNxOfInPortCaseBuilder().setOfInPort(Boolean.TRUE).build()).setStart(0).setEnd(15).build()).setValue(BigInteger.valueOf(inPortVal)).build();
ActionBuilder abExt = new ActionBuilder();
abExt.setKey(new ActionKey(actionKey));
abExt.setOrder(actionKey);
abExt.setAction(new NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder().setNxRegLoad(regLoad).build());
return abExt.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder in project genius by opendaylight.
the class ActionMoveSourceDestinationEth method buildAction.
@Override
public Action buildAction(int newActionKey) {
ActionBuilder ab = new ActionBuilder();
NxRegMove regMove = new NxRegMoveBuilder().setSrc(new SrcBuilder().setSrcChoice(new SrcOfEthSrcCaseBuilder().setOfEthSrc(Boolean.TRUE).build()).setStart(0).build()).setDst(new DstBuilder().setDstChoice(new DstOfEthDstCaseBuilder().setOfEthDst(Boolean.TRUE).build()).setStart(0).setEnd(47).build()).build();
ab.setAction(new NxActionRegMoveNodesNodeTableFlowApplyActionsCaseBuilder().setNxRegMove(regMove).build());
ab.setKey(new ActionKey(newActionKey));
return ab.build();
}
Aggregations