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
8 package org.opendaylight.protocol.bmp.impl.session;
10 import java.util.ArrayList;
11 import java.util.List;
12 import org.opendaylight.protocol.bmp.api.BmpSession;
13 import org.opendaylight.protocol.bmp.api.BmpSessionListener;
14 import org.opendaylight.yangtools.yang.binding.Notification;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
18 public final class BmpTestSessionListener implements BmpSessionListener {
19 private static final Logger LOG = LoggerFactory.getLogger(BmpTestSessionListener.class);
21 private final List<Notification<?>> messages = new ArrayList<>();
22 private boolean up = false;
24 public boolean isUp() {
28 public List<Notification<?>> getListMsg() {
33 public void onMessage(final Notification<?> message) {
34 LOG.debug("Received message: {} {}", message.getClass(), message);
35 messages.add(message);
39 public synchronized void onSessionUp(final BmpSession session) {
40 LOG.debug("Session up.");
45 public void onSessionDown(final Exception throwable) {
46 LOG.debug("Session down.", throwable);