blob: ec73ce518074a43156d0af25deefa3eaf2286bd9 [file] [log] [blame]
tom0eb04ca2014-08-25 14:34:51 -07001package org.onlab.onos.net.device;
2
tome33cc1a2014-08-25 21:59:41 -07003import org.onlab.onos.net.Device;
4import org.onlab.onos.net.MastershipRole;
tomc1a38d32014-08-25 23:01:32 -07005import org.onlab.onos.net.provider.Provider;
tom0eb04ca2014-08-25 14:34:51 -07006
7/**
8 * Abstraction of a device information provider.
9 */
10public interface DeviceProvider extends Provider {
tome33cc1a2014-08-25 21:59:41 -070011
12 // TODO: consider how dirty the triggerProbe gets; if it costs too much, let's drop it
13
14 /**
15 * Triggers an asynchronous probe of the specified device, intended to
Ayaka Koshibee8708e32014-10-22 13:40:18 -070016 * determine whether the device is present or not. An indirect result of this
tome33cc1a2014-08-25 21:59:41 -070017 * should be invocation of
tome06f8552014-08-26 16:58:42 -070018 * {@link org.onlab.onos.net.device.DeviceProviderService#deviceConnected} )} or
19 * {@link org.onlab.onos.net.device.DeviceProviderService#deviceDisconnected}
tome33cc1a2014-08-25 21:59:41 -070020 * at some later point in time.
21 *
22 * @param device device to be probed
23 */
24 void triggerProbe(Device device);
25
26 /**
27 * Notifies the provider of a mastership role change for the specified
28 * device as decided by the core.
29 *
30 * @param device affected device
31 * @param newRole newly determined mastership role
32 */
33 void roleChanged(Device device, MastershipRole newRole);
34
tom0eb04ca2014-08-25 14:34:51 -070035}