Search in sources :

Example 1 with ActionLearnBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearnBuilder in project openflowplugin by opendaylight.

the class LearnCodec method deserialize.

@Override
public Action deserialize(final ByteBuf message) {
    ActionBuilder actionBuilder = new ActionBuilder();
    actionBuilder.setExperimenterId(new ExperimenterId(NiciraConstants.NX_VENDOR_ID));
    short length = LearnCodecUtil.deserializeHeader(message);
    final ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
    NxActionLearnBuilder nxActionLearnBuilder = new NxActionLearnBuilder();
    LearnCodecUtil.deserializeLearnHeader(message, nxActionLearnBuilder);
    length -= LearnCodecUtil.HEADER_LENGTH;
    LearnCodecUtil.buildFlowModSpecs(nxActionLearnBuilder, message, length);
    actionLearnBuilder.setNxActionLearn(nxActionLearnBuilder.build());
    actionBuilder.setActionChoice(actionLearnBuilder.build());
    return actionBuilder.build();
}
Also used : NxActionLearnBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.NxActionLearnBuilder) ActionLearnBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearnBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) ExperimenterId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId) NxActionLearnBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.NxActionLearnBuilder)

Example 2 with ActionLearnBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearnBuilder in project openflowplugin by opendaylight.

the class LearnCodecTest method createAction.

private Action createAction() {
    ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
    ActionBuilder actionBuilder = new ActionBuilder();
    actionBuilder.setExperimenterId(experimenterId);
    final ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
    NxActionLearnBuilder nxActionLearnBuilder = new NxActionLearnBuilder();
    nxActionLearnBuilder.setIdleTimeout(1);
    nxActionLearnBuilder.setHardTimeout(2);
    nxActionLearnBuilder.setPriority(3);
    nxActionLearnBuilder.setCookie(BigInteger.valueOf(4));
    nxActionLearnBuilder.setFlags(5);
    nxActionLearnBuilder.setTableId((short) 6);
    nxActionLearnBuilder.setFinIdleTimeout(7);
    nxActionLearnBuilder.setFinHardTimeout(8);
    nxActionLearnBuilder.setFlowMods(createFlowMods());
    actionLearnBuilder.setNxActionLearn(nxActionLearnBuilder.build());
    actionBuilder.setActionChoice(actionLearnBuilder.build());
    return actionBuilder.build();
}
Also used : NxActionLearnBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.NxActionLearnBuilder) ActionLearnBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearnBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) ExperimenterId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId) NxActionLearnBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.NxActionLearnBuilder)

Example 3 with ActionLearnBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearnBuilder in project openflowplugin by opendaylight.

the class LearnConvertor method convert.

@Override
public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
    Preconditions.checkArgument(nxActionArg instanceof NxActionLearnGrouping);
    NxActionLearnGrouping nxAction = (NxActionLearnGrouping) nxActionArg;
    NxActionLearnBuilder nxActionLearnBuilder = new NxActionLearnBuilder();
    LearnConvertorUtil.convertDown(nxAction, nxActionLearnBuilder);
    ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
    actionLearnBuilder.setNxActionLearn(nxActionLearnBuilder.build());
    return ActionUtil.createAction(actionLearnBuilder.build());
}
Also used : NxActionLearnBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.NxActionLearnBuilder) ActionLearnBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearnBuilder) NxActionLearnGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionLearnGrouping) NxActionLearnBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.NxActionLearnBuilder)

Aggregations

ActionLearnBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearnBuilder)3 NxActionLearnBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.NxActionLearnBuilder)3 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder)2 ExperimenterId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId)2 NxActionLearnGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionLearnGrouping)1