package org.opendaylight.protocol.bgp.rib.impl; import io.netty.channel.Channel; import io.netty.util.Timer; import io.netty.util.concurrent.Promise; import org.opendaylight.protocol.bgp.parser.BGPSessionListener; import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionPreferences; import org.opendaylight.protocol.framework.SessionListenerFactory; import org.opendaylight.protocol.framework.SessionNegotiator; import org.opendaylight.protocol.framework.SessionNegotiatorFactory; import org.opendaylight.yangtools.yang.binding.Notification; import com.google.common.base.Preconditions; public final class BGPSessionNegotiatorFactory implements SessionNegotiatorFactory { private final BGPSessionPreferences initialPrefs; private final Timer timer; public BGPSessionNegotiatorFactory(final Timer timer, final BGPSessionPreferences initialPrefs) { this.timer = Preconditions.checkNotNull(timer); this.initialPrefs = Preconditions.checkNotNull(initialPrefs); } @Override public SessionNegotiator getSessionNegotiator(final SessionListenerFactory factory, final Channel channel, final Promise promise) { return new BGPSessionNegotiator(this.timer, promise, channel, this.initialPrefs, factory.getSessionListener()); } }