use of org.openkilda.messaging.command.flow.InstallEgressMirrorFlow in project open-kilda by telstra.
the class FlowCommandFactory method buildInstallEgressMirrorFlow.
/**
* Generate install egress mirror flow command.
*
* @param flowPath flow path with segments to be used for building of install rules.
* @param inputPortNo the number of input port.
* @param encapsulationResources the encapsulation resources.
* @param multiTable use multi table.
* @return install egress flow command
*/
public InstallEgressMirrorFlow buildInstallEgressMirrorFlow(FlowPath flowPath, int inputPortNo, EncapsulationResources encapsulationResources, boolean multiTable, MirrorConfig mirrorConfig) {
Flow flow = flowPath.getFlow();
FlowEndpoint ingressEndpoint = FlowSideAdapter.makeIngressAdapter(flow, flowPath).getEndpoint();
FlowEndpoint egressEndpoint = FlowSideAdapter.makeEgressAdapter(flow, flowPath).getEndpoint();
return new InstallEgressMirrorFlow(transactionIdGenerator.generate(), flow.getFlowId(), flowPath.getCookie().toBuilder().mirror(true).build().getValue(), egressEndpoint.getSwitchId(), inputPortNo, egressEndpoint.getPortNumber(), encapsulationResources.getTransitEncapsulationId(), encapsulationResources.getEncapsulationType(), egressEndpoint.getOuterVlanId(), egressEndpoint.getInnerVlanId(), getOutputVlanType(flow, flowPath), multiTable, ingressEndpoint, mirrorConfig);
}
Aggregations