Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 16 | package org.onlab.onos.net.device; |
| 17 | |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 18 | import org.onlab.onos.net.DeviceId; |
tom | 3f2bbd7 | 2014-09-24 12:07:58 -0700 | [diff] [blame] | 19 | import org.onlab.onos.net.MastershipRole; |
tom | c1a38d3 | 2014-08-25 23:01:32 -0700 | [diff] [blame] | 20 | import org.onlab.onos.net.provider.ProviderService; |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 21 | |
| 22 | import java.util.List; |
| 23 | |
| 24 | /** |
| 25 | * Service through which device providers can inject device information into |
| 26 | * the core. |
| 27 | */ |
tom | d735672 | 2014-08-26 01:07:39 -0700 | [diff] [blame] | 28 | public interface DeviceProviderService extends ProviderService<DeviceProvider> { |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 29 | |
| 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 | */ |
tom | d1c0649 | 2014-09-03 11:07:58 -0700 | [diff] [blame] | 37 | void deviceConnected(DeviceId deviceId, DeviceDescription deviceDescription); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 38 | |
| 39 | /** |
| 40 | * Signals the core that a device has disconnected or is no longer reachable. |
| 41 | * |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 42 | * @param deviceId identity of the device to be removed |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 43 | */ |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 44 | void deviceDisconnected(DeviceId deviceId); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 45 | |
| 46 | /** |
| 47 | * Sends information about all ports of a device. It is up to the core to |
| 48 | * determine what has changed. |
| 49 | * |
tom | 32f6684 | 2014-08-27 19:27:47 -0700 | [diff] [blame] | 50 | * @param deviceId identity of the device |
| 51 | * @param portDescriptions list of device ports |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 52 | */ |
tom | 32f6684 | 2014-08-27 19:27:47 -0700 | [diff] [blame] | 53 | void updatePorts(DeviceId deviceId, List<PortDescription> portDescriptions); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 54 | |
| 55 | /** |
| 56 | * Used to notify the core about port status change of a single port. |
| 57 | * |
tom | 32f6684 | 2014-08-27 19:27:47 -0700 | [diff] [blame] | 58 | * @param deviceId identity of the device |
| 59 | * @param portDescription description of the port that changed |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 60 | */ |
tom | 32f6684 | 2014-08-27 19:27:47 -0700 | [diff] [blame] | 61 | void portStatusChanged(DeviceId deviceId, PortDescription portDescription); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 62 | |
tom | 3f2bbd7 | 2014-09-24 12:07:58 -0700 | [diff] [blame] | 63 | /** |
| 64 | * Notifies the core about the providers inability to assert the specified |
| 65 | * mastership role on the device. |
| 66 | * |
| 67 | * @param deviceId identity of the device |
Ayaka Koshibe | ee1c467 | 2014-09-25 12:31:52 -0700 | [diff] [blame] | 68 | * @param role mastership role that was asserted but failed |
tom | 3f2bbd7 | 2014-09-24 12:07:58 -0700 | [diff] [blame] | 69 | */ |
| 70 | void unableToAssertRole(DeviceId deviceId, MastershipRole role); |
| 71 | |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 72 | } |