use of org.openkilda.wfm.topology.network.controller.isl.IslFsm.IslFsmEvent 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);
}
use of org.openkilda.wfm.topology.network.controller.isl.IslFsm.IslFsmEvent in project open-kilda by telstra.
the class IslFsm method fireBecomeStateEvent.
private void fireBecomeStateEvent(IslFsmContext context) {
IslFsmEvent route;
final IslStatus effectiveStatus = statusAggregator.getEffectiveStatus();
switch(effectiveStatus) {
case ACTIVE:
route = IslFsmEvent._BECOME_UP;
break;
case INACTIVE:
route = IslFsmEvent._BECOME_DOWN;
break;
case MOVED:
route = IslFsmEvent._BECOME_MOVED;
break;
default:
throw new IllegalArgumentException(makeInvalidMappingMessage(effectiveStatus.getClass(), IslFsmEvent.class, effectiveStatus));
}
fire(route, context);
}
Aggregations