Committed by
Gerrit Code Review
[ONOS-2592] Bgp interface to initiate peer connection.
Change-Id: I54c4324eebb5d9ad3993de018cbaeda4b68453ea
Showing
3 changed files
with
34 additions
and
8 deletions
... | @@ -163,4 +163,18 @@ public interface BGPPeerCfg { | ... | @@ -163,4 +163,18 @@ public interface BGPPeerCfg { |
163 | * AS number | 163 | * AS number |
164 | */ | 164 | */ |
165 | void setPeerRouterId(String peerId, int asNumber); | 165 | void setPeerRouterId(String peerId, int asNumber); |
166 | + | ||
167 | + /** | ||
168 | + * Set the peer connect instance. | ||
169 | + * | ||
170 | + * @param connectpeer connect peer instance | ||
171 | + */ | ||
172 | + void setConnectPeer(BgpConnectPeer connectpeer); | ||
173 | + | ||
174 | + /** | ||
175 | + * Get the peer connect instance. | ||
176 | + * | ||
177 | + * @return peer connect instance | ||
178 | + */ | ||
179 | + BgpConnectPeer connectPeer(); | ||
166 | } | 180 | } | ... | ... |
... | @@ -12,17 +12,17 @@ | ... | @@ -12,17 +12,17 @@ |
12 | */ | 12 | */ |
13 | package org.onosproject.bgp.controller; | 13 | package org.onosproject.bgp.controller; |
14 | 14 | ||
15 | -import java.util.concurrent.ExecutorService; | ||
16 | - | ||
17 | /** | 15 | /** |
18 | * Abstraction of an BGP connect peer, initiate remote connection to BGP peer on configuration. | 16 | * Abstraction of an BGP connect peer, initiate remote connection to BGP peer on configuration. |
19 | */ | 17 | */ |
20 | -public interface BGPConnectPeer { | 18 | +public interface BgpConnectPeer { |
19 | + /** | ||
20 | + * Initiate bgp peer connection. | ||
21 | + */ | ||
22 | + void connectPeer(); | ||
21 | 23 | ||
22 | /** | 24 | /** |
23 | - * Returns the executor initialized to connect peer. | 25 | + * End bgp peer connection. |
24 | - * | 26 | + */ |
25 | - * @return connectExecutor the connection executor | 27 | + void disconnectPeer(); |
26 | - */ | ||
27 | - ExecutorService connectExecutor(); | ||
28 | } | 28 | } | ... | ... |
... | @@ -16,6 +16,7 @@ | ... | @@ -16,6 +16,7 @@ |
16 | package org.onosproject.bgp.controller.impl; | 16 | package org.onosproject.bgp.controller.impl; |
17 | 17 | ||
18 | import org.onlab.packet.Ip4Address; | 18 | import org.onlab.packet.Ip4Address; |
19 | +import org.onosproject.bgp.controller.BgpConnectPeer; | ||
19 | import org.onosproject.bgp.controller.BGPPeerCfg; | 20 | import org.onosproject.bgp.controller.BGPPeerCfg; |
20 | 21 | ||
21 | /** | 22 | /** |
... | @@ -28,6 +29,7 @@ public class BGPPeerConfig implements BGPPeerCfg { | ... | @@ -28,6 +29,7 @@ public class BGPPeerConfig implements BGPPeerCfg { |
28 | private Ip4Address peerId = null; | 29 | private Ip4Address peerId = null; |
29 | private State state; | 30 | private State state; |
30 | private boolean selfInitiated; | 31 | private boolean selfInitiated; |
32 | + private BgpConnectPeer connectPeer; | ||
31 | 33 | ||
32 | /** | 34 | /** |
33 | * Constructor to initialize the values. | 35 | * Constructor to initialize the values. |
... | @@ -106,4 +108,14 @@ public class BGPPeerConfig implements BGPPeerCfg { | ... | @@ -106,4 +108,14 @@ public class BGPPeerConfig implements BGPPeerCfg { |
106 | public void setSelfInnitConnection(boolean selfInit) { | 108 | public void setSelfInnitConnection(boolean selfInit) { |
107 | this.selfInitiated = selfInit; | 109 | this.selfInitiated = selfInit; |
108 | } | 110 | } |
111 | + | ||
112 | + @Override | ||
113 | + public BgpConnectPeer connectPeer() { | ||
114 | + return this.connectPeer; | ||
115 | + } | ||
116 | + | ||
117 | + @Override | ||
118 | + public void setConnectPeer(BgpConnectPeer connectPeer) { | ||
119 | + this.connectPeer = connectPeer; | ||
120 | + } | ||
109 | } | 121 | } | ... | ... |
-
Please register or login to post a comment