Search in sources :

Example 26 with YSubFlow

use of org.openkilda.model.YSubFlow in project open-kilda by telstra.

the class FermaYFlowRepositoryTest method createYFlow.

private YFlow createYFlow(String yFlowId, String flowId1, String flowId2) {
    YFlow yFlow = YFlow.builder().yFlowId(yFlowId).encapsulationType(FlowEncapsulationType.TRANSIT_VLAN).sharedEndpoint(new SharedEndpoint(SWITCH_ID_1, PORT_1)).build();
    Flow flow1 = createTestFlow(flowId1, switch1, PORT_1, VLAN_1, switch2, PORT_3, VLAN_3);
    Flow flow2 = createTestFlow(flowId2, switch1, PORT_1, VLAN_2, switch3, PORT_4, VLAN_3);
    YSubFlow subFlow1 = YSubFlow.builder().yFlow(yFlow).flow(flow1).endpointSwitchId(SWITCH_ID_2).endpointPort(PORT_3).endpointVlan(VLAN_3).sharedEndpointVlan(VLAN_1).build();
    YSubFlow subFlow2 = YSubFlow.builder().yFlow(yFlow).flow(flow2).endpointSwitchId(SWITCH_ID_3).endpointPort(PORT_4).endpointVlan(VLAN_3).sharedEndpointVlan(VLAN_2).build();
    yFlow.addSubFlow(subFlow1);
    yFlow.addSubFlow(subFlow2);
    yFlowRepository.add(yFlow);
    return yFlow;
}
Also used : YFlow(org.openkilda.model.YFlow) SharedEndpoint(org.openkilda.model.YFlow.SharedEndpoint) YSubFlow(org.openkilda.model.YSubFlow) Flow(org.openkilda.model.Flow) YFlow(org.openkilda.model.YFlow) YSubFlow(org.openkilda.model.YSubFlow)

Aggregations

YSubFlow (org.openkilda.model.YSubFlow)26 YFlow (org.openkilda.model.YFlow)24 Flow (org.openkilda.model.Flow)18 FlowProcessingException (org.openkilda.wfm.topology.flowhs.exception.FlowProcessingException)11 SwitchId (org.openkilda.model.SwitchId)7 ArrayList (java.util.ArrayList)6 FlowEndpoint (org.openkilda.model.FlowEndpoint)6 FlowPath (org.openkilda.model.FlowPath)5 Collection (java.util.Collection)4 HashSet (java.util.HashSet)4 List (java.util.List)4 ErrorType (org.openkilda.messaging.error.ErrorType)4 PathSegment (org.openkilda.model.PathSegment)4 PersistenceManager (org.openkilda.persistence.PersistenceManager)4 CommandContext (org.openkilda.wfm.CommandContext)4 Collectors (java.util.stream.Collectors)3 Slf4j (lombok.extern.slf4j.Slf4j)3 SubFlowDto (org.openkilda.messaging.command.yflow.SubFlowDto)3 SubFlowSharedEndpointEncapsulation (org.openkilda.messaging.command.yflow.SubFlowSharedEndpointEncapsulation)3 String.format (java.lang.String.format)2