Search in sources :

Example 1 with NxActionMultipathGrouping

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());
}
Also used : NxActionMultipathBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.NxActionMultipathBuilder) ActionMultipathBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipathBuilder) NxActionMultipathBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.NxActionMultipathBuilder) Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.nx.multipath.Dst) NxActionMultipathGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionMultipathGrouping)

Aggregations

ActionMultipathBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipathBuilder)1 NxActionMultipathBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.NxActionMultipathBuilder)1 NxActionMultipathGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionMultipathGrouping)1 Dst (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.nx.multipath.Dst)1