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();
}
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();
}
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());
}
Aggregations