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.impl;
10 import java.io.IOException;
12 import org.opendaylight.protocol.bgp.parser.BGPSessionListener;
13 import org.opendaylight.protocol.concepts.ListenerRegistration;
14 import org.opendaylight.protocol.framework.ReconnectStrategy;
17 * BGP interface. At this time it only supports listening to changes seen by the backing device, typically a network
18 * element. Abstracts away connection issues - listener starts getting notifications once connection is established.
19 * Implementation of this interface is required to send all previous messages.
21 public interface BGP {
23 * Register for BGP update feed. Specified listener will have the BGP information synchronized. The registration
24 * needs to be explicitly closed in order to stop receiving the updates.
26 * @param listener {@link BGPSessionListener}
27 * @param strategy {@link ReconnectStrategy} to use for TCP-level retries
28 * @throws IllegalStateException if there is already a listener registered
29 * @throws IOException if some IO error occurred
30 * @return ListenerRegistration
32 public ListenerRegistration<BGPSessionListener> registerUpdateListener(BGPSessionListener listener, ReconnectStrategy strategy) throws IOException;