Search in sources :

Example 1 with LabelResourceEvent

use of org.onosproject.incubator.net.resource.label.LabelResourceEvent in project onos by opennetworkinglab.

the class DistributedLabelResourceStore method internalDestroy.

private boolean internalDestroy(DeviceId deviceId) {
    Versioned<LabelResourcePool> poolOld = resourcePool.get(deviceId);
    if (poolOld != null) {
        resourcePool.remove(deviceId);
        LabelResourceEvent event = new LabelResourceEvent(Type.POOL_DESTROYED, poolOld.value());
        notifyDelegate(event);
    }
    log.info("success to destroy the label resource pool of device id {}", deviceId);
    return true;
}
Also used : LabelResourceEvent(org.onosproject.incubator.net.resource.label.LabelResourceEvent) LabelResourcePool(org.onosproject.incubator.net.resource.label.LabelResourcePool)

Example 2 with LabelResourceEvent

use of org.onosproject.incubator.net.resource.label.LabelResourceEvent in project onos by opennetworkinglab.

the class DistributedLabelResourceStore method internalCreate.

private boolean internalCreate(LabelResourcePool pool) {
    Versioned<LabelResourcePool> poolOld = resourcePool.get(pool.deviceId());
    if (poolOld == null) {
        resourcePool.put(pool.deviceId(), pool);
        LabelResourceEvent event = new LabelResourceEvent(Type.POOL_CREATED, pool);
        notifyDelegate(event);
        return true;
    }
    return false;
}
Also used : LabelResourceEvent(org.onosproject.incubator.net.resource.label.LabelResourceEvent) LabelResourcePool(org.onosproject.incubator.net.resource.label.LabelResourcePool)

Aggregations

LabelResourceEvent (org.onosproject.incubator.net.resource.label.LabelResourceEvent)2 LabelResourcePool (org.onosproject.incubator.net.resource.label.LabelResourcePool)2