Kyuhwi Choi | c5b33ea | 2016-04-26 11:45:32 +0900 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Kyuhwi Choi | c5b33ea | 2016-04-26 11:45:32 +0900 | [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 | */ |
Hyunsun Moon | 7170129 | 2016-05-09 12:00:54 -0700 | [diff] [blame] | 16 | package org.onosproject.scalablegateway.api; |
Kyuhwi Choi | c5b33ea | 2016-04-26 11:45:32 +0900 | [diff] [blame] | 17 | |
| 18 | import org.onosproject.core.GroupId; |
| 19 | import org.onosproject.net.DeviceId; |
| 20 | import org.onosproject.net.PortNumber; |
| 21 | |
| 22 | import java.util.List; |
| 23 | |
| 24 | /** |
| 25 | * ScalableGateWay Service Interface. |
| 26 | */ |
| 27 | public interface ScalableGatewayService { |
| 28 | |
| 29 | /** |
| 30 | * Returns gateway node with the given device identifier. |
| 31 | * |
| 32 | * @param deviceId The gateway node deviceId |
| 33 | * @return The gateway node information |
| 34 | */ |
| 35 | GatewayNode getGatewayNode(DeviceId deviceId); |
| 36 | |
| 37 | /** |
Hyunsun Moon | f9a16ed | 2016-07-20 21:59:48 -0700 | [diff] [blame] | 38 | * Returns the uplink port number of the gateway with the supplied device ID. |
Kyuhwi Choi | c5b33ea | 2016-04-26 11:45:32 +0900 | [diff] [blame] | 39 | * |
Hyunsun Moon | f9a16ed | 2016-07-20 21:59:48 -0700 | [diff] [blame] | 40 | * @param deviceId the gateway node device id |
| 41 | * @return the external interface port number |
Kyuhwi Choi | c5b33ea | 2016-04-26 11:45:32 +0900 | [diff] [blame] | 42 | */ |
Hyunsun Moon | f9a16ed | 2016-07-20 21:59:48 -0700 | [diff] [blame] | 43 | PortNumber getUplinkPort(DeviceId deviceId); |
Kyuhwi Choi | c5b33ea | 2016-04-26 11:45:32 +0900 | [diff] [blame] | 44 | |
| 45 | /** |
| 46 | * Returns group id for gateway load balance. |
Hyunsun Moon | f9a16ed | 2016-07-20 21:59:48 -0700 | [diff] [blame] | 47 | * If the group does not exist in the supplied source device, creates one. |
Kyuhwi Choi | c5b33ea | 2016-04-26 11:45:32 +0900 | [diff] [blame] | 48 | * |
Hyunsun Moon | 7170129 | 2016-05-09 12:00:54 -0700 | [diff] [blame] | 49 | * @param srcDeviceId source device id |
Kyuhwi Choi | c5b33ea | 2016-04-26 11:45:32 +0900 | [diff] [blame] | 50 | * @return The group id |
| 51 | */ |
Hyunsun Moon | f9a16ed | 2016-07-20 21:59:48 -0700 | [diff] [blame] | 52 | GroupId getGatewayGroupId(DeviceId srcDeviceId); |
Kyuhwi Choi | c5b33ea | 2016-04-26 11:45:32 +0900 | [diff] [blame] | 53 | |
| 54 | /** |
| 55 | * Returns the list of gateway node information with the given device identifier. |
| 56 | * |
| 57 | * @return The list of gateway node information |
| 58 | */ |
| 59 | List<GatewayNode> getGatewayNodes(); |
| 60 | |
| 61 | /** |
| 62 | * Returns the list of gateway`s device identifiers. |
| 63 | * |
| 64 | * @return The list of device identifier] |
| 65 | */ |
| 66 | List<DeviceId> getGatewayDeviceIds(); |
| 67 | |
| 68 | /** |
| 69 | * Adds gateway node in scalableGW application. |
| 70 | * |
| 71 | * @param gatewayNode Target gateway node |
| 72 | * @return Result of method call |
| 73 | */ |
| 74 | boolean addGatewayNode(GatewayNode gatewayNode); |
| 75 | |
| 76 | /** |
| 77 | * Removes gateway node in scalableGW application. |
| 78 | * |
| 79 | * @param gatewayNode Target gateway node |
| 80 | * @return Result of method call |
| 81 | */ |
| 82 | boolean deleteGatewayNode(GatewayNode gatewayNode); |
| 83 | } |