blob: 895cc145d37ef86505fe25fd4c31f1cf04f4cb88 [file] [log] [blame]
Shashikanth VHaa5116f2015-10-29 19:15:32 +05301/*
2 * Copyright 2015 Open Networking Laboratory
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 */
13package org.onosproject.bgp.controller;
14
15/**
16 * Responsible for keeping track of the current set BGPLS peers connected to the system.
17 *
18 */
19public 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 VH5dd8dbe2015-11-26 13:22:18 +053029 public boolean addConnectedPeer(BgpId bgpId, BgpPeer bgpPeer);
Shashikanth VHaa5116f2015-10-29 19:15:32 +053030
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 VH5dd8dbe2015-11-26 13:22:18 +053038 public boolean isPeerConnected(BgpId bgpId);
Shashikanth VHaa5116f2015-10-29 19:15:32 +053039
40 /**
41 * Remove connected peer.
42 *
43 * @param bgpId BGP ID
44 */
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053045 public void removeConnectedPeer(BgpId bgpId);
Shashikanth VHaa5116f2015-10-29 19:15:32 +053046
47 /**
48 * Gets connected peer.
49 *
50 * @param bgpId BGP ID
51 * @return BGPPeer the connected peer, otherwise null
52 */
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053053 public BgpPeer getPeer(BgpId bgpId);
Shashikanth VHaa5116f2015-10-29 19:15:32 +053054}