ONOS-866: Refactor the storing and handling of BgpSession info.

Moved the local and remote BGP session info to a separate class BgpSessionInfo.
No functional changes.

Also, removed methods TestBgpPeerChannelHandler.prepareBgpKeepalive(),
prepareBgpNotification() and prepareBgpMessage() from the unit tests.
Instead, use the corresponding methods in the BGP implementation itself
to generate the BGP messages.

Change-Id: I7f4b6ad4f6995c242cd8a9848ea527b1fcac9c11
diff --git a/apps/sdnip/src/main/java/org/onosproject/sdnip/cli/BgpRoutesListCommand.java b/apps/sdnip/src/main/java/org/onosproject/sdnip/cli/BgpRoutesListCommand.java
index 037c985..a3b19df 100644
--- a/apps/sdnip/src/main/java/org/onosproject/sdnip/cli/BgpRoutesListCommand.java
+++ b/apps/sdnip/src/main/java/org/onosproject/sdnip/cli/BgpRoutesListCommand.java
@@ -71,7 +71,7 @@
         if (bgpNeighbor != null) {
             // Print the routes from a single neighbor (if found)
             for (BgpSession bgpSession : service.getBgpSessions()) {
-                if (bgpSession.getRemoteBgpId().toString().equals(bgpNeighbor)) {
+                if (bgpSession.remoteInfo().bgpId().toString().equals(bgpNeighbor)) {
                     foundBgpSession = bgpSession;
                     break;
                 }
@@ -152,7 +152,7 @@
             print(FORMAT_ROUTE_LINE1, route.prefix(), route.nextHop(),
                   Update.Origin.typeToString(route.getOrigin()),
                   route.getLocalPref(), route.getMultiExitDisc(),
-                  route.getBgpSession().getRemoteBgpId());
+                  route.getBgpSession().remoteInfo().bgpId());
             print(FORMAT_ROUTE_LINE2, asPath4Cli(route.getAsPath()));
         }
     }
@@ -245,7 +245,8 @@
 
         result.put("prefix", route.prefix().toString());
         result.put("nextHop", route.nextHop().toString());
-        result.put("bgpId", route.getBgpSession().getRemoteBgpId().toString());
+        result.put("bgpId",
+                   route.getBgpSession().remoteInfo().bgpId().toString());
         result.put("origin", Update.Origin.typeToString(route.getOrigin()));
         result.put("asPath", json(mapper, route.getAsPath()));
         result.put("localPref", route.getLocalPref());