MVPN RFC6514 Extendend communities
[bgpcep.git] / bgp / testtool / src / main / java / org / opendaylight / protocol / bgp / testtool / BGPPeerBuilder.java
index 6a5f25621f3aa8fea34dd7a3cb670e3ddd5c45e3..1e02c17e3ac55d06eb40220a32e5c7f80a16910a 100644 (file)
@@ -8,11 +8,11 @@
 
 package org.opendaylight.protocol.bgp.testtool;
 
-import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import io.netty.util.concurrent.Future;
 import java.net.InetSocketAddress;
 import java.util.Collections;
+import java.util.Optional;
 import org.opendaylight.protocol.bgp.rib.impl.BGPDispatcherImpl;
 import org.opendaylight.protocol.bgp.rib.impl.StrictBGPPeerRegistry;
 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher;
@@ -20,8 +20,8 @@ import org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry;
 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionPreferences;
 import org.opendaylight.protocol.bgp.rib.spi.BGPSessionListener;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.BgpParameters;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.open.message.BgpParameters;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.BgpId;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -34,24 +34,24 @@ final class BGPPeerBuilder {
     }
 
     static void createPeer(final BGPDispatcher dispatcher, final Arguments arguments,
-        final InetSocketAddress localAddress, final BGPSessionListener sessionListener,
-        final BgpParameters bgpParameters) {
+            final InetSocketAddress localAddress, final BGPSessionListener sessionListener,
+            final BgpParameters bgpParameters) {
         final AsNumber as = arguments.getAs();
         final BGPSessionPreferences proposal = new BGPSessionPreferences(as, arguments.getHoldTimer(),
-            new BgpId(localAddress.getAddress().getHostAddress()), as, Collections.singletonList(bgpParameters),
-            Optional.absent());
+                new BgpId(localAddress.getAddress().getHostAddress()), as, Collections.singletonList(bgpParameters),
+                Optional.empty());
         final BGPPeerRegistry strictBGPPeerRegistry = dispatcher.getBGPPeerRegistry();
         if (arguments.getInitiateConnection()) {
             for (final InetSocketAddress remoteAddress : arguments.getRemoteAddresses()) {
                 strictBGPPeerRegistry.addPeer(StrictBGPPeerRegistry.getIpAddress(remoteAddress), sessionListener,
-                    proposal);
+                        proposal);
                 addFutureListener(localAddress, ((BGPDispatcherImpl) dispatcher).createClient(localAddress,
-                    remoteAddress, RETRY_TIMER, true));
+                        remoteAddress, RETRY_TIMER, true));
             }
         } else {
             for (final InetSocketAddress remoteAddress : arguments.getRemoteAddresses()) {
                 strictBGPPeerRegistry.addPeer(StrictBGPPeerRegistry.getIpAddress(remoteAddress), sessionListener,
-                    proposal);
+                        proposal);
             }
             addFutureListener(localAddress, dispatcher.createServer(localAddress));
         }
@@ -60,6 +60,6 @@ final class BGPPeerBuilder {
 
     private static <T> void addFutureListener(final InetSocketAddress localAddress, final Future<T> future) {
         future.addListener(future1 -> Preconditions.checkArgument(future1.isSuccess(),
-            "Unable to start bgp session on %s", localAddress, future1.cause()));
+                "Unable to start bgp session on %s", localAddress, future1.cause()));
     }
 }