2 * Copyright (c) 2015 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
9 package org.opendaylight.protocol.bmp.impl.session;
11 import com.google.common.collect.Lists;
12 import java.util.List;
13 import org.opendaylight.protocol.bmp.api.BmpSession;
14 import org.opendaylight.protocol.bmp.api.BmpSessionListener;
15 import org.opendaylight.yangtools.yang.binding.Notification;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
19 public class BmpTestSessionListener implements BmpSessionListener {
21 private static final Logger LOG = LoggerFactory.getLogger(BmpTestSessionListener.class);
22 private final List<Notification> messages = Lists.newArrayList();
23 private boolean up = false;
25 public boolean isUp () {
29 public List<Notification> getListMsg() {
34 public void onMessage(final Notification message) {
35 LOG.debug("Received message: {} {}", message.getClass(), message);
36 this.messages.add(message);
40 public synchronized void onSessionUp(final BmpSession session) {
41 LOG.debug("Session up.");
46 public void onSessionDown(final Exception e) {
47 LOG.debug("Session down.", e);