blob: 9d8eb6a4037fb32d4493c053c0298660ff8bb80e [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;
tome33cc1a2014-08-25 21:59:41 -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
tome33cc1a2014-08-25 21:59:41 -070021 * @return mastership role chosen by the provider service
tom0eb04ca2014-08-25 14:34:51 -070022 */
tomd3097b02014-08-26 10:40:29 -070023 MastershipRole deviceConnected(DeviceId deviceId, DeviceDescription deviceDescription);
tom0eb04ca2014-08-25 14:34:51 -070024
25 /**
26 * Signals the core that a device has disconnected or is no longer reachable.
27 *
tomd3097b02014-08-26 10:40:29 -070028 * @param deviceId identity of the device to be removed
tom0eb04ca2014-08-25 14:34:51 -070029 */
tomd3097b02014-08-26 10:40:29 -070030 void deviceDisconnected(DeviceId deviceId);
tom0eb04ca2014-08-25 14:34:51 -070031
32 /**
33 * Sends information about all ports of a device. It is up to the core to
34 * determine what has changed.
tomd3097b02014-08-26 10:40:29 -070035 * <p/>
tom0eb04ca2014-08-25 14:34:51 -070036 *
tomd3097b02014-08-26 10:40:29 -070037 * @param deviceId identity of the device
tom0eb04ca2014-08-25 14:34:51 -070038 * @param ports list of device ports
39 */
tomd3097b02014-08-26 10:40:29 -070040 void updatePorts(DeviceId deviceId, List<PortDescription> ports);
tom0eb04ca2014-08-25 14:34:51 -070041
42 /**
43 * Used to notify the core about port status change of a single port.
44 *
tomd3097b02014-08-26 10:40:29 -070045 * @param deviceId identity of the device
tom0eb04ca2014-08-25 14:34:51 -070046 * @param port description of the port that changed
47 */
tomd3097b02014-08-26 10:40:29 -070048 void portStatusChanged(DeviceId deviceId, PortDescription port);
tom0eb04ca2014-08-25 14:34:51 -070049
50}