Charles Chan | 7f987c5 | 2018-07-31 18:22:46 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 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 | |
| 17 | package org.onosproject.l2lb.api; |
| 18 | |
| 19 | import org.onosproject.event.ListenerService; |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | |
| 22 | import java.util.Map; |
| 23 | |
| 24 | /** |
| 25 | * L2 load balance service. |
| 26 | */ |
| 27 | public interface L2LbService extends ListenerService<L2LbEvent, L2LbListener> { |
| 28 | /** |
| 29 | * Gets all L2 load balancers from the store. |
| 30 | * |
| 31 | * @return L2 load balancer ID and L2 load balancer information mapping |
| 32 | */ |
| 33 | Map<L2LbId, L2Lb> getL2Lbs(); |
| 34 | |
| 35 | /** |
| 36 | * Gets L2 load balancer that matches given device ID and key, or null if not found. |
| 37 | * |
| 38 | * @param deviceId Device ID |
| 39 | * @param key L2 load balancer key |
| 40 | * @return L2 load balancer information |
| 41 | */ |
| 42 | L2Lb getL2Lb(DeviceId deviceId, int key); |
| 43 | |
| 44 | /** |
| 45 | * Gets L2 load balancer next ids from the store. |
| 46 | * |
| 47 | * @return L2 load balancer id and next id mapping |
| 48 | */ |
| 49 | Map<L2LbId, Integer> getL2LbNexts(); |
| 50 | |
| 51 | /** |
| 52 | * Gets L2 load balancer next id that matches given device Id and key, or null if not found. |
| 53 | * |
| 54 | * @param deviceId Device ID |
| 55 | * @param key L2 load balancer key |
| 56 | * @return next ID |
| 57 | */ |
| 58 | int getL2LbNexts(DeviceId deviceId, int key); |
| 59 | } |