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 | e33cc1a | 2014-08-25 21:59:41 -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 |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 21 | * @return mastership role chosen by the provider service |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 22 | */ |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 23 | MastershipRole deviceConnected(DeviceId deviceId, DeviceDescription deviceDescription); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Signals the core that a device has disconnected or is no longer reachable. |
| 27 | * |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 28 | * @param deviceId identity of the device to be removed |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 29 | */ |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 30 | void deviceDisconnected(DeviceId deviceId); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Sends information about all ports of a device. It is up to the core to |
| 34 | * determine what has changed. |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 35 | * <p/> |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 36 | * |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 37 | * @param deviceId identity of the device |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 38 | * @param ports list of device ports |
| 39 | */ |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 40 | void updatePorts(DeviceId deviceId, List<PortDescription> ports); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 41 | |
| 42 | /** |
| 43 | * Used to notify the core about port status change of a single port. |
| 44 | * |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 45 | * @param deviceId identity of the device |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 46 | * @param port description of the port that changed |
| 47 | */ |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 48 | void portStatusChanged(DeviceId deviceId, PortDescription port); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 49 | |
| 50 | } |