Search in sources :

Example 1 with ActionFinTimeoutBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionFinTimeoutBuilder 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());
}
Also used : NxActionFinTimeoutBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder) NxActionFinTimeoutGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionFinTimeoutGrouping) NxActionFinTimeoutBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder) ActionFinTimeoutBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionFinTimeoutBuilder)

Example 2 with ActionFinTimeoutBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionFinTimeoutBuilder 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();
}
Also used : NxActionFinTimeoutBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder) 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) NxActionFinTimeoutBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder) ActionFinTimeoutBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionFinTimeoutBuilder)

Example 3 with ActionFinTimeoutBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionFinTimeoutBuilder 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();
}
Also used : NxActionFinTimeoutBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) ActionFinTimeoutBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionFinTimeoutBuilder) NxActionFinTimeoutBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder)

Aggregations

ActionFinTimeoutBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionFinTimeoutBuilder)3 NxActionFinTimeoutBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder)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)1 NxActionFinTimeoutGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionFinTimeoutGrouping)1