1 package org.openkilda.service;
3 import java.util.Collection;
4 import java.util.HashMap;
8 import org.apache.log4j.Logger;
19 import org.springframework.beans.factory.annotation.Autowired;
20 import org.springframework.stereotype.Service;
32 private static final Logger LOGGER = Logger.getLogger(
FlowService.class);
49 return flowsIntegrationService.getFlows();
60 LOGGER.info(
"Inside ServiceFlowImpl method getFlowsCount");
61 Map<FlowCount, FlowCount> infoByFlowInfo =
new HashMap<>();
62 Map<String, String> csNames = switchIntegrationService.getCustomSwitchNameFromFile();
65 flows.forEach((flow) -> {
67 if (flow.getSource() != null) {
69 String srcSwitchName = switchIntegrationService.customSwitchName(csNames,
70 flow.getSource().getSwitchId());
73 if (flow.getDestination() != null) {
74 flowInfo.
setDstSwitch(flow.getDestination().getSwitchId());
75 String dstSwitchName = switchIntegrationService.customSwitchName(csNames,
76 flow.getDestination().getSwitchId());
81 if (infoByFlowInfo.containsKey(flowInfo)) {
82 infoByFlowInfo.get(flowInfo).incrementFlowCount();
84 infoByFlowInfo.put(flowInfo, flowInfo);
88 LOGGER.info(
"exit ServiceSwitchImpl method getFlowsCount");
89 return infoByFlowInfo.values();
99 return flowsIntegrationService.getFlowPath(flowId);
108 return flowsIntegrationService.getAllFlowList();
118 return flowsIntegrationService.rerouteFlow(flowId);
128 return flowsIntegrationService.validateFlow(flowId);
138 return flowsIntegrationService.getFlowById(flowId);
149 return flowsIntegrationService.getFlowStatusById(flowId);
160 return flowsIntegrationService.createFlow(flow);
171 return flowsIntegrationService.updateFlow(flowId, flow);
183 return flowsIntegrationService.deleteFlow(flowId);
Collection< FlowCount > getFlowsCount(final List< Flow > flows)
Flow deleteFlow(String flowId, UserInfo userInfo)
static boolean isEmpty(final Collection<?> collection)
void setFlowCount(final Integer flowCount)
String validateFlow(String flowId)
void setDstSwitch(final String dstSwitch)
List< Flow > getAllFlowList()
List< FlowInfo > getAllFlows()
void setSrcSwitchName(String srcSwitchName)
Flow getFlowById(String flowId)
FlowStatus getFlowStatusById(String flowId)
Flow updateFlow(String flowId, Flow flow)
FlowPath rerouteFlow(String flowId)
Flow createFlow(Flow flow)
FlowPayload getFlowPath(final String flowId)
void setSrcSwitch(final String srcSwitch)
void setDstSwitchName(String dstSwitchName)