use of org.openkilda.rulemanager.adapter.PersistenceDataAdapter in project open-kilda by telstra.
the class SwitchValidateFsm method validateEnter.
protected void validateEnter(SwitchValidateState from, SwitchValidateState to, SwitchValidateEvent event, SwitchValidateContext context) {
SwitchId switchId = getSwitchId();
Set<PathId> flowPathIds = flowPathRepository.findBySegmentSwitch(switchId).stream().map(FlowPath::getPathId).collect(Collectors.toSet());
flowPathIds.addAll(flowPathRepository.findByEndpointSwitch(switchId).stream().map(FlowPath::getPathId).collect(Collectors.toSet()));
PersistenceDataAdapter dataAdapter = PersistenceDataAdapter.builder().persistenceManager(persistenceManager).switchIds(Collections.singleton(switchId)).pathIds(flowPathIds).keepMultitableForFlow(true).build();
List<SpeakerData> expectedEntities = ruleManager.buildRulesForSwitch(switchId, dataAdapter);
List<FlowSpeakerData> expectedRules = filterSpeakerData(expectedEntities, FlowSpeakerData.class);
List<MeterSpeakerData> expectedMeters = filterSpeakerData(expectedEntities, MeterSpeakerData.class);
List<GroupSpeakerData> expectedGroups = filterSpeakerData(expectedEntities, GroupSpeakerData.class);
validateRules(expectedRules);
validateMeters(expectedMeters);
validateGroups(expectedGroups);
validateLogicalPorts();
}
Aggregations