blob: 57d9ebfe01535d981a047b9ac621dc81f03725b6 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
tom0eb04ca2014-08-25 14:34:51 -070016package org.onlab.onos.net.device;
17
tomd3097b02014-08-26 10:40:29 -070018import org.onlab.onos.net.DeviceId;
tom3f2bbd72014-09-24 12:07:58 -070019import org.onlab.onos.net.MastershipRole;
tomc1a38d32014-08-25 23:01:32 -070020import org.onlab.onos.net.provider.ProviderService;
tom0eb04ca2014-08-25 14:34:51 -070021
22import java.util.List;
23
24/**
25 * Service through which device providers can inject device information into
26 * the core.
27 */
tomd7356722014-08-26 01:07:39 -070028public interface DeviceProviderService extends ProviderService<DeviceProvider> {
tom0eb04ca2014-08-25 14:34:51 -070029
30 // TODO: define suspend and remove actions on the mezzanine administrative API
31
32 /**
33 * Signals the core that a device has connected or has been detected somehow.
34 *
35 * @param deviceDescription information about network device
36 */
tomd1c06492014-09-03 11:07:58 -070037 void deviceConnected(DeviceId deviceId, DeviceDescription deviceDescription);
tom0eb04ca2014-08-25 14:34:51 -070038
39 /**
40 * Signals the core that a device has disconnected or is no longer reachable.
41 *
tomd3097b02014-08-26 10:40:29 -070042 * @param deviceId identity of the device to be removed
tom0eb04ca2014-08-25 14:34:51 -070043 */
tomd3097b02014-08-26 10:40:29 -070044 void deviceDisconnected(DeviceId deviceId);
tom0eb04ca2014-08-25 14:34:51 -070045
46 /**
47 * Sends information about all ports of a device. It is up to the core to
48 * determine what has changed.
tomd3097b02014-08-26 10:40:29 -070049 * <p/>
tom0eb04ca2014-08-25 14:34:51 -070050 *
tom32f66842014-08-27 19:27:47 -070051 * @param deviceId identity of the device
52 * @param portDescriptions list of device ports
tom0eb04ca2014-08-25 14:34:51 -070053 */
tom32f66842014-08-27 19:27:47 -070054 void updatePorts(DeviceId deviceId, List<PortDescription> portDescriptions);
tom0eb04ca2014-08-25 14:34:51 -070055
56 /**
57 * Used to notify the core about port status change of a single port.
58 *
tom32f66842014-08-27 19:27:47 -070059 * @param deviceId identity of the device
60 * @param portDescription description of the port that changed
tom0eb04ca2014-08-25 14:34:51 -070061 */
tom32f66842014-08-27 19:27:47 -070062 void portStatusChanged(DeviceId deviceId, PortDescription portDescription);
tom0eb04ca2014-08-25 14:34:51 -070063
tom3f2bbd72014-09-24 12:07:58 -070064 /**
65 * Notifies the core about the providers inability to assert the specified
66 * mastership role on the device.
67 *
68 * @param deviceId identity of the device
Ayaka Koshibeee1c4672014-09-25 12:31:52 -070069 * @param role mastership role that was asserted but failed
tom3f2bbd72014-09-24 12:07:58 -070070 */
71 void unableToAssertRole(DeviceId deviceId, MastershipRole role);
72
tom0eb04ca2014-08-25 14:34:51 -070073}