Search in sources :

Example 6 with IslFsm

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

the class NetworkIslService method islDefaultRuleDeleted.

/**
 * Process removed isl rule notification.
 * @param reference isl reference
 * @param payload target endpoint
 */
public void islDefaultRuleDeleted(IslReference reference, RemoveIslDefaultRulesResult payload) {
    log.debug("ISL service received isl rule removed for {} (on {})", reference, reference.getSource());
    IslFsm controller = this.controller.get(reference);
    if (controller == null) {
        log.info("Got clean up resources notification for not existing ISL {}", reference);
        return;
    }
    IslFsmContext context;
    if (payload.isSuccess()) {
        context = IslFsmContext.builder(carrier, reference.getSource()).removedRulesEndpoint(Endpoint.of(payload.getSrcSwitch(), payload.getSrcPort())).build();
        controllerExecutor.fire(controller, IslFsmEvent.ISL_RULE_REMOVED, context);
    } else {
        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)

Example 7 with IslFsm

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

the class NetworkIslService method remove.

/**
 * Remove isl by request.
 */
public void remove(IslReference reference) {
    log.debug("ISL service receive remove for {}", reference);
    IslFsm islFsm = controller.get(reference);
    if (islFsm == null) {
        log.info("Got DELETE request for not existing ISL {}", reference);
        return;
    }
    IslFsmContext context = IslFsmContext.builder(carrier, reference.getSource()).build();
    controllerExecutor.fire(islFsm, IslFsmEvent.ISL_REMOVE, context);
    removeIfCompleted(reference, islFsm);
}
Also used : IslFsm(org.openkilda.wfm.topology.network.controller.isl.IslFsm) IslFsmContext(org.openkilda.wfm.topology.network.controller.isl.IslFsm.IslFsmContext)

Example 8 with IslFsm

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

the class NetworkIslService method roundTripStatusNotification.

/**
 * Handle round trip status notification.
 */
public void roundTripStatusNotification(IslReference reference, RoundTripStatus status) {
    log.debug("ISL service receive ROUND TRIP STATUS for {} (on {})", reference, status.getEndpoint());
    IslFsm islFsm = this.controller.get(reference);
    if (islFsm == null) {
        log.debug("Ignore ROUND TRIP STATUS for for {} - ISL not found", reference);
        return;
    }
    IslFsmContext context = IslFsmContext.builder(carrier, status.getEndpoint()).roundTripStatus(status).build();
    controllerExecutor.fire(islFsm, IslFsmEvent.ROUND_TRIP_STATUS, context);
}
Also used : IslFsm(org.openkilda.wfm.topology.network.controller.isl.IslFsm) IslFsmContext(org.openkilda.wfm.topology.network.controller.isl.IslFsm.IslFsmContext)

Example 9 with IslFsm

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

the class NetworkIslService method islDefaultRuleInstalled.

/**
 * Process installed isl rule notification.
 * @param reference isl reference
 * @param payload response payload
 */
public void islDefaultRuleInstalled(IslReference reference, InstallIslDefaultRulesResult payload) {
    log.debug("ISL service received isl rule installed for {} (on {})", reference, reference.getSource());
    IslFsm islFsm = locateController(reference);
    IslFsmContext context;
    if (payload.isSuccess()) {
        context = IslFsmContext.builder(carrier, reference.getSource()).installedRulesEndpoint(Endpoint.of(payload.getSrcSwitch(), payload.getSrcPort())).build();
        controllerExecutor.fire(islFsm, IslFsmEvent.ISL_RULE_INSTALLED, context);
    } else {
        context = IslFsmContext.builder(carrier, reference.getSource()).build();
        controllerExecutor.fire(islFsm, IslFsmEvent.ISL_RULE_TIMEOUT, context);
    }
}
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