Search in sources :

Example 1 with TributarySlotQuery

use of org.onosproject.net.behaviour.TributarySlotQuery in project onos by opennetworkinglab.

the class ResourceDeviceListener method queryTributarySlots.

private Set<TributarySlot> queryTributarySlots(DeviceId device, PortNumber port) {
    try {
        DriverHandler handler = driverService.createHandler(device);
        if (handler == null || !handler.hasBehaviour(TributarySlotQuery.class)) {
            return Collections.emptySet();
        }
        TributarySlotQuery query = handler.behaviour(TributarySlotQuery.class);
        if (query != null) {
            return query.queryTributarySlots(port);
        } else {
            return Collections.emptySet();
        }
    } catch (ItemNotFoundException e) {
        return Collections.emptySet();
    }
}
Also used : DriverHandler(org.onosproject.net.driver.DriverHandler) TributarySlotQuery(org.onosproject.net.behaviour.TributarySlotQuery) ItemNotFoundException(org.onlab.util.ItemNotFoundException)

Aggregations

ItemNotFoundException (org.onlab.util.ItemNotFoundException)1 TributarySlotQuery (org.onosproject.net.behaviour.TributarySlotQuery)1 DriverHandler (org.onosproject.net.driver.DriverHandler)1