blob: 9a51a162e2ad1ed98d72a2487571263ff7223699 [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;
tomc1a38d32014-08-25 23:01:32 -07004import org.onlab.onos.net.provider.Provider;
tom0eb04ca2014-08-25 14:34:51 -07005
6/**
7 * Abstraction of a device information provider.
8 */
9public interface DeviceProvider extends Provider {
tome33cc1a2014-08-25 21:59:41 -070010
11 // TODO: consider how dirty the triggerProbe gets; if it costs too much, let's drop it
12
13 /**
14 * Triggers an asynchronous probe of the specified device, intended to
15 * determine whether the host is present or not. An indirect result of this
16 * should be invocation of
tome06f8552014-08-26 16:58:42 -070017 * {@link org.onlab.onos.net.device.DeviceProviderService#deviceConnected} )} or
18 * {@link org.onlab.onos.net.device.DeviceProviderService#deviceDisconnected}
tome33cc1a2014-08-25 21:59:41 -070019 * at some later point in time.
20 *
21 * @param device device to be probed
22 */
23 void triggerProbe(Device device);
24
25 /**
26 * Notifies the provider of a mastership role change for the specified
27 * device as decided by the core.
28 *
29 * @param device affected device
30 * @param newRole newly determined mastership role
31 */
Madan Jampani195af6e2014-10-09 15:01:17 -070032 void roleChanged(Device device, DeviceMastershipRole newRole);
tome33cc1a2014-08-25 21:59:41 -070033
tom0eb04ca2014-08-25 14:34:51 -070034}