blob: d043eca09a8790de05758c65c4e24672409243ef [file] [log] [blame]
tom0eb04ca2014-08-25 14:34:51 -07001package org.onlab.onos.net.device;
2
tomd3097b02014-08-26 10:40:29 -07003import org.onlab.onos.net.DeviceId;
tom3f2bbd72014-09-24 12:07:58 -07004import org.onlab.onos.net.MastershipRole;
tomc1a38d32014-08-25 23:01:32 -07005import org.onlab.onos.net.provider.ProviderService;
tom0eb04ca2014-08-25 14:34:51 -07006
7import java.util.List;
8
9/**
10 * Service through which device providers can inject device information into
11 * the core.
12 */
tomd7356722014-08-26 01:07:39 -070013public interface DeviceProviderService extends ProviderService<DeviceProvider> {
tom0eb04ca2014-08-25 14:34:51 -070014
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 */
tomd1c06492014-09-03 11:07:58 -070022 void deviceConnected(DeviceId deviceId, DeviceDescription deviceDescription);
tom0eb04ca2014-08-25 14:34:51 -070023
24 /**
25 * Signals the core that a device has disconnected or is no longer reachable.
26 *
tomd3097b02014-08-26 10:40:29 -070027 * @param deviceId identity of the device to be removed
tom0eb04ca2014-08-25 14:34:51 -070028 */
tomd3097b02014-08-26 10:40:29 -070029 void deviceDisconnected(DeviceId deviceId);
tom0eb04ca2014-08-25 14:34:51 -070030
31 /**
32 * Sends information about all ports of a device. It is up to the core to
33 * determine what has changed.
tomd3097b02014-08-26 10:40:29 -070034 * <p/>
tom0eb04ca2014-08-25 14:34:51 -070035 *
tom32f66842014-08-27 19:27:47 -070036 * @param deviceId identity of the device
37 * @param portDescriptions list of device ports
tom0eb04ca2014-08-25 14:34:51 -070038 */
tom32f66842014-08-27 19:27:47 -070039 void updatePorts(DeviceId deviceId, List<PortDescription> portDescriptions);
tom0eb04ca2014-08-25 14:34:51 -070040
41 /**
42 * Used to notify the core about port status change of a single port.
43 *
tom32f66842014-08-27 19:27:47 -070044 * @param deviceId identity of the device
45 * @param portDescription description of the port that changed
tom0eb04ca2014-08-25 14:34:51 -070046 */
tom32f66842014-08-27 19:27:47 -070047 void portStatusChanged(DeviceId deviceId, PortDescription portDescription);
tom0eb04ca2014-08-25 14:34:51 -070048
tom3f2bbd72014-09-24 12:07:58 -070049 /**
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 Koshibeee1c4672014-09-25 12:31:52 -070054 * @param role mastership role that was asserted but failed
tom3f2bbd72014-09-24 12:07:58 -070055 */
56 void unableToAssertRole(DeviceId deviceId, MastershipRole role);
57
tom0eb04ca2014-08-25 14:34:51 -070058}