use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder in project openflowplugin by opendaylight.
the class FinTimeoutConvertor method convert.
@Override
public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
Preconditions.checkArgument(nxActionArg instanceof NxActionFinTimeoutGrouping);
NxActionFinTimeoutGrouping nxAction = (NxActionFinTimeoutGrouping) nxActionArg;
ActionFinTimeoutBuilder builder = new ActionFinTimeoutBuilder();
NxActionFinTimeoutBuilder nxActionFinTimeoutBuilder = new NxActionFinTimeoutBuilder();
nxActionFinTimeoutBuilder.setFinIdleTimeout(nxAction.getNxActionFinTimeout().getFinIdleTimeout());
nxActionFinTimeoutBuilder.setFinHardTimeout(nxAction.getNxActionFinTimeout().getFinHardTimeout());
builder.setNxActionFinTimeout(nxActionFinTimeoutBuilder.build());
return ActionUtil.createAction(builder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder in project openflowplugin by opendaylight.
the class FinTimeoutCodecTest method createAction.
private Action createAction(Short idleTimeout, Short hardTimeout) {
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
ActionFinTimeoutBuilder actionFinTimeoutBuilder = new ActionFinTimeoutBuilder();
NxActionFinTimeoutBuilder nxActionFinTimeoutBuilder = new NxActionFinTimeoutBuilder();
if (idleTimeout != null) {
nxActionFinTimeoutBuilder.setFinIdleTimeout(idleTimeout.intValue());
}
if (hardTimeout != null) {
nxActionFinTimeoutBuilder.setFinHardTimeout(hardTimeout.intValue());
}
actionFinTimeoutBuilder.setNxActionFinTimeout(nxActionFinTimeoutBuilder.build());
actionBuilder.setActionChoice(actionFinTimeoutBuilder.build());
return actionBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder in project openflowplugin by opendaylight.
the class FinTimeoutCodec method deserialize.
@Override
public Action deserialize(final ByteBuf message) {
final ActionBuilder actionBuilder = deserializeHeader(message);
ActionFinTimeoutBuilder builder = new ActionFinTimeoutBuilder();
NxActionFinTimeoutBuilder nxActionFinTimeoutBuilder = new NxActionFinTimeoutBuilder();
nxActionFinTimeoutBuilder.setFinIdleTimeout(message.readUnsignedShort());
nxActionFinTimeoutBuilder.setFinHardTimeout(message.readUnsignedShort());
builder.setNxActionFinTimeout(nxActionFinTimeoutBuilder.build());
message.skipBytes(PADDING);
actionBuilder.setActionChoice(builder.build());
return actionBuilder.build();
}
Aggregations