samuel

[ONOS-2159]Add to query devices by type api in DeviceService and

DeviceStore interfaces

Change-Id: Ifa7e94e08eb150fb4d71248a50a390832d1549df
......@@ -44,6 +44,15 @@ public interface DeviceService {
Iterable<Device> getDevices();
/**
* Returns a collection of the currently known infrastructure
* devices by device type.
*
* @param type device type
* @return collection of devices
*/
Iterable<Device> getDevices(Device.Type type);
/**
* Returns an iterable collection of all devices
* currently available to the system.
*
......@@ -52,6 +61,14 @@ public interface DeviceService {
Iterable<Device> getAvailableDevices();
/**
* Returns an iterable collection of all devices currently available to the system by device type.
*
* @param type device type
* @return device collection
*/
Iterable<Device> getAvailableDevices(Device.Type type);
/**
* Returns the device with the specified identifier.
*
* @param deviceId device identifier
......
......@@ -19,6 +19,7 @@ import com.google.common.base.Predicate;
import com.google.common.collect.FluentIterable;
import org.onosproject.net.Device;
import org.onosproject.net.Device.Type;
import org.onosproject.net.DeviceId;
import org.onosproject.net.MastershipRole;
import org.onosproject.net.Port;
......@@ -91,4 +92,14 @@ public class DeviceServiceAdapter implements DeviceService {
public void removeListener(DeviceListener listener) {
}
@Override
public Iterable<Device> getDevices(Type type) {
return Collections.emptyList();
}
@Override
public Iterable<Device> getAvailableDevices(Type type) {
return Collections.emptyList();
}
}
......