BUG-3888 : remove remote-as from argument list 88/24788/2
authorDana Kutenicsova <dkutenic@cisco.com>
Wed, 5 Aug 2015 08:09:27 +0000 (10:09 +0200)
committerDana Kutenicsova <dkutenic@cisco.com>
Wed, 5 Aug 2015 08:45:07 +0000 (10:45 +0200)
remote-as can be deduced directly from remote Open
message, no need to pass it as a separate parameter.

Change-Id: I63717a0fa2454b01b4424bd2584c818d6fbdc65d
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>
bgp/rib-impl/src/main/java/org/opendaylight/controller/config/yang/bgp/rib/impl/StrictBgpPeerRegistryModule.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AbstractBGPSessionNegotiator.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/StrictBGPPeerRegistry.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/BGPPeerRegistry.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/FSMTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/SimpleSessionListener.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/StrictBGPPeerRegistryTest.java
bgp/testtool/src/test/java/org/opendaylight/protocol/bgp/testtool/BGPSpeakerMock.java

index 6c2e85ff487b895bd11084b5621b7ac1b9812473..3fdfb65613e4e5aac89bf2e3ebd1f6f7d60d3b0a 100644 (file)
@@ -7,7 +7,6 @@ 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.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;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.Open;
@@ -51,9 +50,9 @@ public class StrictBgpPeerRegistryModule extends org.opendaylight.controller.con
         }
 
         @Override
-        public BGPSessionListener getPeer(final IpAddress ip, final Ipv4Address sourceId, final Ipv4Address remoteId, final AsNumber asNumber, final Open open)
+        public BGPSessionListener getPeer(final IpAddress ip, final Ipv4Address sourceId, final Ipv4Address remoteId, final Open open)
                 throws BGPDocumentedException {
-            return this.global.getPeer(ip, sourceId, remoteId, asNumber, open);
+            return this.global.getPeer(ip, sourceId, remoteId, open);
         }
 
         @Override
index d1c5dd2aa27f58506f38aa6103d8a0b21bd68762..013f02d5846dc7aa43d5915cbacb55c9aa340d98 100644 (file)
@@ -18,7 +18,6 @@ import io.netty.channel.ChannelInboundHandlerAdapter;
 import io.netty.util.concurrent.Promise;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.concurrent.GuardedBy;
-import org.opendaylight.protocol.bgp.parser.AsNumberUtil;
 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
 import org.opendaylight.protocol.bgp.parser.BGPError;
 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry;
@@ -26,7 +25,6 @@ import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionPreferences;
 import org.opendaylight.protocol.bgp.rib.spi.BGPSessionListener;
 import org.opendaylight.protocol.bgp.rib.spi.SessionNegotiator;
 import org.opendaylight.protocol.util.Values;
-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;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.Keepalive;
@@ -93,18 +91,17 @@ public abstract class AbstractBGPSessionNegotiator extends ChannelInboundHandler
     private synchronized void startNegotiation() {
         // Open can be sent first either from ODL (IDLE) or from peer (OPEN_CONFIRM)
         Preconditions.checkState(this.state == State.IDLE || this.state == State.OPEN_CONFIRM);
+        final IpAddress remoteIp = getRemoteIp();
 
         // Check if peer is configured in registry before retrieving preferences
-        if (!this.registry.isPeerConfigured(getRemoteIp())) {
+        if (!this.registry.isPeerConfigured(remoteIp)) {
             final BGPDocumentedException cause = new BGPDocumentedException(
-                    "BGP peer with ip: " + getRemoteIp()
-                    + " not configured, check configured peers in : "
-                    + this.registry, BGPError.CONNECTION_REJECTED);
+                String.format("BGP peer with ip: %s not configured, check configured peers in : %s", remoteIp, this.registry), BGPError.CONNECTION_REJECTED);
             negotiationFailed(cause);
             return;
         }
 
-        final BGPSessionPreferences preferences = getPreferences();
+        final BGPSessionPreferences preferences = this.registry.getPeerPreferences(remoteIp);
 
         int as = preferences.getMyAs().getValue().intValue();
         // Set as AS_TRANS if the value is bigger than 2B
@@ -129,10 +126,6 @@ public abstract class AbstractBGPSessionNegotiator extends ChannelInboundHandler
         }
     }
 
-    private BGPSessionPreferences getPreferences() {
-        return this.registry.getPeerPreferences(getRemoteIp());
-    }
-
     private IpAddress getRemoteIp() {
         return StrictBGPPeerRegistry.getIpAddress(this.channel.remoteAddress());
     }
