Shashikanth VH
Committed by Gerrit Code Review

[ONOS-2591] Interface to manage BGP peer connections

Change-Id: Iae063c6dbbde4af15c2313395af0d00bfb49a120
1 +/*
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 + */
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 + */
29 + public boolean addConnectedPeer(BGPId bgpId, BGPPeer bgpPeer);
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 + */
38 + public boolean isPeerConnected(BGPId bgpId);
39 +
40 + /**
41 + * Remove connected peer.
42 + *
43 + * @param bgpId BGP ID
44 + */
45 + public void removeConnectedPeer(BGPId bgpId);
46 +
47 + /**
48 + * Gets connected peer.
49 + *
50 + * @param bgpId BGP ID
51 + * @return BGPPeer the connected peer, otherwise null
52 + */
53 + public BGPPeer getPeer(BGPId bgpId);
54 +}