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;
}
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);
}
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);
}
Aggregations