Search in sources :

Example 6 with FlowDumpData

use of org.openkilda.wfm.share.history.model.FlowDumpData in project open-kilda by telstra.

the class HistoryMapper method map.

/**
 * Note: you have to additionally set {@link org.openkilda.wfm.share.history.model.FlowDumpData.DumpType}
 * to the dump data.
 */
public FlowDumpData map(Flow flow, FlowResources resources, DumpType dumpType) {
    FlowDumpData result = generatedMap(flow, resources, dumpType);
    FlowSegmentCookieBuilder cookieBuilder = FlowSegmentCookie.builder().flowEffectiveId(resources.getUnmaskedCookie());
    result.setForwardCookie(cookieBuilder.direction(FlowPathDirection.FORWARD).build());
    result.setReverseCookie(cookieBuilder.direction(FlowPathDirection.REVERSE).build());
    return result;
}
Also used : FlowDumpData(org.openkilda.wfm.share.history.model.FlowDumpData) FlowSegmentCookieBuilder(org.openkilda.model.cookie.FlowSegmentCookie.FlowSegmentCookieBuilder)

Example 7 with FlowDumpData

use of org.openkilda.wfm.share.history.model.FlowDumpData in project open-kilda by telstra.

the class BaseFlowPathRemovalAction method saveRemovalActionWithDumpToHistory.

protected void saveRemovalActionWithDumpToHistory(T stateMachine, Flow flow, FlowPathPair pathPair) {
    FlowDumpData flowDumpData = HistoryMapper.INSTANCE.map(flow, pathPair.getForward(), pathPair.getReverse(), DumpType.STATE_BEFORE);
    stateMachine.saveActionWithDumpToHistory("Flow paths were removed", format("The flow paths %s / %s were removed", pathPair.getForwardPathId(), pathPair.getReversePathId()), flowDumpData);
}
Also used : FlowDumpData(org.openkilda.wfm.share.history.model.FlowDumpData)

Example 8 with FlowDumpData

use of org.openkilda.wfm.share.history.model.FlowDumpData in project open-kilda by telstra.

the class RevertResourceAllocationAction method saveHistory.

private void saveHistory(FlowRerouteFsm stateMachine, Flow flow, FlowResources resources) {
    FlowDumpData flowDumpData = HistoryMapper.INSTANCE.map(flow, resources, DumpType.STATE_BEFORE);
    stateMachine.saveActionWithDumpToHistory("Flow resources were deallocated", format("The flow resources for %s / %s were deallocated", resources.getForward().getPathId(), resources.getReverse().getPathId()), flowDumpData);
}
Also used : FlowDumpData(org.openkilda.wfm.share.history.model.FlowDumpData)

Aggregations

FlowDumpData (org.openkilda.wfm.share.history.model.FlowDumpData)8 Flow (org.openkilda.model.Flow)1 YFlow (org.openkilda.model.YFlow)1 YSubFlow (org.openkilda.model.YSubFlow)1 FlowSegmentCookieBuilder (org.openkilda.model.cookie.FlowSegmentCookie.FlowSegmentCookieBuilder)1 EndpointUpdate (org.openkilda.wfm.topology.flowhs.fsm.update.FlowUpdateFsm.EndpointUpdate)1 FlowLoopOperation (org.openkilda.wfm.topology.flowhs.fsm.update.FlowUpdateFsm.FlowLoopOperation)1 RequestedFlow (org.openkilda.wfm.topology.flowhs.model.RequestedFlow)1