Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -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 | */ |
| 16 | package org.onosproject.ofagent.api; |
| 17 | |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 18 | import org.onosproject.incubator.net.virtual.NetworkId; |
Claudine Chiu | 5c184e1 | 2017-08-08 21:21:38 -0400 | [diff] [blame] | 19 | import org.onosproject.net.ConnectPoint; |
Claudine Chiu | 785ef2d | 2017-07-04 13:13:28 -0400 | [diff] [blame] | 20 | import org.onosproject.net.DeviceId; |
| 21 | import org.onosproject.net.Port; |
Claudine Chiu | 5c184e1 | 2017-08-08 21:21:38 -0400 | [diff] [blame] | 22 | import org.onosproject.net.PortNumber; |
Claudine Chiu | 2729ffd | 2017-07-31 21:38:27 -0400 | [diff] [blame] | 23 | import org.onosproject.net.device.PortStatistics; |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 24 | |
Claudine Chiu | 2729ffd | 2017-07-31 21:38:27 -0400 | [diff] [blame] | 25 | import java.util.List; |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 26 | import java.util.Set; |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 27 | |
| 28 | /** |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 29 | * Service for providing virtual OpenFlow switch information. |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 30 | */ |
| 31 | public interface OFSwitchService { |
| 32 | |
| 33 | /** |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 34 | * Returns all openflow switches that OF agent service manages. |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 35 | * |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 36 | * @return set of openflow switches; empty set if no openflow switches exist |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 37 | */ |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 38 | Set<OFSwitch> ofSwitches(); |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 39 | |
| 40 | /** |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 41 | * Returns all openflow switches for the specified network. |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 42 | * |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 43 | * @param networkId network id |
| 44 | * @return set of openflow switches; empty set if no devices exist on the network |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 45 | */ |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 46 | Set<OFSwitch> ofSwitches(NetworkId networkId); |
Claudine Chiu | 785ef2d | 2017-07-04 13:13:28 -0400 | [diff] [blame] | 47 | |
| 48 | /** |
Claudine Chiu | 2729ffd | 2017-07-31 21:38:27 -0400 | [diff] [blame] | 49 | * Returns openflow switch for the specified device in the specified network. |
| 50 | * |
| 51 | * @param networkId network id |
| 52 | * @param deviceId device id |
| 53 | * @return openflow switch; null if none exists |
| 54 | */ |
| 55 | OFSwitch ofSwitch(NetworkId networkId, DeviceId deviceId); |
| 56 | |
| 57 | /** |
Claudine Chiu | 785ef2d | 2017-07-04 13:13:28 -0400 | [diff] [blame] | 58 | * Returns all ports of the specified device in the specified network. |
| 59 | * |
| 60 | * @param networkId network id |
| 61 | * @param deviceId device id |
| 62 | * @return set of ports; empty set if no ports exist for the specified device |
| 63 | */ |
| 64 | Set<Port> ports(NetworkId networkId, DeviceId deviceId); |
Claudine Chiu | 2729ffd | 2017-07-31 21:38:27 -0400 | [diff] [blame] | 65 | |
| 66 | /** |
| 67 | * Returns all port statistics of the specified device in the specified network. |
| 68 | * |
| 69 | * @param networkId network id |
| 70 | * @param deviceId device id |
| 71 | * @return list of port statistics; empty list if none exists for the specified device |
| 72 | */ |
| 73 | List<PortStatistics> getPortStatistics(NetworkId networkId, DeviceId deviceId); |
| 74 | |
Claudine Chiu | 5c184e1 | 2017-08-08 21:21:38 -0400 | [diff] [blame] | 75 | /** |
| 76 | * Returns neighbour port of the specified port in the specified network. |
| 77 | * |
| 78 | * @param networkId network id |
| 79 | * @param deviceId device id |
| 80 | * @param portNumber port number |
| 81 | * @return connect point; null if none exists |
| 82 | */ |
| 83 | ConnectPoint neighbour(NetworkId networkId, DeviceId deviceId, PortNumber portNumber); |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 84 | } |