Search in sources :

Example 1 with FlowsPayload

use of org.openkilda.messaging.payload.flow.FlowsPayload in project open-kilda by telstra.

the class FlowServiceImpl method getFlows.

/**
 * {@inheritDoc}
 */
@Override
public InfoMessage getFlows(final FlowIdStatusPayload payload, final String correlationId) {
    Set<Flow> flows = flowRepository.findAll();
    List<FlowPayload> flowsPayload = new ArrayList<>(flows.size() / 2);
    for (Flow flow : flows) {
        if ((flow.getCookie() & DIRECT_FLOW_COOKIE) == DIRECT_FLOW_COOKIE) {
            flowsPayload.add(getFlowPayloadByFlow(flow));
        }
    }
    logger.debug("Flows get: {}", flowsPayload);
    return new InfoMessage(new FlowsResponse(new FlowsPayload(flowsPayload)), System.currentTimeMillis(), correlationId, Destination.WFM);
}
Also used : FlowPayload(org.openkilda.messaging.payload.flow.FlowPayload) InfoMessage(org.openkilda.messaging.info.InfoMessage) FlowsResponse(org.openkilda.messaging.info.flow.FlowsResponse) ArrayList(java.util.ArrayList) FlowsPayload(org.openkilda.messaging.payload.flow.FlowsPayload) Flow(org.openkilda.topology.domain.Flow)

Aggregations

ArrayList (java.util.ArrayList)1 InfoMessage (org.openkilda.messaging.info.InfoMessage)1 FlowsResponse (org.openkilda.messaging.info.flow.FlowsResponse)1 FlowPayload (org.openkilda.messaging.payload.flow.FlowPayload)1 FlowsPayload (org.openkilda.messaging.payload.flow.FlowsPayload)1 Flow (org.openkilda.topology.domain.Flow)1