Search in sources :

Example 1 with MplsQuery

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

the class ResourceDeviceListener method queryMplsLabels.

private Set<MplsLabel> queryMplsLabels(DeviceId device, PortNumber port) {
    try {
        DriverHandler handler = driverService.createHandler(device);
        if (handler == null || !handler.hasBehaviour(MplsQuery.class)) {
            return ImmutableSet.of();
        }
        MplsQuery query = handler.behaviour(MplsQuery.class);
        if (query == null) {
            return ImmutableSet.of();
        }
        return query.queryMplsLabels(port);
    } catch (ItemNotFoundException e) {
        return ImmutableSet.of();
    }
}
Also used : DriverHandler(org.onosproject.net.driver.DriverHandler) MplsQuery(org.onosproject.net.behaviour.MplsQuery) ItemNotFoundException(org.onlab.util.ItemNotFoundException)

Aggregations

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