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.parser;
12 import org.opendaylight.protocol.bgp.concepts.BGPTableType;
14 import org.opendaylight.protocol.framework.SessionListener;
17 * Listener that receives session informations from the session.
19 public abstract class BGPSessionListener implements SessionListener {
22 * Fired when an Update or a non-fatal Notification message is received.
24 * @param message BGPMessage
26 public abstract void onMessage(BGPMessage message);
29 * Fired when the session was established successfully.
31 * @param remoteParams Peer address families which we accepted
33 public abstract void onSessionUp(Set<BGPTableType> remoteParams);
36 * Fired when the session went down because of an IO error. Implementation should take care of closing underlying
39 * @param session that went down
40 * @param e Exception that was thrown as the cause of session being down
42 public abstract void onSessionDown(BGPSession session, Exception e);
45 * Fired when the session is terminated locally. The session has already been closed and transitioned to IDLE state.
46 * Any outstanding queued messages were not sent. The user should not attempt to make any use of the session.
48 * @param cause the cause why the session went down
50 public abstract void onSessionTerminated(BGPError cause);