import org.opendaylight.protocol.bgp.rib.impl.BGPSessionProposalImpl;
import org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry;
import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionPreferences;
-import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionValidator;
-import org.opendaylight.protocol.bgp.rib.impl.spi.ReusableBGPPeer;
import org.opendaylight.protocol.bgp.rib.spi.BGPSessionListener;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
this.peerRegistry = new BGPPeerRegistry() {
@Override
- public void addPeer(final IpAddress ip, final ReusableBGPPeer peer, final BGPSessionPreferences prefs) {
+ public void addPeer(final IpAddress ip, final BGPSessionListener peer, final BGPSessionPreferences prefs) {
}
@Override
}
@Override
- public BGPSessionListener getPeer(final IpAddress ip, final Ipv4Address sourceId, final Ipv4Address remoteId, final AsNumber asNumber, final Open open) throws BGPDocumentedException {
+ public BGPSessionListener getPeer(final IpAddress ip, final Ipv4Address sourceId, final Ipv4Address remoteId, final Open open) throws BGPDocumentedException {
return new SpeakerSessionListener();
}
public void main(final String[] args) {
- final BGPServerSessionNegotiatorFactory snf = new BGPServerSessionNegotiatorFactory(new BGPSessionValidator() {
- @Override
- public void validate(final Open openObj, final BGPSessionPreferences prefs) throws BGPDocumentedException {
- // NOOP
- }
- }, this.peerRegistry);
+ final BGPServerSessionNegotiatorFactory snf = new BGPServerSessionNegotiatorFactory(this.peerRegistry);
final BGPSpeakerMock mock = new BGPSpeakerMock(snf, new BGPHandlerFactory(ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getMessageRegistry()), new DefaultPromise<BGPSessionImpl>(GlobalEventExecutor.INSTANCE));
}
private void createServer(final InetSocketAddress address) {
- this.disp.createServer(this.peerRegistry,address, new BGPSessionValidator() {
- @Override
- public void validate(final Open openObj, final BGPSessionPreferences prefs) throws BGPDocumentedException {
- // NOOP
- }
- });
+ this.disp.createServer(this.peerRegistry,address);
}
}