tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.device; |
| 2 | |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 3 | import org.onlab.onos.net.DeviceId; |
tom | 3f2bbd7 | 2014-09-24 12:07:58 -0700 | [diff] [blame] | 4 | import org.onlab.onos.net.MastershipRole; |
tom | c1a38d3 | 2014-08-25 23:01:32 -0700 | [diff] [blame] | 5 | import org.onlab.onos.net.provider.ProviderService; |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 6 | |
| 7 | import java.util.List; |
| 8 | |
| 9 | /** |
| 10 | * Service through which device providers can inject device information into |
| 11 | * the core. |
| 12 | */ |
tom | d735672 | 2014-08-26 01:07:39 -0700 | [diff] [blame] | 13 | public interface DeviceProviderService extends ProviderService<DeviceProvider> { |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 14 | |
| 15 | // TODO: define suspend and remove actions on the mezzanine administrative API |
| 16 | |
| 17 | /** |
| 18 | * Signals the core that a device has connected or has been detected somehow. |
| 19 | * |
| 20 | * @param deviceDescription information about network device |
| 21 | */ |
tom | d1c0649 | 2014-09-03 11:07:58 -0700 | [diff] [blame] | 22 | void deviceConnected(DeviceId deviceId, DeviceDescription deviceDescription); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * Signals the core that a device has disconnected or is no longer reachable. |
| 26 | * |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 27 | * @param deviceId identity of the device to be removed |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 28 | */ |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 29 | void deviceDisconnected(DeviceId deviceId); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * Sends information about all ports of a device. It is up to the core to |
| 33 | * determine what has changed. |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 34 | * <p/> |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 35 | * |
tom | 32f6684 | 2014-08-27 19:27:47 -0700 | [diff] [blame] | 36 | * @param deviceId identity of the device |
| 37 | * @param portDescriptions list of device ports |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 38 | */ |
tom | 32f6684 | 2014-08-27 19:27:47 -0700 | [diff] [blame] | 39 | void updatePorts(DeviceId deviceId, List<PortDescription> portDescriptions); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 40 | |
| 41 | /** |
| 42 | * Used to notify the core about port status change of a single port. |
| 43 | * |
tom | 32f6684 | 2014-08-27 19:27:47 -0700 | [diff] [blame] | 44 | * @param deviceId identity of the device |
| 45 | * @param portDescription description of the port that changed |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 46 | */ |
tom | 32f6684 | 2014-08-27 19:27:47 -0700 | [diff] [blame] | 47 | void portStatusChanged(DeviceId deviceId, PortDescription portDescription); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 48 | |
tom | 3f2bbd7 | 2014-09-24 12:07:58 -0700 | [diff] [blame] | 49 | /** |
| 50 | * Notifies the core about the providers inability to assert the specified |
| 51 | * mastership role on the device. |
| 52 | * |
| 53 | * @param deviceId identity of the device |
Ayaka Koshibe | ee1c467 | 2014-09-25 12:31:52 -0700 | [diff] [blame] | 54 | * @param role mastership role that was asserted but failed |
tom | 3f2bbd7 | 2014-09-24 12:07:58 -0700 | [diff] [blame] | 55 | */ |
| 56 | void unableToAssertRole(DeviceId deviceId, MastershipRole role); |
| 57 | |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 58 | } |