use of org.openkilda.rulemanager.group.WatchGroup in project open-kilda by telstra.
the class Utils method buildMirrorBuckets.
/**
* Builds group buckets for flow mirror points (only for sink endpoints. Flow bucket must be build separately).
*/
public static List<Bucket> buildMirrorBuckets(FlowMirrorPoints flowMirrorPoints) {
List<Bucket> buckets = new ArrayList<>();
Set<MirrorConfigData> mirrorConfigDataSet = flowMirrorPoints.getMirrorPaths().stream().map(mirrorPath -> new MirrorConfigData(mirrorPath.getEgressPort(), mirrorPath.getEgressOuterVlan())).collect(Collectors.toSet());
for (MirrorConfigData mirrorConfig : mirrorConfigDataSet) {
Set<Action> actions = new HashSet<>(makeVlanReplaceActions(new ArrayList<>(), makeVlanStack(mirrorConfig.getMirrorVlan())));
actions.add(new PortOutAction(new PortNumber(mirrorConfig.getMirrorPort())));
buckets.add(Bucket.builder().writeActions(actions).watchGroup(WatchGroup.ANY).watchPort(WatchPort.ANY).build());
}
return buckets;
}
use of org.openkilda.rulemanager.group.WatchGroup in project open-kilda by telstra.
the class OfGroupConverter method fromOfBucket.
private Bucket fromOfBucket(OFBucket ofBucket) {
WatchGroup watchGroup = fromOfGroup(ofBucket.getWatchGroup());
WatchPort watchPort = fromOfPort(ofBucket.getWatchPort());
Set<Action> actions = new HashSet<>();
for (OFAction ofAction : ofBucket.getActions()) {
actions.add(OfInstructionsConverter.INSTANCE.convertToRuleManagerAction(ofAction));
}
return Bucket.builder().watchGroup(watchGroup).watchPort(watchPort).writeActions(actions).build();
}
Aggregations