@@ -192,10 +185,12 @@ public abstract class AbstractBGPSessionNegotiator extends ChannelInboundHandler
     }
 
     private void handleOpen(final Open openObj) {
+        final IpAddress remoteIp = getRemoteIp();
+        final BGPSessionPreferences preferences = this.registry.getPeerPreferences(remoteIp);
         try {
-            final BGPSessionListener peer = this.registry.getPeer(getRemoteIp(), getSourceId(openObj, getPreferences()), getDestinationId(openObj, getPreferences()), getAsNumber(openObj, getPreferences()), openObj);
+            final BGPSessionListener peer = this.registry.getPeer(remoteIp, getSourceId(openObj, preferences), getDestinationId(openObj, preferences), openObj);
             sendMessage(new KeepaliveBuilder().build());
-            this.session = new BGPSessionImpl(peer, this.channel, openObj, getPreferences(), this.registry);
+            this.session = new BGPSessionImpl(peer, this.channel, openObj, preferences, this.registry);
             this.state = State.OPEN_CONFIRM;
             LOG.debug("Channel {} moved to OpenConfirm state with remote proposal {}", this.channel, openObj);
         } catch (final BGPDocumentedException e) {
@@ -230,15 +225,6 @@ public abstract class AbstractBGPSessionNegotiator extends ChannelInboundHandler
      */
     protected abstract Ipv4Address getSourceId(final Open openMsg, final BGPSessionPreferences preferences);
 
-    /**
-     * @param openMsg Open message received from remote BGP speaker
-     * @param preferences Local BGP speaker preferences
-     * @return AS Number of device that initiate connection
-     */
-    protected AsNumber getAsNumber(final Open openMsg, final BGPSessionPreferences preferences) {
-        return AsNumberUtil.advertizedAsNumber(openMsg);
-    }
-
     public synchronized State getState() {
         return this.state;
     }
index 826d2f284a8aa409b9db9028f9da0ae44b671651..4600aa9097b72f9ce74a7d7894924a37376dff5b 100644 (file)
@@ -102,10 +102,11 @@ public final class StrictBGPPeerRegistry implements BGPPeerRegistry {
 
     @Override
     public synchronized BGPSessionListener getPeer(final IpAddress ip, final Ipv4Address sourceId,
-        final Ipv4Address remoteId, final AsNumber remoteAsNumber, final Open openObj) throws BGPDocumentedException {
+        final Ipv4Address remoteId, final Open openObj) throws BGPDocumentedException {
         Preconditions.checkNotNull(ip);
         Preconditions.checkNotNull(sourceId);
         Preconditions.checkNotNull(remoteId);
+        final AsNumber remoteAsNumber = AsNumberUtil.advertizedAsNumber(openObj);
         Preconditions.checkNotNull(remoteAsNumber);
 
         final BGPSessionPreferences prefs = getPeerPreferences(ip);
@@ -162,15 +163,14 @@ public final class StrictBGPPeerRegistry implements BGPPeerRegistry {
                         BGPError.CEASE);
             }
         }
-        validateAs(openObj, prefs);
+        validateAs(remoteAsNumber, openObj, prefs);
 
         // Map session id to peer IP address
         this.sessionIds.put(ip, currentConnection);
         return p;
     }
 
-    private void validateAs(final Open openObj, final BGPSessionPreferences localPref) throws BGPDocumentedException {
-        final AsNumber remoteAs = AsNumberUtil.advertizedAsNumber(openObj);
+    private void validateAs(final AsNumber remoteAs, final Open openObj, final BGPSessionPreferences localPref) throws BGPDocumentedException {
         if (!remoteAs.equals(localPref.getExpectedRemoteAs())) {
             LOG.warn("Unexpected remote AS number. Expecting {}, got {}", remoteAs, localPref.getExpectedRemoteAs());
             throw new BGPDocumentedException("Peer AS number mismatch", BGPError.BAD_PEER_AS);
index ac0ffea5865c946f45febb0033d01973051c3435..97a8f49c9ce299c506bfe8f012f2ddbd8f91a204 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.protocol.bgp.rib.impl.spi;
 
 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
 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;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.Open;
@@ -58,14 +57,13 @@ public interface BGPPeerRegistry extends AutoCloseable {
      * @param ip address of remote peer
      * @param sourceId BGP ID of peer that initiated the session (current device or remote peer)
      * @param remoteId BGP ID of peer that accepted the session (current device or remote peer)
-     * @param asNumber remote AS number
      * @param open remote Open message
      * @return BGPSessionListener configured Peer as BGP listener
      *
      * @throws BGPDocumentedException if session establishment cannot be finished successfully
      * @throws java.lang.IllegalStateException if there is no peer configured for provided ip address
      */
-    BGPSessionListener getPeer(IpAddress ip, Ipv4Address sourceId, Ipv4Address remoteId, AsNumber asNumber, Open open) throws BGPDocumentedException;
+    BGPSessionListener getPeer(IpAddress ip, Ipv4Address sourceId, Ipv4Address remoteId, Open open) throws BGPDocumentedException;
 
     /**
      * @param ip address of remote peer
index 1ce90a132bfe8092b681dcd013bacf75685bbd47..823a7f920ccb28dffa864f62bbe514c466983201 100644 (file)
@@ -112,10 +112,6 @@ public class FSMTest {
         doReturn(null).when(f).addListener(any(GenericFutureListener.class));
 
         final InetAddress peerAddress = InetAddress.getByName("1.1.1.2");
-        final BGPPeerRegistry peerRegistry = new StrictBGPPeerRegistry();
-        peerRegistry.addPeer(new IpAddress(new Ipv4Address(peerAddress.getHostAddress())), new SimpleSessionListener(), prefs);
-
-        this.clientSession = new BGPClientSessionNegotiator(new DefaultPromise<BGPSessionImpl>(GlobalEventExecutor.INSTANCE), this.speakerListener, peerRegistry);
         doAnswer(new Answer<Object>() {
             @Override
             public Object answer(final InvocationOnMock invocation) {
@@ -133,6 +129,12 @@ public class FSMTest {
         doReturn(this.pipeline).when(this.pipeline).replace(any(ChannelHandler.class), any(String.class), any(ChannelHandler.class));
         doReturn(this.pipeline).when(this.pipeline).addLast(any(ChannelHandler.class));
         doReturn(mock(ChannelFuture.class)).when(this.speakerListener).close();
+
+        final BGPPeerRegistry peerRegistry = new StrictBGPPeerRegistry();
+        peerRegistry.addPeer(new IpAddress(new Ipv4Address(peerAddress.getHostAddress())), new SimpleSessionListener(), prefs);
+
+        this.clientSession = new BGPClientSessionNegotiator(new DefaultPromise<BGPSessionImpl>(GlobalEventExecutor.INSTANCE), this.speakerListener, peerRegistry);
+
         this.classicOpen = new OpenBuilder().setMyAsNumber(30).setHoldTimer(3).setVersion(new ProtocolVersion((short) 4)).setBgpParameters(
             tlvs).setBgpIdentifier(new Ipv4Address("1.1.1.2")).build();
     }
index 40b97798f0c6410a37790f9755d630869bfce1f4..84d65a87d15552cedcd52030bf9eb0f5edeead51 100644 (file)
@@ -32,6 +32,9 @@ public class SimpleSessionListener implements ReusableBGPPeer {
 
     private BGPSession session;
 
+    public SimpleSessionListener() {
+    }
+
     public List<Notification> getListMsg() {
         return this.listMsg;
     }
@@ -66,7 +69,7 @@ public class SimpleSessionListener implements ReusableBGPPeer {
         if (this.session != null) {
             try {
                 this.session.close();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 LOG.warn("Error closing session", e);
             }
             this.session = null;
index 1299d0ccbf81ad3e4115d6ce70629ed1620898ec..32db6165bc79212339140910b55dfdbc674a9b14 100644 (file)
@@ -36,9 +36,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 
 public class StrictBGPPeerRegistryTest {
 
-    private StrictBGPPeerRegistry droppingBGPSessionRegistry;
+    private StrictBGPPeerRegistry peerRegistry;
     private BGPSessionPreferences mockPreferences;
-    private final AsNumber AS1 = new AsNumber(1234L);
+    private static final AsNumber AS1 = new AsNumber(1234L);
 
     private Open createOpen(final Ipv4Address bgpId, final AsNumber as) {
         final List<BgpParameters> params = Lists.newArrayList(new BgpParametersBuilder()
@@ -50,8 +50,8 @@ public class StrictBGPPeerRegistryTest {
 
     @Before
     public void setUp() throws Exception {
-        this.droppingBGPSessionRegistry = new StrictBGPPeerRegistry();
-        this.mockPreferences = getMockPreferences(this.AS1);
+        this.peerRegistry = new StrictBGPPeerRegistry();
+        this.mockPreferences = getMockPreferences(AS1);
     }
 
     @Test
@@ -68,11 +68,11 @@ public class StrictBGPPeerRegistryTest {
         final Ipv4Address to = new Ipv4Address("255.255.255.255");
 
         final ReusableBGPPeer session1 = getMockSession();
-        this.droppingBGPSessionRegistry.addPeer(remoteIp, session1, this.mockPreferences);
+        this.peerRegistry.addPeer(remoteIp, session1, this.mockPreferences);
 
-        this.droppingBGPSessionRegistry.getPeer(remoteIp, from, to, this.AS1, createOpen(to, this.AS1));
+        this.peerRegistry.getPeer(remoteIp, from, to, createOpen(to, AS1));
         try {
-            this.droppingBGPSessionRegistry.getPeer(remoteIp, from, to, this.AS1, createOpen(to, this.AS1));
+            this.peerRegistry.getPeer(remoteIp, from, to, createOpen(to, AS1));
         } catch (final BGPDocumentedException e) {
             assertEquals(BGPError.CEASE, e.getError());
             return;
@@ -88,7 +88,7 @@ public class StrictBGPPeerRegistryTest {
         final Ipv4Address to = new Ipv4Address("255.255.255.255");
 
         try {
-            this.droppingBGPSessionRegistry.getPeer(remoteIp, from, to, this.AS1, createOpen(to, this.AS1));
+            this.peerRegistry.getPeer(remoteIp, from, to, createOpen(to, AS1));
         } catch (final IllegalStateException e) {
             return;
         }
@@ -105,13 +105,13 @@ public class StrictBGPPeerRegistryTest {
         final IpAddress remoteIp2 = new IpAddress(to2);
 
         final ReusableBGPPeer session1 = getMockSession();
-        this.droppingBGPSessionRegistry.addPeer(remoteIp, session1, this.mockPreferences);
+        this.peerRegistry.addPeer(remoteIp, session1, this.mockPreferences);
         final ReusableBGPPeer session2 = getMockSession();
-        this.droppingBGPSessionRegistry.addPeer(remoteIp2, session2, this.mockPreferences);
+        this.peerRegistry.addPeer(remoteIp2, session2, this.mockPreferences);
 
-        final BGPSessionListener returnedSession1 = this.droppingBGPSessionRegistry.getPeer(remoteIp, from, to, this.AS1, createOpen(to, this.AS1));
+        final BGPSessionListener returnedSession1 = this.peerRegistry.getPeer(remoteIp, from, to, createOpen(to, AS1));
         assertSame(session1, returnedSession1);
-        final BGPSessionListener returnedSession2 = this.droppingBGPSessionRegistry.getPeer(remoteIp2, from, to2, this.AS1, createOpen(to, this.AS1));
+        final BGPSessionListener returnedSession2 = this.peerRegistry.getPeer(remoteIp2, from, to2, createOpen(to, AS1));
         assertSame(session2, returnedSession2);
 
         Mockito.verifyZeroInteractions(session1);
@@ -125,11 +125,11 @@ public class StrictBGPPeerRegistryTest {
         final IpAddress remoteIp = new IpAddress(lower);
 
         final ReusableBGPPeer session1 = getMockSession();
-        this.droppingBGPSessionRegistry.addPeer(remoteIp, session1, this.mockPreferences);
+        this.peerRegistry.addPeer(remoteIp, session1, this.mockPreferences);
 
-        this.droppingBGPSessionRegistry.getPeer(remoteIp, higher, lower, this.AS1, createOpen(lower, this.AS1));
+        this.peerRegistry.getPeer(remoteIp, higher, lower, createOpen(lower, AS1));
         try {
-            this.droppingBGPSessionRegistry.getPeer(remoteIp, lower, higher, this.AS1, createOpen(higher, this.AS1));
+            this.peerRegistry.getPeer(remoteIp, lower, higher, createOpen(higher, AS1));
         } catch (final BGPDocumentedException e) {
             assertEquals(BGPError.CEASE, e.getError());
             return;
@@ -145,10 +145,10 @@ public class StrictBGPPeerRegistryTest {
         final IpAddress remoteIp = new IpAddress(lower);
 
         final ReusableBGPPeer session1 = getMockSession();
-        this.droppingBGPSessionRegistry.addPeer(remoteIp, session1, this.mockPreferences);
+        this.peerRegistry.addPeer(remoteIp, session1, this.mockPreferences);
 
-        this.droppingBGPSessionRegistry.getPeer(remoteIp, lower, higher, this.AS1, createOpen(higher, this.AS1));
-        this.droppingBGPSessionRegistry.getPeer(remoteIp, higher, lower, this.AS1, createOpen(lower, this.AS1));
+        this.peerRegistry.getPeer(remoteIp, lower, higher, createOpen(higher, AS1));
+        this.peerRegistry.getPeer(remoteIp, higher, lower, createOpen(lower, AS1));
         Mockito.verify(session1).releaseConnection();
     }
 
@@ -159,11 +159,11 @@ public class StrictBGPPeerRegistryTest {
         final Ipv4Address to = new Ipv4Address("255.255.255.255");
 
         final ReusableBGPPeer session1 = getMockSession();
-        this.droppingBGPSessionRegistry.addPeer(remoteIp, session1, this.mockPreferences);
+        this.peerRegistry.addPeer(remoteIp, session1, this.mockPreferences);
 
-        this.droppingBGPSessionRegistry.getPeer(remoteIp, from, to, this.AS1, createOpen(to, this.AS1));
+        this.peerRegistry.getPeer(remoteIp, from, to, createOpen(to, AS1));
         try {
-            this.droppingBGPSessionRegistry.getPeer(remoteIp, to, to, this.AS1, createOpen(to, this.AS1));
+            this.peerRegistry.getPeer(remoteIp, to, to, createOpen(to, AS1));
         } catch (final BGPDocumentedException e) {
             assertEquals(BGPError.CEASE, e.getError());
             return;
@@ -180,10 +180,10 @@ public class StrictBGPPeerRegistryTest {
         final AsNumber as2 = new AsNumber(1235L);
 
         final ReusableBGPPeer session1 = getMockSession();
-        this.droppingBGPSessionRegistry.addPeer(remoteIp, session1, this.mockPreferences);
+        this.peerRegistry.addPeer(remoteIp, session1, this.mockPreferences);
 
-        this.droppingBGPSessionRegistry.getPeer(remoteIp, from, to, this.AS1, createOpen(to, this.AS1));
-        this.droppingBGPSessionRegistry.getPeer(remoteIp, from, to, as2, createOpen(to, as2));
+        this.peerRegistry.getPeer(remoteIp, from, to, createOpen(to, AS1));
+        this.peerRegistry.getPeer(remoteIp, from, to, createOpen(to, as2));
         Mockito.verify(session1).releaseConnection();
     }
 
@@ -195,11 +195,11 @@ public class StrictBGPPeerRegistryTest {
         final AsNumber as2 = new AsNumber(3L);
 
         final ReusableBGPPeer session1 = getMockSession();
-        this.droppingBGPSessionRegistry.addPeer(remoteIp, session1, this.mockPreferences);
+        this.peerRegistry.addPeer(remoteIp, session1, this.mockPreferences);
 
-        this.droppingBGPSessionRegistry.getPeer(remoteIp, from, to, this.AS1, createOpen(to, this.AS1));
+        this.peerRegistry.getPeer(remoteIp, from, to, createOpen(to, AS1));
         try {
-            this.droppingBGPSessionRegistry.getPeer(remoteIp, from, to, as2, createOpen(to, as2));
+            this.peerRegistry.getPeer(remoteIp, from, to, createOpen(to, as2));
         } catch (final BGPDocumentedException e) {
             assertEquals(BGPError.CEASE, e.getError());
             return;
@@ -216,10 +216,10 @@ public class StrictBGPPeerRegistryTest {
         final AsNumber as2 = new AsNumber(3L);
 
         final ReusableBGPPeer session1 = getMockSession();
-        this.droppingBGPSessionRegistry.addPeer(remoteIp, session1, this.mockPreferences);
+        this.peerRegistry.addPeer(remoteIp, session1, this.mockPreferences);
 
         try {
-            this.droppingBGPSessionRegistry.getPeer(remoteIp, from, to, as2, createOpen(to, as2));
+            this.peerRegistry.getPeer(remoteIp, from, to, createOpen(to, as2));
         } catch (final BGPDocumentedException e) {
             assertEquals(BGPError.BAD_PEER_AS, e.getError());
             return;
@@ -235,6 +235,6 @@ public class StrictBGPPeerRegistryTest {
     }
 
     public BGPSessionPreferences getMockPreferences(final AsNumber remoteAs) {
-        return new BGPSessionPreferences(this.AS1, 1, new Ipv4Address("0.0.0.1"), remoteAs, Collections.<BgpParameters> emptyList());
+        return new BGPSessionPreferences(AS1, 1, new Ipv4Address("0.0.0.1"), remoteAs, Collections.<BgpParameters> emptyList());
     }
 }
index f12ac4f751209fa6a1ba4ccbd00bf26d811ac850..347ba9c03641a394fc89bec560f110f2b5aad6b2 100644 (file)
@@ -66,7 +66,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();
             }