Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
Ray Milkey | 34c9590 | 2015-04-15 09:47:53 -0700 | [diff] [blame] | 2 | * Copyright 2014-2015 Open Networking Laboratory |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.device; |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 18 | import org.onosproject.net.DeviceId; |
| 19 | import org.onosproject.net.MastershipRole; |
| 20 | import org.onosproject.net.provider.ProviderService; |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 21 | |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 22 | import java.util.Collection; |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 23 | import java.util.List; |
| 24 | |
| 25 | /** |
| 26 | * Service through which device providers can inject device information into |
| 27 | * the core. |
| 28 | */ |
tom | d735672 | 2014-08-26 01:07:39 -0700 | [diff] [blame] | 29 | public interface DeviceProviderService extends ProviderService<DeviceProvider> { |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 30 | |
| 31 | // TODO: define suspend and remove actions on the mezzanine administrative API |
| 32 | |
| 33 | /** |
| 34 | * Signals the core that a device has connected or has been detected somehow. |
| 35 | * |
Yuta HIGUCHI | 5c94727 | 2014-11-03 21:39:21 -0800 | [diff] [blame] | 36 | * @param deviceId device identifier |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 37 | * @param deviceDescription information about network device |
| 38 | */ |
tom | d1c0649 | 2014-09-03 11:07:58 -0700 | [diff] [blame] | 39 | void deviceConnected(DeviceId deviceId, DeviceDescription deviceDescription); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 40 | |
| 41 | /** |
| 42 | * Signals the core that a device has disconnected or is no longer reachable. |
| 43 | * |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 44 | * @param deviceId identity of the device to be removed |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 45 | */ |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 46 | void deviceDisconnected(DeviceId deviceId); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 47 | |
| 48 | /** |
| 49 | * Sends information about all ports of a device. It is up to the core to |
| 50 | * determine what has changed. |
| 51 | * |
tom | 32f6684 | 2014-08-27 19:27:47 -0700 | [diff] [blame] | 52 | * @param deviceId identity of the device |
| 53 | * @param portDescriptions list of device ports |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 54 | */ |
tom | 32f6684 | 2014-08-27 19:27:47 -0700 | [diff] [blame] | 55 | void updatePorts(DeviceId deviceId, List<PortDescription> portDescriptions); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 56 | |
| 57 | /** |
| 58 | * Used to notify the core about port status change of a single port. |
| 59 | * |
tom | 32f6684 | 2014-08-27 19:27:47 -0700 | [diff] [blame] | 60 | * @param deviceId identity of the device |
| 61 | * @param portDescription description of the port that changed |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 62 | */ |
tom | 32f6684 | 2014-08-27 19:27:47 -0700 | [diff] [blame] | 63 | void portStatusChanged(DeviceId deviceId, PortDescription portDescription); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 64 | |
tom | 3f2bbd7 | 2014-09-24 12:07:58 -0700 | [diff] [blame] | 65 | /** |
Ayaka Koshibe | 3ef2b0d | 2014-10-31 13:58:27 -0700 | [diff] [blame] | 66 | * Notifies the core about the result of a RoleRequest sent to a device. |
tom | 3f2bbd7 | 2014-09-24 12:07:58 -0700 | [diff] [blame] | 67 | * |
| 68 | * @param deviceId identity of the device |
Ayaka Koshibe | 3ef2b0d | 2014-10-31 13:58:27 -0700 | [diff] [blame] | 69 | * @param requested mastership role that was requested by the node |
Yuta HIGUCHI | 5c94727 | 2014-11-03 21:39:21 -0800 | [diff] [blame] | 70 | * @param response mastership role the switch accepted |
tom | 3f2bbd7 | 2014-09-24 12:07:58 -0700 | [diff] [blame] | 71 | */ |
Ayaka Koshibe | 3ef2b0d | 2014-10-31 13:58:27 -0700 | [diff] [blame] | 72 | void receivedRoleReply(DeviceId deviceId, MastershipRole requested, MastershipRole response); |
tom | 3f2bbd7 | 2014-09-24 12:07:58 -0700 | [diff] [blame] | 73 | |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 74 | /** |
| 75 | * Sends statistics about all ports of a device. |
| 76 | * |
| 77 | * @param deviceId identity of the device |
| 78 | * @param portStatistics list of device port statistics |
| 79 | */ |
| 80 | void updatePortStatistics(DeviceId deviceId, Collection<PortStatistics> portStatistics); |
| 81 | |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 82 | } |