2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bgp.testtool;
10 import org.opendaylight.protocol.bgp.parser.BGPSession;
11 import org.opendaylight.protocol.bgp.parser.BGPSessionListener;
12 import org.opendaylight.protocol.bgp.parser.BGPTerminationReason;
13 import org.opendaylight.yangtools.yang.binding.Notification;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
18 * Testing BGP Listener.
20 public class TestingListener implements BGPSessionListener {
21 private static final Logger logger = LoggerFactory.getLogger(TestingListener.class);
24 public void onMessage(final BGPSession session, final Notification message) {
25 logger.info("Client Listener: message received: {}", message.toString());
29 public void onSessionUp(final BGPSession session) {
30 logger.info("Client Listener: Session Up.");
34 public void onSessionDown(final BGPSession session, final Exception e) {
35 logger.info("Client Listener: Connection lost.");
40 public void onSessionTerminated(final BGPSession session, final BGPTerminationReason cause) {
41 logger.info("Client Listener: Connection lost: {}.", cause);