67d21d2bc09d7c46f7b3f9d0f01379151d0a34ea
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / spi / BGPDispatcher.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.spi;
9
10 import io.netty.util.concurrent.Future;
11
12 import java.net.InetSocketAddress;
13
14 import org.opendaylight.protocol.bgp.parser.BGPSession;
15 import org.opendaylight.protocol.bgp.parser.BGPSessionListener;
16 import org.opendaylight.protocol.framework.ReconnectStrategy;
17 import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
18 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
19
20 /**
21  * Dispatcher class for creating BGP clients.
22  */
23 public interface BGPDispatcher {
24
25         /**
26          * Creates BGP client.
27          * 
28          * @param address Peer address
29          * @param preferences connection attributes required for connection
30          * @param listener BGP message listener
31          * @return Future promising a client session
32          */
33         Future<? extends BGPSession> createClient(InetSocketAddress address, BGPSessionPreferences preferences, AsNumber remoteAs,
34                         BGPSessionListener listener, ReconnectStrategy strategy);
35
36         Future<Void> createReconnectingClient(InetSocketAddress address, BGPSessionPreferences preferences, AsNumber remoteAs,
37                         BGPSessionListener listener, ReconnectStrategyFactory connectStrategyFactory, ReconnectStrategyFactory reestablishStrategyFactory);
38 }