Search in sources :

Example 1 with SwitchMissingGroupException

use of org.openkilda.floodlight.error.SwitchMissingGroupException in project open-kilda by telstra.

the class GroupVerifyCommand method handleGroupStats.

private MirrorConfig handleGroupStats(List<OFGroupDescStatsReply> groupDescStatsReply) {
    OFGroupDescStatsEntry target = null;
    List<OFGroupDescStatsEntry> groupDescStatsEntries = groupDescStatsReply.stream().map(OFGroupDescStatsReply::getEntries).flatMap(List::stream).collect(toList());
    for (OFGroupDescStatsEntry entry : groupDescStatsEntries) {
        if (mirrorConfig.getGroupId().intValue() == entry.getGroup().getGroupNumber()) {
            target = entry;
            break;
        }
    }
    if (target == null) {
        throw maskCallbackException(new SwitchMissingGroupException(getSw().getId(), mirrorConfig.getGroupId()));
    }
    validateGroupConfig(target);
    return mirrorConfig;
}
Also used : SwitchMissingGroupException(org.openkilda.floodlight.error.SwitchMissingGroupException) OFGroupDescStatsEntry(org.projectfloodlight.openflow.protocol.OFGroupDescStatsEntry) OFGroupDescStatsReply(org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply)

Aggregations

SwitchMissingGroupException (org.openkilda.floodlight.error.SwitchMissingGroupException)1 OFGroupDescStatsEntry (org.projectfloodlight.openflow.protocol.OFGroupDescStatsEntry)1 OFGroupDescStatsReply (org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply)1