Search in sources :

Example 1 with FlowRemovedMaskBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMaskBuilder in project openflowplugin by opendaylight.

the class SetAsyncInputMessageFactory method decodeFlowRemovedMask.

private static List<FlowRemovedMask> decodeFlowRemovedMask(ByteBuf input) {
    List<FlowRemovedMask> inMasks = new ArrayList<>();
    FlowRemovedMaskBuilder maskBuilder;
    for (int i = 0; i < SEPARATE_ROLES; i++) {
        maskBuilder = new FlowRemovedMaskBuilder();
        maskBuilder.setMask(decodeFlowRemovedReasons(input.readUnsignedInt()));
        inMasks.add(maskBuilder.build());
    }
    return inMasks;
}
Also used : FlowRemovedMaskBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMaskBuilder) ArrayList(java.util.ArrayList) FlowRemovedMask(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMask)

Example 2 with FlowRemovedMaskBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMaskBuilder in project openflowplugin by opendaylight.

the class GetAsyncReplyMessageFactory method decodeFlowRemovedMask.

private static List<FlowRemovedMask> decodeFlowRemovedMask(ByteBuf input) {
    List<FlowRemovedMask> inMasks = new ArrayList<>();
    FlowRemovedMaskBuilder maskBuilder;
    for (int i = 0; i < SEPARATE_ROLES; i++) {
        maskBuilder = new FlowRemovedMaskBuilder();
        maskBuilder.setMask(decodeFlowRemovedReasons(input.readUnsignedInt()));
        inMasks.add(maskBuilder.build());
    }
    return inMasks;
}
Also used : FlowRemovedMaskBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMaskBuilder) ArrayList(java.util.ArrayList) FlowRemovedMask(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMask)

Example 3 with FlowRemovedMaskBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMaskBuilder in project openflowplugin by opendaylight.

the class GetAsyncReplyMessageFactoryTest method createFlowRemovedMask.

private static List<FlowRemovedMask> createFlowRemovedMask() {
    final List<FlowRemovedMask> inMasks = new ArrayList<>();
    FlowRemovedMaskBuilder maskBuilder;
    // OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
    maskBuilder = new FlowRemovedMaskBuilder();
    List<FlowRemovedReason> reasons = new ArrayList<>();
    reasons.add(FlowRemovedReason.OFPRRIDLETIMEOUT);
    reasons.add(FlowRemovedReason.OFPRRHARDTIMEOUT);
    reasons.add(FlowRemovedReason.OFPRRDELETE);
    reasons.add(FlowRemovedReason.OFPRRGROUPDELETE);
    maskBuilder.setMask(reasons);
    inMasks.add(maskBuilder.build());
    // OFPCR_ROLE_SLAVE
    maskBuilder = new FlowRemovedMaskBuilder();
    reasons = new ArrayList<>();
    maskBuilder.setMask(reasons);
    inMasks.add(maskBuilder.build());
    return inMasks;
}
Also used : FlowRemovedMaskBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMaskBuilder) ArrayList(java.util.ArrayList) FlowRemovedMask(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMask) FlowRemovedReason(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowRemovedReason)

Example 4 with FlowRemovedMaskBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMaskBuilder in project openflowplugin by opendaylight.

the class SetAsyncInputMessageFactoryTest method createFlowRemowedMask.

private static List<FlowRemovedMask> createFlowRemowedMask() {
    final List<FlowRemovedMask> masks = new ArrayList<>();
    FlowRemovedMaskBuilder builder;
    // OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
    builder = new FlowRemovedMaskBuilder();
    List<FlowRemovedReason> flowRemovedReasonList = new ArrayList<>();
    flowRemovedReasonList.add(FlowRemovedReason.OFPRRIDLETIMEOUT);
    flowRemovedReasonList.add(FlowRemovedReason.OFPRRHARDTIMEOUT);
    flowRemovedReasonList.add(FlowRemovedReason.OFPRRDELETE);
    flowRemovedReasonList.add(FlowRemovedReason.OFPRRGROUPDELETE);
    builder.setMask(flowRemovedReasonList);
    masks.add(builder.build());
    // OFPCR_ROLE_SLAVE
    builder = new FlowRemovedMaskBuilder();
    flowRemovedReasonList = new ArrayList<>();
    builder.setMask(flowRemovedReasonList);
    masks.add(builder.build());
    return masks;
}
Also used : FlowRemovedMaskBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMaskBuilder) ArrayList(java.util.ArrayList) FlowRemovedMask(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMask) FlowRemovedReason(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowRemovedReason)

Example 5 with FlowRemovedMaskBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMaskBuilder in project openflowplugin by opendaylight.

the class GetAsyncReplyMessageFactoryTest method createFlowRemowedMask.

private static List<FlowRemovedMask> createFlowRemowedMask() {
    final List<FlowRemovedMask> masks = new ArrayList<>();
    FlowRemovedMaskBuilder builder;
    // OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
    builder = new FlowRemovedMaskBuilder();
    List<FlowRemovedReason> flowRemovedReasonList = new ArrayList<>();
    flowRemovedReasonList.add(FlowRemovedReason.OFPRRIDLETIMEOUT);
    flowRemovedReasonList.add(FlowRemovedReason.OFPRRHARDTIMEOUT);
    flowRemovedReasonList.add(FlowRemovedReason.OFPRRDELETE);
    flowRemovedReasonList.add(FlowRemovedReason.OFPRRGROUPDELETE);
    builder.setMask(flowRemovedReasonList);
    masks.add(builder.build());
    // OFPCR_ROLE_SLAVE
    builder = new FlowRemovedMaskBuilder();
    flowRemovedReasonList = new ArrayList<>();
    builder.setMask(flowRemovedReasonList);
    masks.add(builder.build());
    return masks;
}
Also used : FlowRemovedMaskBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMaskBuilder) ArrayList(java.util.ArrayList) FlowRemovedMask(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMask) FlowRemovedReason(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowRemovedReason)

Aggregations

ArrayList (java.util.ArrayList)6 FlowRemovedMask (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMask)6 FlowRemovedMaskBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.FlowRemovedMaskBuilder)6 FlowRemovedReason (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowRemovedReason)4