BUG-3888 : refactoring, removed unused session validators
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / BGPClientSessionNegotiatorFactory.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 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;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
16
17 public final class BGPClientSessionNegotiatorFactory implements BGPSessionNegotiatorFactory<BGPSessionImpl> {
18     private final BGPPeerRegistry peerRegistry;
19
20     public BGPClientSessionNegotiatorFactory(final AsNumber remoteAs, final BGPPeerRegistry peerRegistry) {
21         this.peerRegistry = peerRegistry;
22     }
23
24     @Override
25     public SessionNegotiator getSessionNegotiator(final Channel channel, final Promise<BGPSessionImpl> promise) {
26         return new BGPClientSessionNegotiator(promise, channel, this.peerRegistry);
27     }
28 }