Move releaseConnection from ReusableBGPPeer to BGPSessionListener
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / spi / BGPPeerRegistry.java
index 8d8b18afa79c7faf29cfa14580b9eb752b879a27..b6c520954bbd2aae5b073b9f98d239a3e0796783 100644 (file)
@@ -10,9 +10,9 @@ package org.opendaylight.protocol.bgp.rib.impl.spi;
 
 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
 import org.opendaylight.protocol.bgp.rib.spi.BGPSessionListener;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.Open;
 
 /**
  * Registry that contains configured bgp peers ready for when a bgp session is established with remote peer.
@@ -24,10 +24,10 @@ public interface BGPPeerRegistry extends AutoCloseable {
      * Add configured peer, its IP address and preferences. To be used when a BGP session is established.
      *
      * @param ip address of remote peer
-     * @param peer configured peer as ReusableBGPPeer
+     * @param peer configured peer as BGPSessionListener
      * @param prefs session preferences for configured peer
      */
-    void addPeer(IpAddress ip, ReusableBGPPeer peer, BGPSessionPreferences prefs);
+    void addPeer(IpAddress ip, BGPSessionListener peer, BGPSessionPreferences prefs);
 
     /**
      * Remove configured peer from registry.
@@ -57,12 +57,13 @@ public interface BGPPeerRegistry extends AutoCloseable {
      * @param ip address of remote peer
      * @param sourceId BGP ID of peer that initiated the session (current device or remote peer)
      * @param remoteId BGP ID of peer that accepted the session (current device or remote peer)
-     * @return configured Peer as BGP listener
+     * @param open remote Open message
+     * @return BGPSessionListener configured Peer as BGP listener
      *
      * @throws BGPDocumentedException if session establishment cannot be finished successfully
      * @throws java.lang.IllegalStateException if there is no peer configured for provided ip address
      */
-    BGPSessionListener getPeer(IpAddress ip, Ipv4Address sourceId, Ipv4Address remoteId, AsNumber asNumber) throws BGPDocumentedException;
+    BGPSessionListener getPeer(IpAddress ip, Ipv4Address sourceId, Ipv4Address remoteId, Open open) throws BGPDocumentedException;
 
     /**
      * @param ip address of remote peer