[ONOS-2594] Channel handle to manage session handling with BGP peers

Change-Id: I6c58c674aa17e2a86b063e248af589d524ec5fe3
diff --git a/bgp/api/src/main/java/org/onosproject/bgp/controller/BGPPeer.java b/bgp/api/src/main/java/org/onosproject/bgp/controller/BGPPeer.java
index 1b022c7..aafaf06 100755
--- a/bgp/api/src/main/java/org/onosproject/bgp/controller/BGPPeer.java
+++ b/bgp/api/src/main/java/org/onosproject/bgp/controller/BGPPeer.java
@@ -16,30 +16,16 @@
 package org.onosproject.bgp.controller;
 import java.util.List;
 import org.jboss.netty.channel.Channel;
+import org.onosproject.bgpio.protocol.BGPFactory;
 import org.onosproject.bgpio.protocol.BGPMessage;
-import org.onosproject.bgpio.protocol.BGPVersion;
 
 /**
- * Represents the peer side of an bgp peer.
+ * Represents the peer side of an BGP peer.
  *
  */
 public interface BGPPeer {
 
     /**
-     * Sets the BGP version for this bgp peer.
-     *
-     * @param bgpVersion the version to set.
-     */
-    void setBgpPeerVersion(BGPVersion bgpVersion);
-
-    /**
-     * Gets the BGP version for this bgp peer.
-     *
-     * @return bgp identifier.
-     */
-    int getBgpPeerIdentifier();
-
-    /**
      * Sets the associated Netty channel for this bgp peer.
      *
      * @param channel the Netty channel
@@ -54,27 +40,6 @@
     Channel getChannel();
 
     /**
-     * Sets the AS Number for this bgp peer.
-     *
-     * @param peerASNum the autonomous system number value to set.
-     */
-    void setBgpPeerASNum(short peerASNum);
-
-    /**
-     * Sets the hold time for this bgp peer.
-     *
-     * @param peerHoldTime the hold timer value to set.
-     */
-    void setBgpPeerHoldTime(short peerHoldTime);
-
-    /**
-     * Sets the peer identifier value.
-     *
-     * @param peerIdentifier the bgp peer identifier value.
-     */
-    void setBgpPeerIdentifier(int peerIdentifier);
-
-    /**
      * Sets whether the bgp peer is connected.
      *
      * @param connected whether the bgp peer is connected
@@ -82,15 +47,6 @@
     void setConnected(boolean connected);
 
     /**
-     * Initialises the behaviour.
-     *
-     * @param bgpId id of bgp peer
-     * @param bgpVersion BGP version
-     * @param pktStats packet statistics
-     */
-    void init(BGPId bgpId, BGPVersion bgpVersion, BGPPacketStats pktStats);
-
-    /**
      * Checks whether the handshake is complete.
      *
      * @return true is finished, false if not.
@@ -112,18 +68,11 @@
     void sendMessage(List<BGPMessage> msgs);
 
     /**
-     * Gets a string version of the ID for this bgp peer.
+     * Provides the factory for BGP version.
      *
-     * @return string version of the ID
+     * @return BGP version specific factory.
      */
-    String getStringId();
-
-    /**
-     * Gets the ipAddress of the peer.
-     *
-     * @return the peer bgpId in IPAddress format
-     */
-    BGPId getBGPId();
+    BGPFactory factory();
 
     /**
      * Checks if the bgp peer is still connected.
@@ -146,16 +95,9 @@
     String channelId();
 
     /**
-     * Gets the negotiated hold time.
+     * Return the BGP session info.
      *
-     * @return the negotiated hold time
+     * @return sessionInfo bgp session info
      */
-    int getNegotiatedHoldTime();
-
-    /**
-     * Sets negotiated hold time for the peer.
-     *
-     * @param negotiatedHoldTime negotiated hold time
-     */
-    void setNegotiatedHoldTime(short negotiatedHoldTime);
+    BgpSessionInfo sessionInfo();
 }