Search in sources :

Example 1 with GroupCapability

use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupCapability in project openflowplugin by opendaylight.

the class MultipartReplyTranslatorUtil method translateGroupFeatures.

private static org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.reply.multipart.reply.body.MultipartReplyGroupFeatures translateGroupFeatures(final MultipartReply msg) {
    final MultipartReplyGroupFeaturesBuilder message = new MultipartReplyGroupFeaturesBuilder();
    final MultipartReplyGroupFeaturesCase caseBody = (MultipartReplyGroupFeaturesCase) msg.getMultipartReplyBody();
    final MultipartReplyGroupFeatures replyBody = caseBody.getMultipartReplyGroupFeatures();
    List<Class<? extends GroupType>> supportedGroups = new ArrayList<>();
    if (replyBody.getTypes().isOFPGTALL()) {
        supportedGroups.add(GroupAll.class);
    }
    if (replyBody.getTypes().isOFPGTSELECT()) {
        supportedGroups.add(GroupSelect.class);
    }
    if (replyBody.getTypes().isOFPGTINDIRECT()) {
        supportedGroups.add(GroupIndirect.class);
    }
    if (replyBody.getTypes().isOFPGTFF()) {
        supportedGroups.add(GroupFf.class);
    }
    message.setGroupTypesSupported(supportedGroups);
    message.setMaxGroups(replyBody.getMaxGroups());
    List<Class<? extends GroupCapability>> supportedCapabilities = new ArrayList<>();
    if (replyBody.getCapabilities().isOFPGFCCHAINING()) {
        supportedCapabilities.add(Chaining.class);
    }
    if (replyBody.getCapabilities().isOFPGFCCHAININGCHECKS()) {
        supportedCapabilities.add(ChainingChecks.class);
    }
    if (replyBody.getCapabilities().isOFPGFCSELECTLIVENESS()) {
        supportedCapabilities.add(SelectLiveness.class);
    }
    if (replyBody.getCapabilities().isOFPGFCSELECTWEIGHT()) {
        supportedCapabilities.add(SelectWeight.class);
    }
    message.setGroupCapabilitiesSupported(supportedCapabilities);
    message.setActions(GroupUtil.extractGroupActionsSupportBitmap(replyBody.getActionsBitmap()));
    return message.build();
}
Also used : MultipartReplyGroupFeaturesCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyGroupFeaturesCase) GroupType(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupType) MultipartReplyGroupFeatures(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.features._case.MultipartReplyGroupFeatures) ArrayList(java.util.ArrayList) MultipartReplyGroupFeaturesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.reply.multipart.reply.body.MultipartReplyGroupFeaturesBuilder) GroupCapability(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupCapability)

Aggregations

ArrayList (java.util.ArrayList)1 MultipartReplyGroupFeaturesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.reply.multipart.reply.body.MultipartReplyGroupFeaturesBuilder)1 GroupCapability (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupCapability)1 GroupType (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupType)1 MultipartReplyGroupFeaturesCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyGroupFeaturesCase)1 MultipartReplyGroupFeatures (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.features._case.MultipartReplyGroupFeatures)1