Search in sources :

Example 1 with PathContext

use of org.openkilda.wfm.share.model.SpeakerRequestBuildContext.PathContext in project open-kilda by telstra.

the class BaseFlowRuleRemovalAction method buildSpeakerContextForRemovalIngressAndShared.

protected SpeakerRequestBuildContext buildSpeakerContextForRemovalIngressAndShared(RequestedFlow oldFlow, RequestedFlow newFlow, boolean removeMeters) {
    SwitchProperties srcSwitchProperties = getSwitchProperties(oldFlow.getSrcSwitch());
    boolean server42FlowRttToggle = isServer42FlowRttFeatureToggle();
    boolean srcServer42FlowRtt = srcSwitchProperties.isServer42FlowRtt() && server42FlowRttToggle;
    FlowEndpoint oldIngress = new FlowEndpoint(oldFlow.getSrcSwitch(), oldFlow.getSrcPort(), oldFlow.getSrcVlan(), oldFlow.getSrcInnerVlan());
    FlowEndpoint oldEgress = new FlowEndpoint(oldFlow.getDestSwitch(), oldFlow.getDestPort(), oldFlow.getDestVlan(), oldFlow.getDestInnerVlan());
    FlowEndpoint newIngress = new FlowEndpoint(newFlow.getSrcSwitch(), newFlow.getSrcPort(), newFlow.getSrcVlan(), newFlow.getSrcInnerVlan());
    FlowEndpoint newEgress = new FlowEndpoint(newFlow.getDestSwitch(), newFlow.getDestPort(), newFlow.getDestVlan(), newFlow.getDestInnerVlan());
    PathContext forwardPathContext = PathContext.builder().removeCustomerPortRule(removeForwardCustomerPortSharedCatchRule(oldFlow, newFlow)).removeCustomerPortLldpRule(removeForwardSharedLldpRule(oldFlow, newFlow)).removeCustomerPortArpRule(removeForwardSharedArpRule(oldFlow, newFlow)).removeOuterVlanMatchSharedRule(removeOuterVlanMatchSharedRule(oldFlow.getFlowId(), oldIngress, newIngress)).removeServer42InputRule(removeForwardSharedServer42InputRule(oldFlow, newFlow, srcServer42FlowRtt)).removeServer42IngressRule(srcServer42FlowRtt).updateMeter(removeMeters).removeServer42OuterVlanMatchSharedRule(srcServer42FlowRtt && removeServer42OuterVlanMatchSharedRule(oldFlow, oldIngress, newIngress)).server42Port(srcSwitchProperties.getServer42Port()).server42MacAddress(srcSwitchProperties.getServer42MacAddress()).build();
    SwitchProperties dstSwitchProperties = getSwitchProperties(oldFlow.getDestSwitch());
    boolean dstServer42FlowRtt = dstSwitchProperties.isServer42FlowRtt() && server42FlowRttToggle;
    PathContext reversePathContext = PathContext.builder().removeCustomerPortRule(removeReverseCustomerPortSharedCatchRule(oldFlow, newFlow)).removeCustomerPortLldpRule(removeReverseSharedLldpRule(oldFlow, newFlow)).removeCustomerPortArpRule(removeReverseSharedArpRule(oldFlow, newFlow)).removeOuterVlanMatchSharedRule(removeOuterVlanMatchSharedRule(oldFlow.getFlowId(), oldEgress, newEgress)).removeServer42InputRule(removeReverseSharedServer42InputRule(oldFlow, newFlow, dstServer42FlowRtt)).removeServer42IngressRule(dstServer42FlowRtt).updateMeter(removeMeters).removeServer42OuterVlanMatchSharedRule(dstServer42FlowRtt && removeServer42OuterVlanMatchSharedRule(oldFlow, oldEgress, newEgress)).server42Port(dstSwitchProperties.getServer42Port()).server42MacAddress(dstSwitchProperties.getServer42MacAddress()).build();
    return SpeakerRequestBuildContext.builder().forward(forwardPathContext).reverse(reversePathContext).build();
}
Also used : PathContext(org.openkilda.wfm.share.model.SpeakerRequestBuildContext.PathContext) FlowEndpoint(org.openkilda.model.FlowEndpoint) SwitchProperties(org.openkilda.model.SwitchProperties)

Aggregations

FlowEndpoint (org.openkilda.model.FlowEndpoint)1 SwitchProperties (org.openkilda.model.SwitchProperties)1 PathContext (org.openkilda.wfm.share.model.SpeakerRequestBuildContext.PathContext)1