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 io.netty.channel.Channel;
11 import io.netty.util.concurrent.Promise;
12 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry;
13 import org.opendaylight.protocol.bgp.rib.spi.BGPSessionNegotiatorFactory;
14 import org.opendaylight.protocol.bgp.rib.spi.SessionNegotiator;
16 public final class BGPClientSessionNegotiatorFactory implements BGPSessionNegotiatorFactory<BGPSessionImpl> {
17 private final BGPPeerRegistry peerRegistry;
19 public BGPClientSessionNegotiatorFactory(final BGPPeerRegistry peerRegistry) {
20 this.peerRegistry = peerRegistry;
24 public SessionNegotiator getSessionNegotiator(final Channel channel, final Promise<BGPSessionImpl> promise) {
25 return new BGPClientSessionNegotiator(promise, channel, this.peerRegistry);