Move releaseConnection from ReusableBGPPeer to BGPSessionListener
[bgpcep.git] / bgp / testtool / src / test / java / org / opendaylight / protocol / bgp / testtool / BGPSpeakerMock.java
index 3144f896e1cb177834a5cb9cb5181b2e0b2a0f71..fd5698cf0a8dad58e25b856b0258d4864e209a72 100644 (file)
@@ -23,8 +23,6 @@ import org.opendaylight.protocol.bgp.rib.impl.BGPSessionImpl;
 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;
@@ -54,7 +52,7 @@ public class BGPSpeakerMock {
 
         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
@@ -67,7 +65,7 @@ public class BGPSpeakerMock {
             }
 
             @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();
             }
 
@@ -93,12 +91,7 @@ public class BGPSpeakerMock {
 
     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));
 
@@ -106,11 +99,6 @@ public class BGPSpeakerMock {
     }
 
     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);
     }
 }