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 java.util.EventListener;
11 import javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey;
15 import org.opendaylight.yangtools.yang.binding.Notification;
18 * Listener that receives session informations from the session.
20 public interface BGPSessionListener extends PeerRPCs, EventListener {
23 * Marks synchronization finished for given Table key.
25 * @param tablesKey of the table where synchronization finished
27 void markUptodate(@Nonnull TablesKey tablesKey);
30 * Fired when the session was established successfully.
32 * @param session Peer address families which we accepted
34 void onSessionUp(@Nonnull BGPSession session);
37 * Fired when the session went down because of an IO error. Implementation should take care of closing underlying
40 * @param session that went down
41 * @param exc Exception that was thrown as the cause of session being down
44 void onSessionDown(@Nonnull BGPSession session, @Nonnull Exception exc);
47 * Fired when the session is terminated locally. The session has already been closed and transitioned to IDLE state.
48 * Any outstanding queued messages were not sent. The user should not attempt to make any use of the session.
50 * @param reason the cause why the session went down
52 void onSessionTerminated(@Nullable BGPSession session, @Nonnull BGPTerminationReason reason);
55 * Fired when a normal protocol message is received.
57 * @param notification Protocol message
59 void onMessage(@Nonnull BGPSession session, @Nonnull Notification notification) throws BGPDocumentedException;