X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=bgp%2Ftesttool%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fbgp%2Ftesttool%2FTestingListener.java;h=587c4a48d0f9c07ab15cf885c033c598b460e85e;hb=5b242f296eaf7979e08ca55d99cdba803973b85f;hp=a61cce23f82e8561f8044aa307bc38a443634e6a;hpb=3dd28cfa15e490adf3ba1d46ee1ab193428da57b;p=bgpcep.git diff --git a/bgp/testtool/src/main/java/org/opendaylight/protocol/bgp/testtool/TestingListener.java b/bgp/testtool/src/main/java/org/opendaylight/protocol/bgp/testtool/TestingListener.java index a61cce23f8..587c4a48d0 100644 --- a/bgp/testtool/src/main/java/org/opendaylight/protocol/bgp/testtool/TestingListener.java +++ b/bgp/testtool/src/main/java/org/opendaylight/protocol/bgp/testtool/TestingListener.java @@ -7,46 +7,42 @@ */ package org.opendaylight.protocol.bgp.testtool; -import org.opendaylight.protocol.bgp.parser.BGPMessage; import org.opendaylight.protocol.bgp.parser.BGPSession; -import org.opendaylight.protocol.bgp.parser.BGPSessionListener; import org.opendaylight.protocol.bgp.parser.BGPTerminationReason; -import org.opendaylight.protocol.framework.DispatcherImpl; +import org.opendaylight.protocol.bgp.rib.impl.spi.ReusableBGPPeer; +import org.opendaylight.yangtools.yang.binding.Notification; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Testing BGP Listener. */ -public class TestingListener implements BGPSessionListener { - private static final Logger logger = LoggerFactory.getLogger(TestingListener.class); - - DispatcherImpl d; - - TestingListener(final DispatcherImpl d) { - this.d = d; - } - - @Override - public void onMessage(final BGPSession session, final BGPMessage message) { - logger.info("Client Listener: message received: {}", message.toString()); - } - - @Override - public void onSessionUp(final BGPSession session) { - logger.info("Client Listener: Session Up."); - } - - @Override - public void onSessionDown(final BGPSession session, final Exception e) { - logger.info("Client Listener: Connection lost."); - session.close(); - // this.d.stop(); - } - - @Override - public void onSessionTerminated(final BGPSession session, final BGPTerminationReason cause) { - logger.info("Client Listener: Connection lost: {}.", cause); - // this.d.stop(); - } +public class TestingListener implements ReusableBGPPeer { + private static final Logger LOG = LoggerFactory.getLogger(TestingListener.class); + + @Override + public void onMessage(final BGPSession session, final Notification message) { + LOG.info("Client Listener: message received: {}", message.toString()); + } + + @Override + public void onSessionUp(final BGPSession session) { + LOG.info("Client Listener: Session Up."); + } + + @Override + public void onSessionDown(final BGPSession session, final Exception e) { + LOG.info("Client Listener: Connection lost."); + session.close(); + } + + @Override + public void onSessionTerminated(final BGPSession session, final BGPTerminationReason cause) { + LOG.info("Client Listener: Connection lost: {}.", cause); + } + + @Override + public void releaseConnection() { + LOG.info("Client Listener: Connection released."); + } }