@Override public void onSessionUp(final BmpSession session) { this.session = session; this.routerIp = InetAddresses.toAddrString(this.session.getRemoteAddress()); this.routerId = new RouterId(Ipv4Util.getIpAddress(this.session.getRemoteAddress())); // check if this session is redundant if (!this.sessionManager.addSessionListener(this)) { LOG.warn("Redundant BMP session with remote router {} ({}) detected. This BMP session will be abandoned.", this.routerIp, this.session); this.close(); } else { this.routerYangIId = YangInstanceIdentifier.builder(this.sessionManager.getRoutersYangIId()).nodeWithKey(Router.QNAME, ROUTER_ID_QNAME, this.routerIp).build(); this.peersYangIId = YangInstanceIdentifier.builder(routerYangIId).node(Peer.QNAME).build(); createRouterEntry(); LOG.info("BMP session with remote router {} ({}) is up now.", this.routerIp, this.session); } }