Search in sources :

Example 41 with Endpoint

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

the class IslFsm method triggerAffectedFlowReroute.

private void triggerAffectedFlowReroute(IslFsmContext context) {
    String reason = makeRerouteAffectedReason(context.getEndpoint());
    // FIXME (surabujin): why do we send only one ISL endpoint here?
    Endpoint ingress = reference.getSource();
    PathNode pathNode = new PathNode(ingress.getDatapath(), ingress.getPortNumber(), 0);
    RerouteAffectedFlows trigger = new RerouteAffectedFlows(pathNode, reason);
    context.getOutput().triggerReroute(trigger);
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint) RerouteAffectedFlows(org.openkilda.messaging.command.reroute.RerouteAffectedFlows) PathNode(org.openkilda.messaging.info.event.PathNode)

Example 42 with Endpoint

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

the class IslFsm method sendRemoveIslResources.

private void sendRemoveIslResources(IIslCarrier carrier) {
    final Endpoint source = reference.getSource();
    final Endpoint dest = reference.getDest();
    sendRemoveIslResources(carrier, source, dest);
    sendRemoveIslResources(carrier, dest, source);
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint)

Example 43 with Endpoint

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

the class IslFsm method triggerDownFlowReroute.

private void triggerDownFlowReroute(IslFsmContext context) {
    if (shouldEmitDownFlowReroute()) {
        Endpoint ingress = reference.getSource();
        PathNode pathNode = new PathNode(ingress.getDatapath(), ingress.getPortNumber(), 0);
        RerouteInactiveFlows trigger = new RerouteInactiveFlows(pathNode, String.format("ISL %s status become %s", reference, IslStatus.ACTIVE));
        context.getOutput().triggerReroute(trigger);
    }
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint) PathNode(org.openkilda.messaging.info.event.PathNode) RerouteInactiveFlows(org.openkilda.messaging.command.reroute.RerouteInactiveFlows)

Example 44 with Endpoint

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

the class BiIslDataHolder method put.

public void put(Endpoint endpoint, T data) {
    int idx = dataIndexByEndpoint(reference, endpoint);
    islData.set(idx, data);
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint)

Example 45 with Endpoint

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

the class NetworkIslServiceTest method testResurrection.

private void testResurrection(IslReference reference, boolean shouldResurrect) {
    final Endpoint alphaEnd = reference.getSource();
    final Endpoint zetaEnd = reference.getDest();
    reset(carrier);
    service.islDefaultRuleDeleted(reference, new RemoveIslDefaultRulesResult(alphaEnd.getDatapath(), alphaEnd.getPortNumber(), zetaEnd.getDatapath(), zetaEnd.getPortNumber(), true));
    service.islDefaultRuleDeleted(reference, new RemoveIslDefaultRulesResult(zetaEnd.getDatapath(), zetaEnd.getPortNumber(), alphaEnd.getDatapath(), alphaEnd.getPortNumber(), true));
    if (!shouldResurrect) {
        verify(carrier).islRemovedNotification(eq(alphaEnd), eq(reference));
        verify(carrier).islRemovedNotification(eq(zetaEnd), eq(reference));
        verify(carrier).islChangedNotifyFlowMonitor(any(IslReference.class), eq(true));
    }
    verifyNoMoreInteractions(carrier);
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint) IslReference(org.openkilda.wfm.share.model.IslReference) RemoveIslDefaultRulesResult(org.openkilda.messaging.info.discovery.RemoveIslDefaultRulesResult)

Aggregations

Endpoint (org.openkilda.wfm.share.model.Endpoint)72 Test (org.junit.Test)33 Isl (org.openkilda.model.Isl)17 IslInfoData (org.openkilda.messaging.info.event.IslInfoData)13 SwitchId (org.openkilda.model.SwitchId)10 Switch (org.openkilda.model.Switch)8 IslReference (org.openkilda.wfm.share.model.IslReference)8 PathNode (org.openkilda.messaging.info.event.PathNode)7 Instant (java.time.Instant)6 IslDataHolder (org.openkilda.wfm.topology.network.model.IslDataHolder)6 HashSet (java.util.HashSet)4 Set (java.util.Set)4 DiscoverIslCommandData (org.openkilda.messaging.command.discovery.DiscoverIslCommandData)4 IslNotFoundException (org.openkilda.wfm.error.IslNotFoundException)4 Values (org.apache.storm.tuple.Values)3 IslRoundTripLatency (org.openkilda.messaging.info.event.IslRoundTripLatency)3 InMemoryGraphBasedTest (org.openkilda.persistence.inmemory.InMemoryGraphBasedTest)3 CommandContext (org.openkilda.wfm.CommandContext)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 HashMap (java.util.HashMap)2