use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionMultipathGrouping in project openflowplugin by opendaylight.
the class MultipathConvertor method convert.
@Override
public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
Preconditions.checkArgument(nxActionArg instanceof NxActionMultipathGrouping);
NxActionMultipathGrouping nxAction = (NxActionMultipathGrouping) nxActionArg;
NxActionMultipathBuilder nxActionMultipathBuilder = new NxActionMultipathBuilder();
nxActionMultipathBuilder.setFields(nxAction.getNxMultipath().getFields());
nxActionMultipathBuilder.setBasis(nxAction.getNxMultipath().getBasis());
nxActionMultipathBuilder.setAlgorithm(nxAction.getNxMultipath().getAlgorithm());
nxActionMultipathBuilder.setMaxLink(nxAction.getNxMultipath().getMaxLink());
nxActionMultipathBuilder.setArg(nxAction.getNxMultipath().getArg());
Dst dst = nxAction.getNxMultipath().getDst();
nxActionMultipathBuilder.setOfsNbits(dst.getStart() << 6 | dst.getEnd() - dst.getStart());
nxActionMultipathBuilder.setDst(RegMoveConvertor.resolveDst(dst.getDstChoice()));
ActionMultipathBuilder actionMultipathBuilder = new ActionMultipathBuilder();
actionMultipathBuilder.setNxActionMultipath(nxActionMultipathBuilder.build());
return ActionUtil.createAction(actionMultipathBuilder.build());
}
Aggregations