apps/bmp/protocol/src/main/java/org/onosproject/bmp/controller/BmpSessionManager.java
/**
     * Processes the connection from a BMP peer.
     *
     * @param bmpSession the BMP session for the peer
     * @return true if the connection can be established, otherwise false
     */
Processes the connection from a BMP peer.
@param bmpSession the BMP session for the peer
@return true if the connection can be established, otherwise false
Processes the connection from a BMP peer . @param bmpSession the BMP session for the peer @return true if the connection can be established otherwise false
boolean peerConnected(BmpSession bmpSession) {
        if (bmpSessions.get(bmpSession.remoteInfo().address()) != null) {
            return false;               
        }
        bmpSessions.put(bmpSession.remoteInfo().address(), bmpSession);
        if (bmpSession.localInfo().address() instanceof InetSocketAddress) {
            InetAddress inetAddr =
                ((InetSocketAddress) bmpSession.localInfo().address()).getAddress();
            Ip4Address ip4Address = Ip4Address.valueOf(inetAddr.getAddress());
        }
        return true;
    }
boolean peerConnected ( BmpSession bmpSession ) { if ( bmpSessions . get ( bmpSession . remoteInfo ( ) . address ( ) ) != null ) { return false ; } bmpSessions . put ( bmpSession . remoteInfo ( ) . address ( ) , bmpSession ) ; if ( bmpSession . localInfo ( ) . address ( ) instanceof InetSocketAddress ) { InetAddress inetAddr = ( ( InetSocketAddress ) bmpSession . localInfo ( ) . address ( ) ) . getAddress ( ) ; Ip4Address ip4Address = Ip4Address . valueOf ( inetAddr . getAddress ( ) ) ; } return true ; }
Processes the connection from a BMP peer.
Processes the connection from a BMP peer .
// Test whether there is already a session from the same remote // Duplicate BMP session