e3af5d066c994f70e380c62fa83def020ee4559e
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / BGP.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.protocol.bgp.rib.impl;
9
10 import org.opendaylight.protocol.bgp.parser.BGPSessionListener;
11 import org.opendaylight.protocol.concepts.ListenerRegistration;
12 import org.opendaylight.protocol.framework.ReconnectStrategy;
13 import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
14
15 /**
16  * BGP interface. At this time it only supports listening to changes seen by the backing device, typically a network
17  * element. Abstracts away connection issues - listener starts getting notifications once connection is established.
18  * Implementation of this interface is required to send all previous messages.
19  */
20 public interface BGP {
21         /**
22          * Register for BGP update feed. Specified listener will have the BGP information synchronized. The registration
23          * needs to be explicitly closed in order to stop receiving the updates.
24          * 
25          * @param listener {@link BGPSessionListener}
26          * @param tcpStrategyFactory {@link ReconnectStrategyFactory} to use for creating TCP-level retry strategies
27          * @param sessionStrategy {@link ReconnectStrategy} to use for session-level retries
28          * @throws IllegalStateException if there is already a listener registered
29          * @return ListenerRegistration
30          */
31         public ListenerRegistration<BGPSessionListener> registerUpdateListener(BGPSessionListener listener,
32                         ReconnectStrategyFactory tcpStrategyFactory, ReconnectStrategy sessionStrategy);
33 }