tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame^] | 1 | package org.onlab.onos.net.device; |
| 2 | |
| 3 | import org.onlab.onos.net.Device; |
| 4 | import org.onlab.onos.net.DeviceId; |
| 5 | import org.onlab.onos.net.MastershipRole; |
| 6 | |
| 7 | /** |
| 8 | * Service for interacting with the inventory of infrastructure devices. |
| 9 | */ |
| 10 | public interface DeviceService { |
| 11 | |
| 12 | /** |
| 13 | * Returns the current mastership role for the specified device. |
| 14 | * |
| 15 | * @param deviceId device identifier |
| 16 | * @return designated mastership role |
| 17 | */ |
| 18 | MastershipRole getRole(DeviceId deviceId); |
| 19 | |
| 20 | /** |
| 21 | * Returns an iterable collection of the currently known infrastructure |
| 22 | * devices. |
| 23 | * |
| 24 | * @return collection of devices |
| 25 | */ |
| 26 | Iterable<Device> getDevices(); |
| 27 | |
| 28 | /** |
| 29 | * Returns the device with the specified identifier. |
| 30 | * |
| 31 | * @param deviceId device identifier |
| 32 | * @return device or null if one with the given identifier is not known |
| 33 | */ |
| 34 | Device getDevice(DeviceId deviceId); |
| 35 | |
| 36 | |
| 37 | // List<Port> getPorts(DeviceId deviceId); |
| 38 | |
| 39 | /** |
| 40 | * Adds the specified device listener. |
| 41 | * |
| 42 | * @param listener device listener |
| 43 | */ |
| 44 | void addListener(DeviceListener listener); |
| 45 | |
| 46 | /** |
| 47 | * Removes the specified device listener. |
| 48 | * |
| 49 | * @param listener device listener |
| 50 | */ |
| 51 | void removeListener(DeviceListener listener); |
| 52 | } |