Shashikanth VH | aa5116f | 2015-10-29 19:15:32 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Shashikanth VH | aa5116f | 2015-10-29 19:15:32 +0530 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
| 5 | * the License. You may obtain a copy of the License at |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
| 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| 11 | * specific language governing permissions and limitations under the License. |
| 12 | */ |
| 13 | package org.onosproject.bgp.controller; |
| 14 | |
| 15 | /** |
| 16 | * Responsible for keeping track of the current set BGPLS peers connected to the system. |
| 17 | * |
| 18 | */ |
| 19 | public interface BgpPeerManager { |
| 20 | |
| 21 | /** |
| 22 | * Add connected peer. |
| 23 | * |
| 24 | * @param bgpId BGP ID to add |
| 25 | * @param bgpPeer BGp peer instance |
| 26 | * |
| 27 | * @return false if peer already exist, otherwise true |
| 28 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 29 | public boolean addConnectedPeer(BgpId bgpId, BgpPeer bgpPeer); |
Shashikanth VH | aa5116f | 2015-10-29 19:15:32 +0530 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * Validate wheather peer is connected. |
| 33 | * |
| 34 | * @param bgpId BGP ID to validate |
| 35 | * |
| 36 | * @return true if peer exist, otherwise false |
| 37 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 38 | public boolean isPeerConnected(BgpId bgpId); |
Shashikanth VH | aa5116f | 2015-10-29 19:15:32 +0530 | [diff] [blame] | 39 | |
| 40 | /** |
| 41 | * Remove connected peer. |
| 42 | * |
| 43 | * @param bgpId BGP ID |
| 44 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 45 | public void removeConnectedPeer(BgpId bgpId); |
Shashikanth VH | aa5116f | 2015-10-29 19:15:32 +0530 | [diff] [blame] | 46 | |
| 47 | /** |
| 48 | * Gets connected peer. |
| 49 | * |
| 50 | * @param bgpId BGP ID |
| 51 | * @return BGPPeer the connected peer, otherwise null |
| 52 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 53 | public BgpPeer getPeer(BgpId bgpId); |
Shashikanth VH | aa5116f | 2015-10-29 19:15:32 +0530 | [diff] [blame] | 54 | } |