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