Search in sources :

Example 1 with IslFsm

use of org.openkilda.wfm.topology.network.controller.isl.IslFsm in project open-kilda by telstra.

the class NetworkIslService method islDown.

/**
 * .
 */
public void islDown(Endpoint endpoint, IslReference reference, IslDownReason reason) {
    log.debug("ISL service receive FAIL notification for {} (on {})", reference, endpoint);
    IslFsm islFsm = locateController(reference);
    IslFsmContext context = IslFsmContext.builder(carrier, endpoint).downReason(reason).build();
    controllerExecutor.fire(islFsm, IslFsmEvent.ISL_DOWN, context);
}
Also used : IslFsm(org.openkilda.wfm.topology.network.controller.isl.IslFsm) IslFsmContext(org.openkilda.wfm.topology.network.controller.isl.IslFsm.IslFsmContext)

Example 2 with IslFsm

use of org.openkilda.wfm.topology.network.controller.isl.IslFsm in project open-kilda by telstra.

the class NetworkIslService method bfdStatusUpdate.

/**
 * Handle BFD status events.
 */
public void bfdStatusUpdate(Endpoint endpoint, IslReference reference, BfdStatusUpdate status) {
    log.debug("ISL service receive BFD status update for {} (on {}) - {}", reference, endpoint, status);
    IslFsm islFsm = locateController(reference);
    IslFsmEvent event;
    switch(status) {
        case UP:
            event = IslFsmEvent.BFD_UP;
            break;
        case DOWN:
            event = IslFsmEvent.BFD_DOWN;
            break;
        case KILL:
            event = IslFsmEvent.BFD_KILL;
            break;
        case FAIL:
            event = IslFsmEvent.BFD_FAIL;
            break;
        default:
            throw new IllegalArgumentException(format("Unsupported %s value %s", status.getClass().getName(), status));
    }
    IslFsmContext context = IslFsmContext.builder(carrier, endpoint).build();
    controllerExecutor.fire(islFsm, event, context);
}
Also used : IslFsm(org.openkilda.wfm.topology.network.controller.isl.IslFsm) IslFsmContext(org.openkilda.wfm.topology.network.controller.isl.IslFsm.IslFsmContext) IslFsmEvent(org.openkilda.wfm.topology.network.controller.isl.IslFsm.IslFsmEvent)

Example 3 with IslFsm

use of org.openkilda.wfm.topology.network.controller.isl.IslFsm in project open-kilda by telstra.

the class NetworkIslService method islUp.

/**
 * .
 */
public void islUp(Endpoint endpoint, IslReference reference, IslDataHolder islData) {
    log.debug("ISL service receive DISCOVERY notification for {} (on {})", reference, endpoint);
    IslFsm islFsm = locateControllerCreateIfAbsent(endpoint, reference);
    IslFsmContext context = IslFsmContext.builder(carrier, endpoint).islData(islData).build();
    controllerExecutor.fire(islFsm, IslFsmEvent.ISL_UP, context);
}
Also used : IslFsm(org.openkilda.wfm.topology.network.controller.isl.IslFsm) IslFsmContext(org.openkilda.wfm.topology.network.controller.isl.IslFsm.IslFsmContext)

Example 4 with IslFsm

use of org.openkilda.wfm.topology.network.controller.isl.IslFsm in project open-kilda by telstra.

the class NetworkIslService method islMove.

/**
 * .
 */
public void islMove(Endpoint endpoint, IslReference reference) {
    log.debug("ISL service receive MOVED(FAIL) notification for {} (on {})", reference, endpoint);
    IslFsm islFsm = locateController(reference);
    IslFsmContext context = IslFsmContext.builder(carrier, endpoint).build();
    controllerExecutor.fire(islFsm, IslFsmEvent.ISL_MOVE, context);
}
Also used : IslFsm(org.openkilda.wfm.topology.network.controller.isl.IslFsm) IslFsmContext(org.openkilda.wfm.topology.network.controller.isl.IslFsm.IslFsmContext)

Example 5 with IslFsm

use of org.openkilda.wfm.topology.network.controller.isl.IslFsm in project open-kilda by telstra.

the class NetworkIslService method islDefaultTimeout.

/**
 * Process isl rule timeout notification.
 * @param reference isl reference
 * @param endpoint target endpoint
 */
public void islDefaultTimeout(IslReference reference, Endpoint endpoint) {
    log.debug("ISL service received isl rule timeout notification for {} (on {})", reference, reference.getSource());
    IslFsm controller = locateController(reference);
    IslFsmContext context = IslFsmContext.builder(carrier, reference.getSource()).build();
    controllerExecutor.fire(controller, IslFsmEvent.ISL_RULE_TIMEOUT, context);
    removeIfCompleted(reference, controller);
}
Also used : IslFsm(org.openkilda.wfm.topology.network.controller.isl.IslFsm) IslFsmContext(org.openkilda.wfm.topology.network.controller.isl.IslFsm.IslFsmContext)

Aggregations

IslFsm (org.openkilda.wfm.topology.network.controller.isl.IslFsm)9 IslFsmContext (org.openkilda.wfm.topology.network.controller.isl.IslFsm.IslFsmContext)9 IslFsmEvent (org.openkilda.wfm.topology.network.controller.isl.IslFsm.IslFsmEvent)1