Search in sources :

Example 1 with UpgradeEvent

use of org.onosproject.upgrade.UpgradeEvent in project onos by opennetworkinglab.

the class UpgradeManager method handleUpgradeEvent.

/**
 * Handles an upgrade state event.
 *
 * @param event the upgrade value event
 */
protected void handleUpgradeEvent(AtomicValueEvent<Upgrade> event) {
    checkPermission(UPGRADE_EVENT);
    currentState.set(event.newValue());
    switch(event.newValue().status()) {
        case INITIALIZED:
            post(new UpgradeEvent(UpgradeEvent.Type.INITIALIZED, event.newValue()));
            break;
        case UPGRADED:
            post(new UpgradeEvent(UpgradeEvent.Type.UPGRADED, event.newValue()));
            break;
        case COMMITTED:
            post(new UpgradeEvent(UpgradeEvent.Type.COMMITTED, event.newValue()));
            break;
        case ROLLED_BACK:
            post(new UpgradeEvent(UpgradeEvent.Type.ROLLED_BACK, event.newValue()));
            break;
        case RESET:
            post(new UpgradeEvent(UpgradeEvent.Type.RESET, event.newValue()));
            break;
        default:
            break;
    }
}
Also used : UpgradeEvent(org.onosproject.upgrade.UpgradeEvent)

Aggregations

UpgradeEvent (org.onosproject.upgrade.UpgradeEvent)1