use of org.openkilda.rulemanager.Field in project open-kilda by telstra.
the class RuleManagerHelperTest method buildFullFlowSpeakerCommandData.
private FlowSpeakerData buildFullFlowSpeakerCommandData(MeterId goToMeterId, UUID dependsOnUuid) {
Set<FieldMatch> match = Arrays.stream(Field.values()).map(f -> FieldMatch.builder().field(f).value(f.ordinal()).mask(f.ordinal() + 1L).build()).collect(Collectors.toSet());
Set<OfFlowFlag> flags = Sets.newHashSet(OfFlowFlag.values());
List<Action> applyActions = new ArrayList<>(buildAllActions());
applyActions.addAll(buildAllActions());
Instructions instructions = Instructions.builder().goToMeter(goToMeterId).goToTable(OfTable.INPUT).writeMetadata(new OfMetadata(15, 0xff)).writeActions(new HashSet<>(buildAllActions())).applyActions(applyActions).build();
return FlowSpeakerData.builder().uuid(UUID.randomUUID()).cookie(new Cookie(123)).priority(PRIORITY).table(OfTable.INPUT).match(match).instructions(instructions).flags(flags).switchId(SWITCH_ID).ofVersion(OfVersion.OF_13).dependsOn(dependsOnUuid == null ? newArrayList() : newArrayList(dependsOnUuid)).build();
}
Aggregations