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.rib.spi;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.EventListener;
12 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.TablesKey;
14 import org.opendaylight.yangtools.yang.binding.Notification;
17 * Listener that receives session informations from the session.
19 public interface BGPSessionListener extends EventListener {
22 * Marks synchronization finished for given Table key
24 * @param tablesKey of the table where synchronization finished
26 void markUptodate(final TablesKey tablesKey);
29 * Fired when the session was established successfully.
31 * @param session Peer address families which we accepted
33 void onSessionUp(BGPSession session);
35 * Fired when the session went down because of an IO error. Implementation should take care of closing underlying
38 * @param session that went down
39 * @param e Exception that was thrown as the cause of session being down
42 void onSessionDown(BGPSession session, Exception e);
44 * Fired when the session is terminated locally. The session has already been closed and transitioned to IDLE state.
45 * Any outstanding queued messages were not sent. The user should not attempt to make any use of the session.
47 * @param reason the cause why the session went down
49 void onSessionTerminated(BGPSession session, BGPTerminationReason reason);
52 * Fired when a normal protocol message is received.
54 * @param notification Protocol message
56 void onMessage(BGPSession session, Notification notification) throws BGPDocumentedException;
58 ListenableFuture<?> releaseConnection();