BGPManager module sync up 57/41757/2
authorAbhinav Gupta <abhinav.gupta@ericsson.com>
Wed, 13 Jul 2016 11:41:36 +0000 (17:11 +0530)
committerAbhinav Gupta <abhinav.gupta@ericsson.com>
Wed, 13 Jul 2016 13:13:31 +0000 (18:43 +0530)
Change-Id: Idb6767da56e000aa83f1741e5d8ac9997a4790cd
Signed-off-by: Abhinav Gupta <abhinav.gupta@ericsson.com>
35 files changed:
vpnservice/bgpmanager/bgpmanager-api/src/main/java/org.opendaylight.netvirt.bgpmanager.api/IBgpManager.java
vpnservice/bgpmanager/bgpmanager-api/src/main/java/org.opendaylight.netvirt.bgpmanager.api/RouteOrigin.java [new file with mode: 0644]
vpnservice/bgpmanager/bgpmanager-impl/pom.xml
vpnservice/bgpmanager/bgpmanager-impl/src/main/config/default-config.xml
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpConfigurationManager.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpManager.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpUtil.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/ConfigureBgpCli.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/DisplayBgpConfigCli.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/FibDSWriter.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/commands/ClearBgpCli.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/commands/Neighbor.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/commands/Network.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/oam/BgpAlarmBroadcaster.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/oam/BgpAlarmBroadcasterMBean.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/oam/BgpAlarmErrorCodes.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/oam/BgpCounters.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/oam/BgpCountersBroadcaster.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/oam/BgpCountersBroadcasterMBean.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/client/BgpRouter.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/gen/BgpConfigurator.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/gen/BgpUpdater.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/gen/Routes.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/gen/Update.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/gen/af_afi.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/gen/af_safi.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/gen/qbgpConstants.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/server/BgpThriftService.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/bgpmanager/impl/rev150326/BgpManagerImplModule.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/resources/OSGI-INF/blueprint/commands.xml
vpnservice/bgpmanager/bgpmanager-impl/src/main/yang/bgpmanager-impl.yang
vpnservice/bgpmanager/bgpmanager-impl/src/test/java/org/opendaylight/netvirt/bgpmanager/test/BgpManagerTest.java
vpnservice/bgpmanager/bgpmanager-impl/src/test/java/org/opendaylight/netvirt/bgpmanager/test/MockFibManager.java
vpnservice/natservice/natservice-impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NatUtil.java
vpnservice/vpnmanager/vpnmanager-impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnInterfaceManager.java

index 713a300c22a2ccfb1a31ad45157631c86d8a83de..986cdf69920e138b4226a9f80335c24abdae7413 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.netvirt.bgpmanager.api;
 
 import java.util.Collection;
+import java.util.List;
 
 public interface IBgpManager {
 
@@ -18,53 +19,79 @@ public interface IBgpManager {
      * @param importRts
      * @param exportRts
      */
-    void addVrf(String rd, Collection<String> importRts, Collection<String> exportRts) throws Exception;
+    public void addVrf(String rd, Collection<String> importRts, Collection<String> exportRts) throws Exception;
 
     /**
      *
      * @param rd
      */
-    void deleteVrf(String rd) throws Exception;
+    public void deleteVrf(String rd) throws Exception;
 
     /**
+     * Adds one or more routes, as many as nexthops provided, in a BGP neighbour. It persists VrfEntry in datastore
+     * and sends the BGP message
+     *
+     * @param rd
+     * @param prefix
+     * @param nextHopList
+     * @param vpnLabel
+     */
+    public void addPrefix(String rd, String prefix, List<String> nextHopList, int vpnLabel, RouteOrigin origin) throws Exception;
+
+    /**
+     * Adds a route in a BGP neighbour. It persists the VrfEntry in Datastore and sends the BGP message
      *
      * @param rd
      * @param prefix
      * @param nextHop
      * @param vpnLabel
      */
-    void addPrefix(String rd, String prefix, String nextHop, int vpnLabel) throws Exception;
+    public void addPrefix(String rd, String prefix, String nextHop, int vpnLabel, RouteOrigin origin) throws Exception;
+
 
     /**
      *
      * @param rd
      * @param prefix
      */
-    void deletePrefix(String rd, String prefix) throws Exception;
+    public void deletePrefix(String rd, String prefix) throws Exception;
 
     /**
      *
      * @param fileName
      * @param logLevel
      */
-    void setQbgpLog(String fileName, String logLevel) throws Exception;
+    public void setQbgpLog(String fileName, String logLevel) throws Exception;
 
     /**
+     * Advertises a Prefix to a BGP neighbour, using several nexthops. Only sends the BGP messages, no writing to
+     * MD-SAL
+     *
      * @param rd
      * @param prefix
-     * @param nextHop
+     * @param nextHopList
+     * @param vpnLabel
+     */
+    public void advertisePrefix(String rd, String prefix, List<String> nextHopList, int vpnLabel) throws Exception;
+
+    /**
+     * Advertises a Prefix to a BGP neighbour. Only sends the BGP messages, no writing to MD-SAL
+     *
+     * @param rd
+     * @param prefix
+     * @param nextHopList
      * @param vpnLabel
      */
-    void advertisePrefix(String rd, String prefix, String nextHop, int vpnLabel) throws Exception;
+    public void advertisePrefix(String rd, String prefix, String nextHop, int vpnLabel) throws Exception;
 
     /**
      *
      * @param rd
      * @param prefix
      */
-    void withdrawPrefix(String rd, String prefix) throws Exception;
+    public void withdrawPrefix(String rd, String prefix) throws Exception;
 
 
-    String getDCGwIP();
+    public String getDCGwIP();
 
 }
diff --git a/vpnservice/bgpmanager/bgpmanager-api/src/main/java/org.opendaylight.netvirt.bgpmanager.api/RouteOrigin.java b/vpnservice/bgpmanager/bgpmanager-api/src/main/java/org.opendaylight.netvirt.bgpmanager.api/RouteOrigin.java
new file mode 100644 (file)
index 0000000..e0d068f
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.netvirt.bgpmanager.api;
+
+  /* Usage:
+   * RouteOrigin origin = RouteOrigin.value("b");
+   * RouteOrigin origin = RouteOrigin.BGP;
+   */
+
+public enum RouteOrigin {
+    UNDEFINED("undefined",          "-"),
+    CONNECTED("directly connected", "c"),
+    STATIC(   "static",             "s"),
+    INTERVPN( "inter-vpn link",     "l"),
+    BGP(      "bgp",                "b"),
+    IGP(      "igp",                "i");
+
+
+    final String description;
+    final String value;
+
+    RouteOrigin(String description, String value) {
+        this.description = description;
+        this.value = value;
+    }
+
+
+    public static RouteOrigin value(String value) {
+        RouteOrigin origin = UNDEFINED;
+        switch (value) {
+            case "c":
+                origin = CONNECTED;
+                break;
+            case "s":
+                origin = STATIC;
+                break;
+            case "l":
+                origin = INTERVPN;
+                break;
+            case "b":
+                origin = BGP;
+                break;
+            case "i":
+                origin = IGP;
+                break;
+        }
+
+        return origin;
+    }
+
+    public String getValue(){
+        return value;
+    }
+
+    public String getDescription(){
+        return description;
+    }
+
+}
\ No newline at end of file
index c7c85eb16d801e0c684c10838de0914158a26f62..cd2e3c5f67a37fbfb7d4484c550738366b9b32f2 100644 (file)
@@ -52,6 +52,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <artifactId>vpnmanager-api</artifactId>
       <version>${vpnservices.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.genius</groupId>
+      <artifactId>itm-api</artifactId>
+      <version>${genius.version}</version>
+    </dependency>
 
     <!--Dependencies for Unit Test -->
     <dependency>
index d1a5ce52796718936f0cad8fc10895e3d428bf01..e79e1239285294a6418885e1408a3122595b61ab 100644 (file)
@@ -9,9 +9,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 -->
 <snapshot>
   <required-capabilities>
-      <capability>urn:opendaylight:params:xml:ns:yang:bgpmanager:api?module=bgpmanager-api&amp;revision=2015-04-20</capability>
-      <capability>urn:opendaylight:params:xml:ns:yang:bgpmanager:impl?module=bgpmanager-impl&amp;revision=2015-03-26</capability>
-      <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
+    <capability>urn:opendaylight:params:xml:ns:yang:bgpmanager:impl?module=bgpmanager-impl&amp;revision=2015-03-26</capability>
+    <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
+    <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl?module=opendaylight-sal-binding-broker-impl&amp;revision=2013-10-28</capability>
+    <capability>urn:opendaylight:params:xml:ns:yang:controller:config:distributed-entity-ownership-service?module=distributed-entity-ownership-service&amp;revision=2015-08-10</capability>
   </required-capabilities>
   <configuration>
 
@@ -24,6 +25,36 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
             <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
             <name>binding-osgi-broker</name>
           </broker>
+          <rpcregistry>
+            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
+            <name>binding-rpc-broker</name>
+          </rpcregistry>
+          <notification-service>
+            <type xmlns:bindingimpl="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">bindingimpl:binding-new-notification-service</type>
+            <name>binding-notification-adapter</name>
+          </notification-service>
+          <entity-ownership-service>
+            <type xmlns:entity-ownership="urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:entity-ownership-service">entity-ownership:entity-ownership-service</type>
+            <name>entity-ownership-service</name>
+          </entity-ownership-service>
+          <binding-normalized-node-serializer>
+            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-normalized-node-serializer</type>
+            <name>runtime-mapping-singleton</name>
+          </binding-normalized-node-serializer>
+          <!--
+                      <broker>
+                      <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
+                      <name>binding-osgi-broker</name>
+                    </broker>
+                    <entity-ownership-service>
+                      <type xmlns:entity-ownership="urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:entity-ownership-service">entity-ownership:entity-ownership-service</type>
+                      <name>entity-ownership-service</name>
+                    </entity-ownership-service>
+
+                      <itm>
+                        <type xmlns:itm="urn:opendaylight:vpnservice:itm">itm:itm</type>
+                        <name>itm</name>
+                      </itm> -->
         </module>
       </modules>
       <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
index a8b7982d4bb2164009eb2daee9c11dfa4cda3649..95458ebf81af9b10f4e1df8138d4650ec8048673 100644 (file)
@@ -10,33 +10,28 @@ package org.opendaylight.netvirt.bgpmanager;
 
 import com.google.common.base.Optional;
 
+import java.io.*;
 import java.util.*;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStreamReader;
 import java.lang.reflect.*;
 import java.net.InetAddress;
 import java.net.NetworkInterface;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
 
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import org.opendaylight.netvirt.bgpmanager.api.RouteOrigin;
 import org.opendaylight.netvirt.bgpmanager.commands.ClearBgpCli;
+import org.opendaylight.netvirt.bgpmanager.thrift.gen.*;
+import org.opendaylight.netvirt.bgpmanager.thrift.client.*;
+import org.opendaylight.netvirt.bgpmanager.thrift.server.*;
+import org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
+import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipChange;
+import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListener;
+import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.netvirt.bgpmanager.thrift.client.BgpRouter;
-import org.opendaylight.netvirt.bgpmanager.thrift.client.BgpRouterException;
-import org.opendaylight.netvirt.bgpmanager.thrift.client.BgpSyncHandle;
-import org.opendaylight.netvirt.bgpmanager.thrift.gen.Routes;
-import org.opendaylight.netvirt.bgpmanager.thrift.gen.Update;
-import org.opendaylight.netvirt.bgpmanager.thrift.gen.af_afi;
-import org.opendaylight.netvirt.bgpmanager.thrift.gen.af_safi;
-import org.opendaylight.netvirt.bgpmanager.thrift.gen.qbgpConstants;
-import org.opendaylight.netvirt.bgpmanager.thrift.server.BgpThriftService;
+import org.opendaylight.genius.datastoreutils.AsyncDataTreeChangeListenerBase;
+import org.opendaylight.genius.utils.clustering.EntityOwnerUtils;
 import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.*;
 import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.*;
 import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighbors.*;
@@ -55,10 +50,9 @@ import org.slf4j.LoggerFactory;
 
 public class BgpConfigurationManager {
     private static final Logger LOG =
-    LoggerFactory.getLogger(BgpConfigurationManager.class);
+            LoggerFactory.getLogger(BgpConfigurationManager.class);
     private static DataBroker broker;
     private static FibDSWriter fib;
-    private boolean restarting = false;
     private static Bgp config;
     private static BgpRouter bgpRouter;
     private static BgpThriftService updateServer;
@@ -68,44 +62,99 @@ public class BgpConfigurationManager {
     private static final String UPDATE_PORT = "bgp.thrift.service.port";
     private static final String CONFIG_HOST = "vpnservice.bgpspeaker.host.name";
     private static final String CONFIG_PORT = "vpnservice.bgpspeaker.thrift.port";
-    private static final String DEF_UPORT = "7744";
+    private static final String DEF_UPORT = "6644";
     private static final String DEF_CHOST = "127.0.0.1";
     private static final String DEF_CPORT = "7644";
     private static final String SDNC_BGP_MIP = "sdnc_bgp_mip";
     private static final String CLUSTER_CONF_FILE = "/cluster/etc/cluster.conf";
     private static final Timer ipActivationCheckTimer = new Timer();
+    private static final int STALE_FIB_WAIT = 60;
+    private static final int RESTART_DEFAULT_GR = 90;
+    private long StaleStartTime = 0;
+    private long StaleEndTime = 0;
+    private long CfgReplayStartTime = 0;
+    private long CfgReplayEndTime = 0;
+    private long StaleCleanupTime = 0;
+
+    public long getStaleCleanupTime() {
+        return StaleCleanupTime;
+    }
+
+    public void setStaleCleanupTime(long staleCleanupTime) {
+        StaleCleanupTime = staleCleanupTime;
+    }
+
+    public long getCfgReplayEndTime() {
+        return CfgReplayEndTime;
+    }
+
+    public void setCfgReplayEndTime(long cfgReplayEndTime) {
+        CfgReplayEndTime = cfgReplayEndTime;
+    }
+
+    public long getCfgReplayStartTime() {
+        return CfgReplayStartTime;
+    }
+
+    public void setCfgReplayStartTime(long cfgReplayStartTime) {
+        CfgReplayStartTime = cfgReplayStartTime;
+    }
+
+    public long getStaleEndTime() {
+        return StaleEndTime;
+    }
+
+    public void setStaleEndTime(long staleEndTime) {
+        StaleEndTime = staleEndTime;
+    }
+
+    public long getStaleStartTime() {
+        return StaleStartTime;
+    }
+
+    public void setStaleStartTime(long staleStartTime) {
+        StaleStartTime = staleStartTime;
+    }
+
 
     // to have stale FIB map (RD, Prefix)
     //  number of seconds wait for route sync-up between ODL and BGP.
     private static final int BGP_RESTART_ROUTE_SYNC_SEC = 360;
 
     static String odlThriftIp = "127.0.0.1";
-    private static String cHostStartup; 
-    private static String cPortStartup; 
+    private static String cHostStartup;
+    private static String cPortStartup;
     private static CountDownLatch initer = new CountDownLatch(1);
     //static IITMProvider itmProvider;
     public static BgpManager bgpManager;
     //map<rd, map<prefix/len, nexthop/label>>
     private static Map<String, Map<String, String>> staledFibEntriesMap = new ConcurrentHashMap<>();
 
-    private static final Class[] reactors =  
-    {
-        ConfigServerReactor.class, AsIdReactor.class,
-        GracefulRestartReactor.class, LoggingReactor.class,
-        NeighborsReactor.class, UpdateSourceReactor.class,
-        EbgpMultihopReactor.class, AddressFamiliesReactor.class,
-        NetworksReactor.class, VrfsReactor.class, BgpReactor.class
-    };
-    
+    static final String BGP_ENTITY_TYPE_FOR_OWNERSHIP = "bgp";
+    static final String BGP_ENTITY_NAME = "bgp";
+
+    static int totalStaledCount = 0;
+    static int totalCleared = 0;
+
+    private static final Class[] reactors =
+            {
+                    ConfigServerReactor.class, AsIdReactor.class,
+                    GracefulRestartReactor.class, LoggingReactor.class,
+                    NeighborsReactor.class, UpdateSourceReactor.class,
+                    EbgpMultihopReactor.class, AddressFamiliesReactor.class,
+                    NetworksReactor.class, VrfsReactor.class, BgpReactor.class
+            };
+
     private ListenerRegistration<DataChangeListener>[] registrations;
+    EntityOwnershipService entityOwnershipService;
 
     private Object createListener(Class<?> cls) {
         Constructor<?> ctor;
         Object obj = null;
 
         try {
-            ctor= cls.getConstructor(BgpConfigurationManager.class);
-            obj =  ctor.newInstance(this);
+            ctor = cls.getConstructor(BgpConfigurationManager.class);
+            obj = ctor.newInstance(this);
         } catch (Exception e) {
             LOG.error("Failed to create listener object", e);
         }
@@ -114,20 +163,17 @@ public class BgpConfigurationManager {
 
     private void registerCallbacks() {
         String emsg = "Failed to register listener";
-        registrations = (ListenerRegistration<DataChangeListener>[])
-        new ListenerRegistration[reactors.length];
+        registrations = new ListenerRegistration[reactors.length];
         InstanceIdentifier<?> iid = InstanceIdentifier.create(Bgp.class);
-        for (int i = 0; i < reactors.length; i++) {
-            DataChangeListener dcl = 
-            (DataChangeListener) createListener(reactors[i]);
-            String dclName = dcl.getClass().getName();
+        for (Class reactor : reactors) {
+            Object obj = createListener(reactor);
+            String dclName = obj.getClass().getName();
             try {
-                registrations[i] =  broker.registerDataChangeListener(
-                                      LogicalDatastoreType.CONFIGURATION,
-                                      iid, dcl, DataChangeScope.SUBTREE);
+                AsyncDataTreeChangeListenerBase dcl = (AsyncDataTreeChangeListenerBase) obj;
+                dcl.registerListener(LogicalDatastoreType.CONFIGURATION, broker);
             } catch (Exception e) {
                 LOG.error(emsg, e);
-                throw new IllegalStateException(emsg+" "+dclName, e);
+                throw new IllegalStateException(emsg + " " + dclName, e);
             }
         }
     }
@@ -135,15 +181,15 @@ public class BgpConfigurationManager {
     public void close() {
         if (updateServer != null) {
             updateServer.stop();
-        } 
+        }
     }
 
-    private boolean configExists() {
+    private boolean configExists() throws InterruptedException, ExecutionException, TimeoutException {
         InstanceIdentifier.InstanceIdentifierBuilder<Bgp> iib =
-        InstanceIdentifier.builder(Bgp.class);
+                InstanceIdentifier.builder(Bgp.class);
         InstanceIdentifier<Bgp> iid = iib.build();
-        Optional<Bgp> b = BgpUtil.read(broker, 
-        LogicalDatastoreType.CONFIGURATION, iid);
+        Optional<Bgp> b = BgpUtil.read(broker,
+                LogicalDatastoreType.CONFIGURATION, iid);
         return b.isPresent();
     }
 
@@ -160,197 +206,267 @@ public class BgpConfigurationManager {
         return (s == null ? def : s);
     }
 
-    public BgpConfigurationManager(BgpManager bgpMgr) {
+    static BgpConfigurationManager bgpConfigurationManager;
+
+    public BgpConfigurationManager(BgpManager bgpMgr) throws InterruptedException, ExecutionException, TimeoutException {
         broker = bgpMgr.getBroker();
         fib = bgpMgr.getFibWriter();
-        //itmProvider = bgpMgr.getItmProvider();
-        // there must be a good way to detect that we're restarting.
-        // but for now infer it from the existance of config
-        restarting = configExists();
+
         bgpManager = bgpMgr;
         bgpRouter = BgpRouter.getInstance();
-        String uPort = getProperty(UPDATE_PORT, DEF_UPORT); 
+        String uPort = getProperty(UPDATE_PORT, DEF_UPORT);
         cHostStartup = getProperty(CONFIG_HOST, DEF_CHOST);
         cPortStartup = getProperty(CONFIG_PORT, DEF_CPORT);
         VtyshCli.setHostAddr(cHostStartup);
         ClearBgpCli.setHostAddr(cHostStartup);
-        LOG.info("UpdateServer at localhost:"+uPort+" ConfigServer at "
-                 +cHostStartup+":"+cPortStartup);
+        LOG.info("UpdateServer at localhost:" + uPort + " ConfigServer at "
+                + cHostStartup + ":" + cPortStartup);
         updateServer = new BgpThriftService(Integer.parseInt(uPort), bgpMgr);
         updateServer.start();
         readOdlThriftIpForBgpCommunication();
         registerCallbacks();
 
-        // this shouldn't be done. config client must connect in 
-        // response to config; but connecting at startup to a default
-        // host is legacy behavior. 
-        if (!restarting) {
-            bgpRouter.connect(cHostStartup, Integer.parseInt(cPortStartup)); 
-        }
         LOG.info("BGP Configuration manager initialized");
         initer.countDown();
+
+        bgpConfigurationManager = this;
+    }
+
+    boolean ignoreClusterDcnEventForFollower() {
+        return !EntityOwnerUtils.amIEntityOwner(BGP_ENTITY_TYPE_FOR_OWNERSHIP, BGP_ENTITY_NAME);
     }
 
     public Bgp get() {
+        config = bgpManager.getConfig();
         return config;
     }
 
-    private static final String addWarn = 
-              "Config store updated; undo with Delete if needed.";
-    private static final String delWarn = 
-              "Config store updated; undo with Add if needed.";
+    public void setEntityOwnershipService(EntityOwnershipService entityOwnershipService) {
+        this.entityOwnershipService = entityOwnershipService;
+        try {
+            EntityOwnerUtils.registerEntityCandidateForOwnerShip(entityOwnershipService,
+                    BGP_ENTITY_TYPE_FOR_OWNERSHIP, BGP_ENTITY_NAME, new EntityOwnershipListener() {
+                @Override
+                public void ownershipChanged(EntityOwnershipChange ownershipChange) {
+                    LOG.trace("entity owner change event fired");
+                    if (ownershipChange.hasOwner() && ownershipChange.isOwner()) {
+                        LOG.trace("This PL is the Owner");
+                        activateMIP();
+                        bgpRestarted();
+                    } else {
+                        LOG.error("Not owner: hasOwner: {}, isOwner: {}",ownershipChange.hasOwner(),
+                                ownershipChange.isOwner() );
+                    }
+                }
+            });
+        } catch (Exception e) {
+            LOG.error("failed to register bgp entity", e);
+        }
+    }
+
+    public EntityOwnershipService getEntityOwnershipService() {
+        return entityOwnershipService;
+    }
+
+    private static final String addWarn =
+            "Config store updated; undo with Delete if needed.";
+    private static final String delWarn =
+            "Config store updated; undo with Add if needed.";
     private static final String updWarn =
-              "Update operation not supported; Config store updated;"
-               +" restore with another Update if needed.";
+            "Update operation not supported; Config store updated;"
+                    + " restore with another Update if needed.";
 
-    public class ConfigServerReactor 
-    extends AbstractDataChangeListener<ConfigServer> 
-    implements AutoCloseable {
+    public class ConfigServerReactor
+            extends AsyncDataTreeChangeListenerBase<ConfigServer, ConfigServerReactor>
+            implements AutoCloseable, ClusteredDataTreeChangeListener <ConfigServer> {
         private static final String yangObj = "config-server ";
+
         public ConfigServerReactor() {
-            super(ConfigServer.class);
+            super(ConfigServer.class, ConfigServerReactor.class);
         }
 
-        protected synchronized void 
+        protected synchronized void
         add(InstanceIdentifier<ConfigServer> iid, ConfigServer val) {
-            LOG.debug("received bgp connect config host {}", val.getHost().getValue());
+            LOG.trace("received bgp connect config host {}", val.getHost().getValue());
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
+
             try {
                 initer.await();
             } catch (Exception e) {
             }
             LOG.debug("issueing bgp router connect to host {}", val.getHost().getValue());
-            synchronized(BgpConfigurationManager.this) {
-                boolean res = bgpRouter.connect(val.getHost().getValue(), 
-                                                val.getPort().intValue());
+            synchronized (BgpConfigurationManager.this) {
+                boolean res = bgpRouter.connect(val.getHost().getValue(),
+                        val.getPort().intValue());
                 if (!res) {
-                    LOG.error(yangObj + "Add failed; "+addWarn);
+                    LOG.error(yangObj + "Add failed; " + addWarn);
                 }
             }
         }
 
-        protected synchronized void 
+        @Override
+        protected ConfigServerReactor getDataTreeChangeListener() {
+            return ConfigServerReactor.this;
+        }
+
+        @Override
+        protected InstanceIdentifier<ConfigServer> getWildCardPath() {
+            return InstanceIdentifier.create(Bgp.class).child(ConfigServer.class);
+        }
+
+        protected synchronized void
         remove(InstanceIdentifier<ConfigServer> iid, ConfigServer val) {
-            LOG.debug("received bgp disconnect");
-            synchronized(BgpConfigurationManager.this) {
+            LOG.trace("received bgp disconnect");
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
+            synchronized (BgpConfigurationManager.this) {
                 bgpRouter.disconnect();
             }
         }
-                          
+
         protected void update(InstanceIdentifier<ConfigServer> iid,
                               ConfigServer oldval, ConfigServer newval) {
+            LOG.trace("received bgp Connection update");
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.error(yangObj + updWarn);
         }
 
+        @Override
         public void close() {
-            int i;
-            for (i=0 ; i < reactors.length ; i++) {
-                if (reactors[i] == ConfigServerReactor.class) {
-                    break;
-                }
+            try {
+                super.close();
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-            registrations[i].close();
         }
     }
 
     private BgpRouter getClient(String yangObj) {
         if (bgpRouter == null) {
-            LOG.warn(yangObj+": configuration received when BGP is inactive");
+            LOG.warn(yangObj + ": configuration received when BGP is inactive");
         }
         return bgpRouter;
-    } 
+    }
 
-    public class AsIdReactor 
-    extends AbstractDataChangeListener<AsId> 
-    implements AutoCloseable {
+    public class AsIdReactor
+            extends AsyncDataTreeChangeListenerBase<AsId, AsIdReactor>
+            implements AutoCloseable, ClusteredDataTreeChangeListener<AsId> {
 
         private static final String yangObj = "as-id ";
 
         public AsIdReactor() {
-            super(AsId.class);
+            super(AsId.class, AsIdReactor.class);
         }
 
-        protected synchronized void 
+        protected synchronized void
         add(InstanceIdentifier<AsId> iid, AsId val) {
+            LOG.error("received bgp add asid");
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received add router config asNum {}", val.getLocalAs().intValue());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
+                    LOG.error("no bgp router client found exiting asid add");
                     return;
                 }
                 int asNum = val.getLocalAs().intValue();
                 Ipv4Address routerId = val.getRouterId();
-                Long spt = val.getStalepathTime();
                 Boolean afb = val.isAnnounceFbit();
                 String rid = (routerId == null) ? "" : routerId.getValue();
-                int stalepathTime = (spt == null) ? 90 : spt.intValue(); 
-                boolean announceFbit = afb != null && afb.booleanValue();
+                int stalepathTime = (int) getStalePathtime(RESTART_DEFAULT_GR, val);
+                boolean announceFbit = (afb == null) ? false : afb.booleanValue();
                 try {
-                    br.startBgp(asNum, rid, stalepathTime, announceFbit); 
+                    br.startBgp(asNum, rid, stalepathTime, announceFbit);
                     if (bgpManager.getBgpCounters() == null) {
                         bgpManager.startBgpCountersTask();
                     }
                 } catch (BgpRouterException bre) {
                     if (bre.getErrorCode() == BgpRouterException.BGP_ERR_ACTIVE) {
-                        LOG.error(yangObj+"Add requested when BGP is already active");
+                        LOG.error(yangObj + "Add requested when BGP is already active");
                     } else {
-                        LOG.error(yangObj+"Add received exception: \"" 
-                                  +bre+"\"; "+addWarn);
+                        LOG.error(yangObj + "Add received exception: \""
+                                + bre + "\"; " + addWarn);
                     }
                 } catch (Exception e) {
-                    LOG.error(yangObj+"Add received exception: \""+e+"\"; "+addWarn);
+                    LOG.error(yangObj + "Add received exception: \"" + e + "\"; " + addWarn);
                 }
             }
-        } 
+        }
+
+        @Override
+        protected AsIdReactor getDataTreeChangeListener() {
+            return AsIdReactor.this;
+        }
+
+        @Override
+        protected InstanceIdentifier<AsId> getWildCardPath() {
+            return InstanceIdentifier.create(Bgp.class).child(AsId.class);
+        }
 
-        protected synchronized void 
+        protected synchronized void
         remove(InstanceIdentifier<AsId> iid, AsId val) {
-            LOG.debug("received delete router config asNum {}", val.getLocalAs().intValue());
-            synchronized(BgpConfigurationManager.this) {
+            LOG.error("received delete router config asNum {}", val.getLocalAs().intValue());
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
                 }
-                int asNum = val.getLocalAs().intValue(); 
+                int asNum = val.getLocalAs().intValue();
                 try {
                     br.stopBgp(asNum);
                 } catch (Exception e) {
-                    LOG.error(yangObj+" Delete received exception:  \""+e+"\"; "+delWarn);
+                    LOG.error(yangObj + " Delete received exception:  \"" + e + "\"; " + delWarn);
                 }
                 if (bgpManager.getBgpCounters() != null) {
                     bgpManager.stopBgpCountersTask();
                 }
             }
         }
-                          
+
         protected void update(InstanceIdentifier<AsId> iid,
                               AsId oldval, AsId newval) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.error(yangObj + updWarn);
         }
 
+        @Override
         public void close() {
-            int i;
-            for (i=0 ; i < reactors.length ; i++) {
-                if (reactors[i] == AsIdReactor.class) {
-                    break;
-                }
+            try {
+                super.close();
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-            registrations[i].close();
         }
     }
 
-    public class GracefulRestartReactor 
-    extends AbstractDataChangeListener<GracefulRestart> 
-    implements AutoCloseable {
+    public class GracefulRestartReactor
+            extends AsyncDataTreeChangeListenerBase<GracefulRestart, GracefulRestartReactor>
+            implements AutoCloseable, ClusteredDataTreeChangeListener<GracefulRestart> {
 
         private static final String yangObj = "graceful-restart ";
 
         public GracefulRestartReactor() {
-            super(GracefulRestart.class);
+            super(GracefulRestart.class, GracefulRestartReactor.class);
         }
 
         protected synchronized void
         add(InstanceIdentifier<GracefulRestart> iid, GracefulRestart val) {
-            synchronized(BgpConfigurationManager.this) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -358,15 +474,28 @@ public class BgpConfigurationManager {
                 try {
                     br.addGracefulRestart(val.getStalepathTime().intValue());
                 } catch (Exception e) {
-                    LOG.error(yangObj+"Add received exception: \""+e+"\"; "+addWarn);
+                    LOG.error(yangObj + "Add received exception: \"" + e + "\"; " + addWarn);
                 }
             }
         }
 
-        protected synchronized void 
+        @Override
+        protected GracefulRestartReactor getDataTreeChangeListener() {
+            return GracefulRestartReactor.this;
+        }
+
+        @Override
+        protected InstanceIdentifier<GracefulRestart> getWildCardPath() {
+            return InstanceIdentifier.create(Bgp.class).child(GracefulRestart.class);
+        }
+
+        protected synchronized void
         remove(InstanceIdentifier<GracefulRestart> iid, GracefulRestart val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received delete GracefulRestart config val {}", val.getStalepathTime().intValue());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -374,16 +503,19 @@ public class BgpConfigurationManager {
                 try {
                     br.delGracefulRestart();
                 } catch (Exception e) {
-                    LOG.error(yangObj+" Delete received exception:  \""+e+"\"; "
-                              +delWarn);
+                    LOG.error(yangObj + " Delete received exception:  \"" + e + "\"; "
+                            delWarn);
                 }
             }
         }
-                          
+
         protected void update(InstanceIdentifier<GracefulRestart> iid,
                               GracefulRestart oldval, GracefulRestart newval) {
-               LOG.debug("received update GracefulRestart config val {}", newval.getStalepathTime().intValue());
-            synchronized(BgpConfigurationManager.this) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
+            LOG.debug("received update GracefulRestart config val {}", newval.getStalepathTime().intValue());
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -391,52 +523,67 @@ public class BgpConfigurationManager {
                 try {
                     br.addGracefulRestart(newval.getStalepathTime().intValue());
                 } catch (Exception e) {
-                    LOG.error(yangObj+"update received exception: \""+e+"\"; "+addWarn);
+                    LOG.error(yangObj + "update received exception: \"" + e + "\"; " + addWarn);
                 }
             }
         }
 
+        @Override
         public void close() {
-            int i;
-            for (i=0 ; i < reactors.length ; i++) {
-                if (reactors[i] == GracefulRestartReactor.class) {
-                    break;
-                }
+            try {
+                super.close();
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-            registrations[i].close();
         }
     }
 
-    public class LoggingReactor 
-    extends AbstractDataChangeListener<Logging> 
-    implements AutoCloseable {
+    public class LoggingReactor
+            extends AsyncDataTreeChangeListenerBase<Logging, LoggingReactor>
+            implements AutoCloseable, ClusteredDataTreeChangeListener<Logging> {
 
         private static final String yangObj = "logging ";
 
         public LoggingReactor() {
-            super(Logging.class);
+            super(Logging.class, LoggingReactor.class);
         }
 
         protected synchronized void
         add(InstanceIdentifier<Logging> iid, Logging val) {
-            synchronized(BgpConfigurationManager.this) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
                 }
                 try {
-                    br.setLogging(val.getFile(),val.getLevel());
+                    br.setLogging(val.getFile(), val.getLevel());
                 } catch (Exception e) {
-                    LOG.error(yangObj+"Add received exception: \""+e+"\"; "
-                              +addWarn);
+                    LOG.error(yangObj + "Add received exception: \"" + e + "\"; "
+                            addWarn);
                 }
             }
         }
 
-        protected synchronized void 
+        @Override
+        protected LoggingReactor getDataTreeChangeListener() {
+            return LoggingReactor.this;
+        }
+
+        @Override
+        protected InstanceIdentifier<Logging> getWildCardPath() {
+            return InstanceIdentifier.create(Bgp.class).child(Logging.class);
+        }
+
+        protected synchronized void
         remove(InstanceIdentifier<Logging> iid, Logging val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received remove Logging config val {}", val.getLevel());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -444,53 +591,58 @@ public class BgpConfigurationManager {
                 try {
                     br.setLogging(DEF_LOGFILE, DEF_LOGLEVEL);
                 } catch (Exception e) {
-                    LOG.error(yangObj+" Delete received exception:  \""+e+"\"; "
-                              +delWarn);
+                    LOG.error(yangObj + " Delete received exception:  \"" + e + "\"; "
+                            delWarn);
                 }
             }
         }
-                          
+
         protected void update(InstanceIdentifier<Logging> iid,
                               Logging oldval, Logging newval) {
-            synchronized(BgpConfigurationManager.this) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
                 }
                 try {
-                    br.setLogging(newval.getFile(),newval.getLevel());
+                    br.setLogging(newval.getFile(), newval.getLevel());
                 } catch (Exception e) {
-                    LOG.error(yangObj+"newval received exception: \""+e+"\"; "
-                              +addWarn);
+                    LOG.error(yangObj + "newval received exception: \"" + e + "\"; "
+                            addWarn);
                 }
             }
         }
 
+        @Override
         public void close() {
-            int i;
-            for (i=0 ; i < reactors.length ; i++) {
-                if (reactors[i] == LoggingReactor.class) {
-                    break;
-                }
+            try {
+                super.close();
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-            registrations[i].close();
         }
     }
 
-    public class NeighborsReactor 
-    extends AbstractDataChangeListener<Neighbors> 
-    implements AutoCloseable {
+    public class NeighborsReactor
+            extends AsyncDataTreeChangeListenerBase<Neighbors, NeighborsReactor>
+            implements AutoCloseable, ClusteredDataTreeChangeListener<Neighbors> {
 
         private static final String yangObj = "neighbors ";
 
         public NeighborsReactor() {
-            super(Neighbors.class);
+            super(Neighbors.class, NeighborsReactor.class);
         }
 
-        protected synchronized void 
+        protected synchronized void
         add(InstanceIdentifier<Neighbors> iid, Neighbors val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received add Neighbors config val {}", val.getAddress().getValue());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -500,18 +652,31 @@ public class BgpConfigurationManager {
                 try {
                     //itmProvider.buildTunnelsToDCGW(new IpAddress(peerIp.toCharArray()));
                     br.addNeighbor(peerIp, as);
-            
+
                 } catch (Exception e) {
-                    LOG.error(yangObj+"Add received exception: \""+e+"\"; "
-                              +addWarn);
+                    LOG.error(yangObj + "Add received exception: \"" + e + "\"; "
+                            addWarn);
                 }
             }
         }
 
-        protected synchronized void 
+        @Override
+        protected NeighborsReactor getDataTreeChangeListener() {
+            return NeighborsReactor.this;
+        }
+
+        @Override
+        protected InstanceIdentifier<Neighbors> getWildCardPath() {
+            return InstanceIdentifier.create(Bgp.class).child(Neighbors.class);
+        }
+
+        protected synchronized void
         remove(InstanceIdentifier<Neighbors> iid, Neighbors val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received remove Neighbors config val {}", val.getAddress().getValue());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -521,60 +686,78 @@ public class BgpConfigurationManager {
                     //itmProvider.deleteTunnelsToDCGW(new IpAddress(val.getAddress().getValue().toCharArray()));
                     br.delNeighbor(peerIp);
                 } catch (Exception e) {
-                    LOG.error(yangObj+" Delete received exception:  \""+e+"\"; "
-                              +delWarn);
+                    LOG.error(yangObj + " Delete received exception:  \"" + e + "\"; "
+                            delWarn);
                 }
             }
         }
-                          
+
         protected void update(InstanceIdentifier<Neighbors> iid,
                               Neighbors oldval, Neighbors newval) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             //purposefully nothing to do.
         }
 
+        @Override
         public void close() {
-            int i;
-            for (i=0 ; i < reactors.length ; i++) {
-                if (reactors[i] == NeighborsReactor.class) {
-                    break;
-                }
+            try {
+                super.close();
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-            registrations[i].close();
         }
     }
 
-    public class EbgpMultihopReactor 
-    extends AbstractDataChangeListener<EbgpMultihop> 
-    implements AutoCloseable {
+    public class EbgpMultihopReactor
+            extends AsyncDataTreeChangeListenerBase<EbgpMultihop, EbgpMultihopReactor>
+            implements AutoCloseable, ClusteredDataTreeChangeListener<EbgpMultihop> {
 
         private static final String yangObj = "ebgp-multihop ";
 
         public EbgpMultihopReactor() {
-            super(EbgpMultihop.class);
+            super(EbgpMultihop.class, EbgpMultihopReactor.class);
         }
 
-        protected synchronized void 
+        protected synchronized void
         add(InstanceIdentifier<EbgpMultihop> iid, EbgpMultihop val) {
-            LOG.debug("received add EbgpMultihop config val {}", val.getPeerIp().getValue());  
-            synchronized(BgpConfigurationManager.this) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
+            LOG.debug("received add EbgpMultihop config val {}", val.getPeerIp().getValue());
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
                 }
                 String peerIp = val.getPeerIp().getValue();
                 try {
-                    br.addEbgpMultihop(peerIp, val.getNhops().intValue()); 
+                    br.addEbgpMultihop(peerIp, val.getNhops().intValue());
                 } catch (Exception e) {
-                    LOG.error(yangObj+"Add received exception: \""+e+"\"; "
-                              +addWarn);
+                    LOG.error(yangObj + "Add received exception: \"" + e + "\"; "
+                            addWarn);
                 }
             }
         }
 
-        protected synchronized void 
+        @Override
+        protected EbgpMultihopReactor getDataTreeChangeListener() {
+            return EbgpMultihopReactor.this;
+        }
+
+        @Override
+        protected InstanceIdentifier<EbgpMultihop> getWildCardPath() {
+            return InstanceIdentifier.create(Bgp.class).child(Neighbors.class).child(EbgpMultihop.class);
+        }
+
+        protected synchronized void
         remove(InstanceIdentifier<EbgpMultihop> iid, EbgpMultihop val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received remove EbgpMultihop config val {}", val.getPeerIp().getValue());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -583,60 +766,78 @@ public class BgpConfigurationManager {
                 try {
                     br.delEbgpMultihop(peerIp);
                 } catch (Exception e) {
-                    LOG.error(yangObj+" Delete received exception:  \""+e+"\"; "
-                              +delWarn);
+                    LOG.error(yangObj + " Delete received exception:  \"" + e + "\"; "
+                            delWarn);
                 }
             }
         }
-                          
+
         protected void update(InstanceIdentifier<EbgpMultihop> iid,
                               EbgpMultihop oldval, EbgpMultihop newval) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.error(yangObj + updWarn);
         }
 
+        @Override
         public void close() {
-            int i;
-            for (i=0 ; i < reactors.length ; i++) {
-                if (reactors[i] == EbgpMultihopReactor.class) {
-                    break;
-                }
+            try {
+                super.close();
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-            registrations[i].close();
         }
     }
 
-    public class UpdateSourceReactor 
-    extends AbstractDataChangeListener<UpdateSource> 
-    implements AutoCloseable {
+    public class UpdateSourceReactor
+            extends AsyncDataTreeChangeListenerBase<UpdateSource, UpdateSourceReactor>
+            implements AutoCloseable, ClusteredDataTreeChangeListener<UpdateSource> {
 
         private static final String yangObj = "update-source ";
 
         public UpdateSourceReactor() {
-            super(UpdateSource.class);
+            super(UpdateSource.class, UpdateSourceReactor.class);
         }
 
-        protected synchronized void 
+        protected synchronized void
         add(InstanceIdentifier<UpdateSource> iid, UpdateSource val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received add UpdateSource config val {}", val.getSourceIp().getValue());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
                 }
                 String peerIp = val.getPeerIp().getValue();
                 try {
-                    br.addUpdateSource(peerIp, val.getSourceIp().getValue()); 
+                    br.addUpdateSource(peerIp, val.getSourceIp().getValue());
                 } catch (Exception e) {
-                    LOG.error(yangObj+"Add received exception: \""+e+"\"; "
-                              +addWarn);
+                    LOG.error(yangObj + "Add received exception: \"" + e + "\"; "
+                            addWarn);
                 }
             }
         }
 
-        protected synchronized void 
+        @Override
+        protected UpdateSourceReactor getDataTreeChangeListener() {
+            return UpdateSourceReactor.this;
+        }
+
+        @Override
+        protected InstanceIdentifier<UpdateSource> getWildCardPath() {
+            return InstanceIdentifier.create(Bgp.class).child(Neighbors.class).child(UpdateSource.class);
+        }
+
+        protected synchronized void
         remove(InstanceIdentifier<UpdateSource> iid, UpdateSource val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received remove UpdateSource config val {}", val.getSourceIp().getValue());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -645,42 +846,47 @@ public class BgpConfigurationManager {
                 try {
                     br.delUpdateSource(peerIp);
                 } catch (Exception e) {
-                    LOG.error(yangObj+" Delete received exception:  \""+e+"\"; "
-                              +delWarn);
+                    LOG.error(yangObj + " Delete received exception:  \"" + e + "\"; "
+                            delWarn);
                 }
             }
         }
-                          
+
         protected void update(InstanceIdentifier<UpdateSource> iid,
                               UpdateSource oldval, UpdateSource newval) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.error(yangObj + updWarn);
         }
 
+        @Override
         public void close() {
-            int i;
-            for (i=0 ; i < reactors.length ; i++) {
-                if (reactors[i] == UpdateSourceReactor.class) {
-                    break;
-                }
+            try {
+                super.close();
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-            registrations[i].close();
         }
     }
 
-    public class AddressFamiliesReactor 
-    extends AbstractDataChangeListener<AddressFamilies> 
-    implements AutoCloseable {
+    public class AddressFamiliesReactor
+            extends AsyncDataTreeChangeListenerBase<AddressFamilies, AddressFamiliesReactor>
+            implements AutoCloseable, ClusteredDataTreeChangeListener<AddressFamilies> {
 
         private static final String yangObj = "address-families ";
 
         public AddressFamiliesReactor() {
-            super(AddressFamilies.class);
+            super(AddressFamilies.class, AddressFamiliesReactor.class);
         }
 
-        protected synchronized void 
+        protected synchronized void
         add(InstanceIdentifier<AddressFamilies> iid, AddressFamilies val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received add AddressFamilies config val {}", val.getPeerIp().getValue());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -689,18 +895,31 @@ public class BgpConfigurationManager {
                 af_afi afi = af_afi.findByValue(val.getAfi().intValue());
                 af_safi safi = af_safi.findByValue(val.getSafi().intValue());
                 try {
-                    br.addAddressFamily(peerIp, afi, safi); 
+                    br.addAddressFamily(peerIp, afi, safi);
                 } catch (Exception e) {
-                    LOG.error(yangObj+"Add received exception: \""+e+"\"; "
-                              +addWarn);
+                    LOG.error(yangObj + "Add received exception: \"" + e + "\"; "
+                            addWarn);
                 }
             }
         }
 
-        protected synchronized void 
+        @Override
+        protected AddressFamiliesReactor getDataTreeChangeListener() {
+            return AddressFamiliesReactor.this;
+        }
+
+        @Override
+        protected InstanceIdentifier<AddressFamilies> getWildCardPath() {
+            return InstanceIdentifier.create(Bgp.class).child(Neighbors.class).child(AddressFamilies.class);
+        }
+
+        protected synchronized void
         remove(InstanceIdentifier<AddressFamilies> iid, AddressFamilies val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received remove AddressFamilies config val {}", val.getPeerIp().getValue());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -711,42 +930,51 @@ public class BgpConfigurationManager {
                 try {
                     br.delAddressFamily(peerIp, afi, safi);
                 } catch (Exception e) {
-                    LOG.error(yangObj+" Delete received exception:  \""+e+"\"; "
-                              +delWarn);
+                    LOG.error(yangObj + " Delete received exception:  \"" + e + "\"; "
+                            delWarn);
                 }
             }
         }
-                          
+
         protected void update(InstanceIdentifier<AddressFamilies> iid,
                               AddressFamilies oldval, AddressFamilies newval) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.error(yangObj + updWarn);
         }
 
+        @Override
         public void close() {
-            int i;
-            for (i=0 ; i < reactors.length ; i++) {
-                if (reactors[i] == AddressFamiliesReactor.class) {
-                    break;
-                }
+            try {
+                super.close();
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-            registrations[i].close();
         }
     }
 
-    public class NetworksReactor 
-    extends AbstractDataChangeListener<Networks> 
-    implements AutoCloseable {
+    public class NetworksReactor
+            extends AsyncDataTreeChangeListenerBase<Networks, NetworksReactor>
+            implements AutoCloseable, ClusteredDataTreeChangeListener<Networks> {
 
         private static final String yangObj = "networks ";
 
         public NetworksReactor() {
-            super(Networks.class);
+            super(Networks.class, NetworksReactor.class);
+        }
+        @Override
+        public NetworksReactor getDataTreeChangeListener() {
+            return NetworksReactor.this;
         }
 
-        protected synchronized void 
+        protected synchronized void
         add(InstanceIdentifier<Networks> iid, Networks val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received add Networks config val {}", val.getPrefixLen());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -756,19 +984,27 @@ public class BgpConfigurationManager {
                 String nh = val.getNexthop().getValue();
                 Long label = val.getLabel();
                 int lbl = (label == null) ? qbgpConstants.LBL_NO_LABEL
-                                            : label.intValue();
+                        : label.intValue();
                 try {
-                    br.addPrefix(rd, pfxlen, nh, lbl); 
+                    br.addPrefix(rd, pfxlen, nh, lbl);
                 } catch (Exception e) {
-                    LOG.error(yangObj+"Add received exception: \""+e+"\"; "+addWarn);
+                    LOG.error(yangObj + "Add received exception: \"" + e + "\"; " + addWarn);
                 }
             }
         }
 
-        protected synchronized void 
+        @Override
+        protected InstanceIdentifier<Networks> getWildCardPath() {
+            return InstanceIdentifier.create(Bgp.class).child(Networks.class);
+        }
+
+        protected synchronized void
         remove(InstanceIdentifier<Networks> iid, Networks val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received remove Networks config val {}", val.getPrefixLen());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -778,66 +1014,93 @@ public class BgpConfigurationManager {
                 Long label = val.getLabel();
                 int lbl = (label == null) ? 0 : label.intValue();
                 if (rd == null && lbl > 0) {
-                    //LU prefix is being deleted. 
+                    //LU prefix is being deleted.
                     rd = Integer.toString(lbl);
                 }
                 try {
                     br.delPrefix(rd, pfxlen);
                 } catch (Exception e) {
-                    LOG.error(yangObj+" Delete received exception:  \""+e+"\"; "
-                              +delWarn);
+                    LOG.error(yangObj + " Delete received exception:  \"" + e + "\"; "
+                            delWarn);
                 }
             }
         }
-                          
-        protected void update(InstanceIdentifier<Networks> iid,
-                              Networks oldval, Networks newval) {
-            LOG.error(yangObj + updWarn);
+
+        protected void update(final InstanceIdentifier<Networks> iid,
+                              final Networks oldval, final Networks newval) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
+            LOG.debug("received update networks config val {}", newval.getPrefixLen());
+            remove(iid, oldval);
+            timer.schedule(new TimerTask() {
+                @Override
+                public void run() {
+                    add(iid, newval);
+                }
+            }, Integer.getInteger("bgp.nexthop.update.delay.in.secs", 5) * 1000);
         }
 
+        @Override
         public void close() {
-            int i;
-            for (i=0 ; i < reactors.length ; i++) {
-                if (reactors[i] == NetworksReactor.class) {
-                    break;
-                }
+            try {
+                super.close();
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-            registrations[i].close();
         }
     }
 
-    public class VrfsReactor 
-    extends AbstractDataChangeListener<Vrfs> 
-    implements AutoCloseable {
+    static Timer timer = new Timer();
+
+    public class VrfsReactor
+            extends AsyncDataTreeChangeListenerBase<Vrfs, VrfsReactor>
+            implements AutoCloseable, ClusteredDataTreeChangeListener<Vrfs> {
 
         private static final String yangObj = "vrfs ";
 
         public VrfsReactor() {
-            super(Vrfs.class);
+            super(Vrfs.class, VrfsReactor.class);
         }
 
-        protected synchronized void 
+        protected synchronized void
         add(InstanceIdentifier<Vrfs> iid, Vrfs val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received add Vrfs config val {}", val.getRd());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
                 }
                 try {
-                    br.addVrf(val.getRd(), val.getImportRts(), 
-                              val.getExportRts()); 
+                    br.addVrf(val.getRd(), val.getImportRts(),
+                            val.getExportRts());
                 } catch (Exception e) {
-                    LOG.error(yangObj+"Add received exception: \""+e+"\"; "
-                              +addWarn);
+                    LOG.error(yangObj + "Add received exception: \"" + e + "\"; "
+                            addWarn);
                 }
             }
         }
 
-        protected synchronized void 
+        @Override
+        protected VrfsReactor getDataTreeChangeListener() {
+            return VrfsReactor.this;
+        }
+
+        @Override
+        protected InstanceIdentifier<Vrfs> getWildCardPath() {
+            return InstanceIdentifier.create(Bgp.class).child(Vrfs.class);
+        }
+
+        protected synchronized void
         remove(InstanceIdentifier<Vrfs> iid, Vrfs val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received remove Vrfs config val {}", val.getRd());
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 BgpRouter br = getClient(yangObj);
                 if (br == null) {
                     return;
@@ -845,94 +1108,133 @@ public class BgpConfigurationManager {
                 try {
                     br.delVrf(val.getRd());
                 } catch (Exception e) {
-                    LOG.error(yangObj+" Delete received exception:  \""+e+"\"; "
-                              +delWarn);
+                    LOG.error(yangObj + " Delete received exception:  \"" + e + "\"; "
+                            delWarn);
                 }
             }
         }
-                          
+
         protected void update(InstanceIdentifier<Vrfs> iid,
                               Vrfs oldval, Vrfs newval) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
+            LOG.debug("VRFS: Update getting triggered for VRFS rd {}", oldval.getRd());
             LOG.error(yangObj + updWarn);
         }
 
+        @Override
         public void close() {
-            int i;
-            for (i=0 ; i < reactors.length ; i++) {
-                if (reactors[i] == VrfsReactor.class) {
-                    break;
-                }
+            try {
+                super.close();
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-            registrations[i].close();
         }
     }
 
     Future lastCleanupJob;
-    AtomicReference<Future> lastCleanupJobReference = new AtomicReference<>();
+    Future lastReplayJobFt = null;
+    protected void activateMIP() {
+        try {
+            LOG.trace("BgpReactor: Executing MIP Activate command");
+            Process process_bgp = Runtime.getRuntime().exec("cluster ip -a sdnc_bgp_mip");
+            Process process_os = Runtime.getRuntime().exec("cluster ip -a sdnc_os_mip");
+            LOG.trace("bgpMIP Activated");
+
+        } catch (IOException io) {
+            LOG.error("IO Exception got while activating mip:  ", io);
+        } catch (Exception e) {
+            LOG.error("Exception got while activating mip: ", e);
+        }
+    }
 
     AtomicBoolean started = new AtomicBoolean(false);
-    public class BgpReactor 
-    extends AbstractDataChangeListener<Bgp> 
-    implements AutoCloseable {
+
+    public class BgpReactor
+            extends AsyncDataTreeChangeListenerBase<Bgp, BgpReactor>
+            implements AutoCloseable, ClusteredDataTreeChangeListener<Bgp> {
+
         private static final String yangObj = "Bgp ";
 
         public BgpReactor() {
-            super(Bgp.class);
+            super(Bgp.class, BgpReactor.class);
         }
 
-        protected synchronized void 
+
+        protected synchronized void
         add(InstanceIdentifier<Bgp> iid, Bgp val) {
-            LOG.debug("received add Bgp config replaying the config");
+            LOG.error("received add Bgp config replaying the config");
+
             try {
                 initer.await();
             } catch (Exception e) {
             }
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 config = val;
-                if (restarting) {
-                    if (isIpAvailable(odlThriftIp)) {
-                        bgpRestarted();
-                    } else {
-                        ipActivationCheckTimer.scheduleAtFixedRate(new TimerTask() {
-                            public void run() {
-                                if (isIpAvailable(odlThriftIp)) {
-                                    bgpRestarted();
-                                    ipActivationCheckTimer.cancel();
-                                }
+                if (ignoreClusterDcnEventForFollower()) {
+                    return;
+                }
+                activateMIP();
+                if (isIpAvailable(odlThriftIp)) {
+                    bgpRestarted();
+                } else {
+                    ipActivationCheckTimer.scheduleAtFixedRate(new TimerTask() {
+                        @Override
+                        public void run() {
+                            if (isIpAvailable(odlThriftIp)) {
+                                bgpRestarted();
+                                ipActivationCheckTimer.cancel();
+                            } else {
+                                LOG.trace("waiting for odlThriftIP: {} to be present", odlThriftIp);
                             }
-                        }, 10000L, 10000L);
-                    }
+                        }
+                    }, 10000L, 10000L);
                 }
             }
         }
 
-        protected synchronized void 
+        @Override
+        protected BgpReactor getDataTreeChangeListener() {
+            return BgpReactor.this;
+        }
+
+        @Override
+        protected InstanceIdentifier<Bgp> getWildCardPath() {
+            return InstanceIdentifier.create(Bgp.class);
+        }
+
+        protected synchronized void
         remove(InstanceIdentifier<Bgp> iid, Bgp val) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
             LOG.debug("received remove Bgp config");
-            synchronized(BgpConfigurationManager.this) {
+            synchronized (BgpConfigurationManager.this) {
                 config = null;
             }
         }
-                          
+
         protected void update(InstanceIdentifier<Bgp> iid,
                               Bgp oldval, Bgp newval) {
-            synchronized(BgpConfigurationManager.this) {
+            if (ignoreClusterDcnEventForFollower()) {
+                return;
+            }
+            synchronized (BgpConfigurationManager.this) {
                 config = newval;
             }
         }
 
+        @Override
         public void close() {
-            int i;
-            for (i=0 ; i < reactors.length ; i++) {
-                if (reactors[i] == BgpReactor.class) {
-                    break;
-                }
+            try {
+                super.close();
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-            registrations[i].close();
         }
     }
-    
+
     public void readOdlThriftIpForBgpCommunication() {
         File f = new File(CLUSTER_CONF_FILE);
         if (!f.exists()) {
@@ -947,35 +1249,37 @@ public class BgpConfigurationManager {
             while (line != null) {
                 if (line.contains(SDNC_BGP_MIP)) {
                     line = line.trim();
-                    odlThriftIp = line.substring(line.lastIndexOf(" ")+1);
+                    odlThriftIp = line.substring(line.lastIndexOf(" ") + 1);
                     break;
                 }
                 line = br.readLine();
             }
         } catch (Exception e) {
         } finally {
-            try {br.close();} catch (Exception ignore){}
+            try {
+                br.close();
+            } catch (Exception ignore) {
+            }
         }
     }
-    
+
     public boolean isIpAvailable(String odlip) {
-        
+
         try {
             if (odlip != null) {
                 if ("127.0.0.1".equals(odlip)) {
                     return true;
                 }
                 Enumeration e = NetworkInterface.getNetworkInterfaces();
-                while(e.hasMoreElements())
-                {
+                while (e.hasMoreElements()) {
                     NetworkInterface n = (NetworkInterface) e.nextElement();
                     Enumeration ee = n.getInetAddresses();
-                    while (ee.hasMoreElements())
-                    {
+                    while (ee.hasMoreElements()) {
                         InetAddress i = (InetAddress) ee.nextElement();
                         if (odlip.equals(i.getHostAddress())) {
                             return true;
                         }
+                        ;
                     }
                 }
             }
@@ -984,54 +1288,92 @@ public class BgpConfigurationManager {
         return false;
     }
 
-    public void bgpRestarted() {
+    public static long getStalePathtime(int defValue, AsId as_num) {
+        long spt = 0;
+        try {
+            spt = bgpManager.getConfig().getGracefulRestart().getStalepathTime();
+        } catch (Exception e) {
+            try {
+                spt = as_num.getStalepathTime();
+                LOG.trace("BGP config/Stale-path time is not set using graceful");
+            } catch (Exception ignore) {
+                LOG.trace("BGP AS id is not set using graceful");
+                spt = defValue;
+            }
+        }
+        if (spt == 0) {
+            LOG.trace("BGP config/Stale-path time is not set using graceful/start-bgp");
+            spt = defValue;
+        }
+        return spt;
+    }
+
+    public synchronized void bgpRestarted() {
         /*
          * If there a thread which in the process of stale cleanup, cancel it
          * and start a new thread (to avoid processing same again).
          */
-        if (lastCleanupJobReference.get() != null) {
-            lastCleanupJobReference.get().cancel(true);
-            lastCleanupJobReference.set(null);
+        if (previousReplayJobInProgress()) {
+            cancelPreviousReplayJob();
         }
         Runnable task = new Runnable() {
             @Override
             public void run() {
                 try {
-                    long startTime = System.currentTimeMillis();
+                    LOG.error("running bgp replay task ");
+                    if (get() == null) {
+                        String host = getConfigHost();
+                        int port = getConfigPort();
+                        LOG.info("connecting  to bgp host {} ", host);
+
+                        boolean res = bgpRouter.connect(host, port);
+                        LOG.error("no config to push in bgp replay task ");
+                        return;
+                    }
+                    setStaleStartTime(System.currentTimeMillis());
                     LOG.error("started creating stale fib  map ");
                     createStaleFibMap();
-                    long endTime = System.currentTimeMillis();
-                    LOG.error("took {} msecs for stale fib map creation ", endTime - startTime);
+                    setStaleEndTime(System.currentTimeMillis());
+                    LOG.error("took {} msecs for stale fib map creation ", getStaleEndTime()- getStaleStartTime());
                     LOG.error("started bgp config replay ");
-                    startTime = endTime;
+                    setCfgReplayStartTime(System.currentTimeMillis());
                     replay();
-                    endTime = System.currentTimeMillis();
-                    LOG.error("took {} msecs for bgp replay ", endTime - startTime);
-                    long route_sync_time = BGP_RESTART_ROUTE_SYNC_SEC;
-                    try {
-                        route_sync_time = bgpManager.getConfig().getGracefulRestart().getStalepathTime();
-                    } catch (Exception e) {
-                        LOG.error("BGP config/Stale-path time is not set");
-                    }
+                    setCfgReplayEndTime(System.currentTimeMillis());
+                    LOG.error("took {} msecs for bgp replay ", getCfgReplayEndTime() - getCfgReplayStartTime());
+                    long route_sync_time = getStalePathtime(BGP_RESTART_ROUTE_SYNC_SEC, config.getAsId());
                     Thread.sleep(route_sync_time * 1000L);
+                    setStaleCleanupTime(route_sync_time);
                     new RouteCleanup().call();
-
                 } catch (Exception eCancel) {
                     LOG.error("Stale Cleanup Task Cancelled", eCancel);
                 }
             }
         };
-        lastCleanupJob = executor.submit(task);
-        lastCleanupJobReference.set(lastCleanupJob);
+        lastReplayJobFt = executor.submit(task);
+    }
+
+    private boolean previousReplayJobInProgress() {
+        return lastReplayJobFt != null && !lastReplayJobFt.isDone();
+    }
+
+    private void cancelPreviousReplayJob() {
+        try {
+            LOG.error("cancelling already running bgp replay task");
+            lastReplayJobFt.cancel(true);
+            lastReplayJobFt = null;
+            Thread.sleep(2000);
+        } catch (Throwable e) {
+            LOG.error("Failed to cancel previous replay job ",e);
+        }
     }
 
     private static void doRouteSync() {
         BgpSyncHandle bsh = BgpSyncHandle.getInstance();
-        LOG.debug("Starting BGP route sync");
+        LOG.error("Starting BGP route sync");
         try {
-            bgpRouter.initRibSync(bsh); 
+            bgpRouter.initRibSync(bsh);
         } catch (Exception e) {
-            LOG.error("Route sync aborted, exception when initialzing: "+e);
+            LOG.error("Route sync aborted, exception when initializing: " + e);
             return;
         }
         while (bsh.getState() != bsh.DONE) {
@@ -1039,7 +1381,7 @@ public class BgpConfigurationManager {
             try {
                 routes = bgpRouter.doRibSync(bsh);
             } catch (Exception e) {
-                LOG.error("Route sync aborted, exception when syncing: "+e);
+                LOG.error("Route sync aborted, exception when syncing: " + e);
                 return;
             }
             Iterator<Update> updates = routes.getUpdatesIterator();
@@ -1055,7 +1397,7 @@ public class BgpConfigurationManager {
             }
         }
         try {
-            LOG.debug("Ending BGP route-sync");
+            LOG.error("Ending BGP route-sync");
             bgpRouter.endRibSync(bsh);
         } catch (Exception e) {
         }
@@ -1065,74 +1407,72 @@ public class BgpConfigurationManager {
      * Get Stale fib map, and compare current route/fib entry.
      *  - Entry compare shall include NextHop, Label.
      *  - If entry matches: delete from STALE Map. NO Change to FIB Config DS.
-     *  - If entry nor found, add to FIB Config DS.
-     *  - If entry found, but either Label/NextHop doesnt match.
+     *  - If entry not found, add to FIB Config DS.
+     *  - If entry found, but either Label/NextHop doesn't match.
      *      - Update FIB Config DS with modified values.
      *      - delete from Stale Map.
      */
-    public static void onUpdatePushRoute(String rd, String prefix, int plen,
-                                  String nexthop, int label) {
+    public static void onUpdatePushRoute(String rd, String prefix, int plen, String nextHop, int label) {
         Map<String, Map<String, String>> stale_fib_rd_map = BgpConfigurationManager.getStaledFibEntriesMap();
         boolean addroute = false;
         if (!stale_fib_rd_map.isEmpty()) {
             // restart Scenario, as MAP is not empty.
             Map<String, String> map = stale_fib_rd_map.get(rd);
-            if (map !=null) {
+            if (map != null) {
                 String nexthoplabel = map.get(prefix + "/" + plen);
                 if (null == nexthoplabel) {
-                    // New Entry, which happend to be added during restart.
+                    // New Entry, which happened to be added during restart.
                     addroute = true;
                 } else {
                     map.remove(prefix + "/" + plen);
-                    if (isRouteModified(nexthop, label, nexthoplabel)) {
-                        LOG.debug("Route add ** {} ** {}/{} ** {} ** {} ", rd, prefix,
-                                plen, nexthop, label);
+                    if (isRouteModified(nextHop, label, nexthoplabel)) {
+                        LOG.debug("Route add ** {} ** {}/{} ** {} ** {} ", rd, prefix, plen, nextHop, label);
                         // Existing entry, where in Nexthop/Label got modified during restart
                         addroute = true;
                     }
                 }
             }
         } else {
-            LOG.debug("Route add ** {} ** {}/{} ** {} ** {} ", rd, prefix,
-                    plen, nexthop, label);
+            LOG.debug("Route add ** {} ** {}/{} ** {} ** {} ", rd, prefix, plen, nextHop, label);
             addroute = true;
         }
         if (addroute) {
-            fib.addFibEntryToDS(rd, prefix + "/" + plen,
-                    nexthop, label);
+            LOG.info("ADD: Adding Fib entry rd {} prefix {} nexthop {} label {}", rd, prefix, nextHop, label);
+            fib.addFibEntryToDS(rd, prefix + "/" + plen, Arrays.asList(nextHop), label, RouteOrigin.BGP);
+            LOG.info("ADD: Added Fib entry rd {} prefix {} nexthop {} label {}", rd, prefix, nextHop, label);
         }
     }
 
     private static boolean isRouteModified(String nexthop, int label, String nexthoplabel) {
-        return !nexthoplabel.isEmpty() && !nexthoplabel.equals(nexthop+"/"+label);
+        return !nexthoplabel.isEmpty() && !nexthoplabel.equals(nexthop + "/" + label);
     }
 
-    static private void replayNbrConfig(List<Neighbors> n, BgpRouter br) { 
+    static private void replayNbrConfig(List<Neighbors> n, BgpRouter br) {
         for (Neighbors nbr : n) {
             try {
                 br.addNeighbor(nbr.getAddress().getValue(),
-                               nbr.getRemoteAs().intValue());
+                        nbr.getRemoteAs().intValue());
                 //itmProvider.buildTunnelsToDCGW(new IpAddress(nbr.getAddress().getValue().toCharArray()));
             } catch (Exception e) {
-                LOG.error("Replay:addNbr() received exception: \""+e+"\"");
+                LOG.error("Replay:addNbr() received exception: \"" + e + "\"");
                 continue;
             }
             EbgpMultihop en = nbr.getEbgpMultihop();
             if (en != null) {
                 try {
-                    br.addEbgpMultihop(en.getPeerIp().getValue(), 
-                                       en.getNhops().intValue()); 
+                    br.addEbgpMultihop(en.getPeerIp().getValue(),
+                            en.getNhops().intValue());
                 } catch (Exception e) {
-                    LOG.error("Replay:addEBgp() received exception: \""+e+"\"");
+                    LOG.error("Replay:addEBgp() received exception: \"" + e + "\"");
                 }
             }
             UpdateSource us = nbr.getUpdateSource();
             if (us != null) {
                 try {
                     br.addUpdateSource(us.getPeerIp().getValue(),
-                                       us.getSourceIp().getValue());
+                            us.getSourceIp().getValue());
                 } catch (Exception e) {
-                    LOG.error("Replay:addUS() received exception: \""+e+"\"");
+                    LOG.error("Replay:addUS() received exception: \"" + e + "\"");
                 }
             }
             List<AddressFamilies> afs = nbr.getAddressFamilies();
@@ -1143,7 +1483,7 @@ public class BgpConfigurationManager {
                     try {
                         br.addAddressFamily(af.getPeerIp().getValue(), afi, safi);
                     } catch (Exception e) {
-                        LOG.error("Replay:addAf() received exception: \""+e+"\"");
+                        LOG.error("Replay:addAf() received exception: \"" + e + "\"");
                     }
                 }
             }
@@ -1164,105 +1504,114 @@ public class BgpConfigurationManager {
         }
         ConfigServer ts = config.getConfigServer();
         return (ts == null ? Integer.parseInt(cPortStartup) :
-                             ts.getPort().intValue());
+                ts.getPort().intValue());
     }
 
     public static synchronized void replay() {
-        String host = getConfigHost();
-        int port = getConfigPort();
-        boolean res = bgpRouter.connect(host, port);
-        if (!res) {
-            String msg = "Cannot connect to BGP config server at "+host+":"+port;
-            if (config != null) {
-                msg += "; Configuration Replay aborted";
-            }
-            LOG.error(msg);
-            return;
-        }
-        if (config == null) {
-            return;
-        }
-        BgpRouter br = bgpRouter; 
-        AsId a = config.getAsId();
-        if (a == null) {
-            return;
-        }
-        int asNum = a.getLocalAs().intValue();
-        Ipv4Address routerId = a.getRouterId();
-        Long spt = a.getStalepathTime();
-        Boolean afb = a.isAnnounceFbit();
-        String rid = (routerId == null) ? "" : routerId.getValue();
-        int stalepathTime = (spt == null) ? 90 : spt.intValue(); 
-        boolean announceFbit = afb != null && afb.booleanValue();
-        try {
-            br.startBgp(asNum, rid, stalepathTime, announceFbit); 
-        } catch (BgpRouterException bre) {
-            if (bre.getErrorCode() == BgpRouterException.BGP_ERR_ACTIVE) {
-                doRouteSync();
-            } else {
-                LOG.error("Replay: startBgp() received exception: \""
-                          +bre+"\"; "+addWarn);
+        synchronized (bgpConfigurationManager) {
+            String host = getConfigHost();
+            int port = getConfigPort();
+            LOG.error("connecting  to bgp host {} ", host);
+
+            boolean res = bgpRouter.connect(host, port);
+            if (!res) {
+                String msg = "Cannot connect to BGP config server at " + host + ":" + port;
+                if (config != null) {
+                    msg += "; Configuration Replay aborted";
+                }
+                LOG.error(msg);
+                return;
             }
-        } catch (Exception e) {
-            //not unusual. We may have restarted & BGP is already on
-            LOG.error("Replay:startBgp() received exception: \""+e+"\"");
-        }
-
-        if (bgpManager.getBgpCounters() == null) {
-            bgpManager.startBgpCountersTask();
-        }
-      
-        Logging l = config.getLogging();
-        if (l != null) {
-            try {
-                br.setLogging(l.getFile(), l.getLevel());
-            } catch (Exception e) {
-                LOG.error("Replay:setLogging() received exception: \""+e+"\"");
+            config = bgpManager.getConfig();
+            if (config == null) {
+                LOG.error("bgp config is empty nothing to push to bgp");
+                return;
             }
-        }
-
-        GracefulRestart g = config.getGracefulRestart();
-        if (g != null) {
+            BgpRouter br = bgpRouter;
+            AsId a = config.getAsId();
+            if (a == null) {
+                return;
+            }
+            int asNum = a.getLocalAs().intValue();
+            Ipv4Address routerId = a.getRouterId();
+            Long spt = a.getStalepathTime();
+            Boolean afb = a.isAnnounceFbit();
+            String rid = (routerId == null) ? "" : routerId.getValue();
+            int stalepathTime = (int) getStalePathtime(0, config.getAsId());
+            boolean announceFbit = (afb == null) ? false : afb.booleanValue();
             try {
-                br.addGracefulRestart(g.getStalepathTime().intValue()); 
+                br.startBgp(asNum, rid, stalepathTime, announceFbit);
+            } catch (BgpRouterException bre) {
+                if (bre.getErrorCode() == BgpRouterException.BGP_ERR_ACTIVE) {
+                    doRouteSync();
+                } else {
+                    LOG.error("Replay: startBgp() received exception: \""
+                            + bre + "\"; " + addWarn);
+                }
             } catch (Exception e) {
-                LOG.error("Replay:addGr() received exception: \""+e+"\"");
+                //not unusual. We may have restarted & BGP is already on
+                LOG.error("Replay:startBgp() received exception: \"" + e + "\"");
             }
-        }
 
-        List<Neighbors> n = config.getNeighbors();
-        if (n != null) {
-            replayNbrConfig(n, br);
-        }
+            if (bgpManager.getBgpCounters() == null) {
+                bgpManager.startBgpCountersTask();
+            }
 
-        List<Vrfs> v = config.getVrfs();
-        if (v != null) {
-            for (Vrfs vrf : v)  {
+            Logging l = config.getLogging();
+            if (l != null) {
                 try {
-                    br.addVrf(vrf.getRd(), vrf.getImportRts(), 
-                    vrf.getExportRts());
+                    br.setLogging(l.getFile(), l.getLevel());
                 } catch (Exception e) {
-                    LOG.error("Replay:addVrf() received exception: \""+e+"\"");
+                    LOG.error("Replay:setLogging() received exception: \"" + e + "\"");
                 }
             }
-        }
 
-        List<Networks> ln = config.getNetworks();
-        if (ln != null) {
-            for (Networks net : ln) {
-                String rd = net.getRd();
-                String pfxlen = net.getPrefixLen();
-                String nh = net.getNexthop().getValue();
-                Long label = net.getLabel();
-                int lbl = (label == null) ? 0 : label.intValue();
-                if (rd == null && lbl > 0) {
-                    //LU prefix is being deleted. 
-                    rd = Integer.toString(lbl);
-                }
+            GracefulRestart g = config.getGracefulRestart();
+            if (g != null) {
                 try {
-                    br.addPrefix(rd, pfxlen, nh, lbl); 
+                    br.addGracefulRestart(g.getStalepathTime().intValue());
                 } catch (Exception e) {
-                    LOG.error("Replay:addPfx() received exception: \""+e+"\"");
+                    LOG.error("Replay:addGr() received exception: \"" + e + "\"");
+                }
+            }
+
+            List<Neighbors> n = config.getNeighbors();
+            if (n != null) {
+                LOG.error("configuring existing Neighbors present for replay total neighbors {}", n.size());
+                replayNbrConfig(n, br);
+            } else {
+                LOG.error("no Neighbors present for replay config ");
+            }
+
+            List<Vrfs> v = config.getVrfs();
+            if (v != null) {
+                for (Vrfs vrf : v) {
+                    try {
+                        br.addVrf(vrf.getRd(), vrf.getImportRts(),
+                                vrf.getExportRts());
+                    } catch (Exception e) {
+                        LOG.error("Replay:addVrf() received exception: \"" + e + "\"");
+                    }
+                }
+            }
+
+            List<Networks> ln = config.getNetworks();
+            if (ln != null) {
+                for (Networks net : ln) {
+                    String rd = net.getRd();
+                    String pfxlen = net.getPrefixLen();
+                    String nh = net.getNexthop().getValue();
+                    Long label = net.getLabel();
+                    int lbl = (label == null) ? 0 : label.intValue();
+                    if (rd == null && lbl > 0) {
+                        //LU prefix is being deleted.
+                        rd = Integer.toString(lbl);
+                    }
+                    try {
+                        br.addPrefix(rd, pfxlen, nh, lbl);
+                    } catch (Exception e) {
+                        LOG.error("Replay:addPfx() received exception: \"" + e + "\"");
+                    }
                 }
             }
         }
@@ -1273,57 +1622,57 @@ public class BgpConfigurationManager {
     }
 
     private <T extends DataObject> void asyncWrite(InstanceIdentifier<T> iid, T dto) {
-        BgpUtil.write(broker,LogicalDatastoreType.CONFIGURATION,iid,dto);
+        BgpUtil.write(broker, LogicalDatastoreType.CONFIGURATION, iid, dto);
     }
 
     private <T extends DataObject> void delete(InstanceIdentifier<T> iid) {
         BgpUtil.delete(broker, LogicalDatastoreType.CONFIGURATION, iid);
-    } 
+    }
 
     public synchronized void
     startConfig(String bgpHost, int thriftPort) {
         InstanceIdentifier.InstanceIdentifierBuilder<ConfigServer> iib =
-            InstanceIdentifier.builder(Bgp.class).child(ConfigServer.class);
+                InstanceIdentifier.builder(Bgp.class).child(ConfigServer.class);
         InstanceIdentifier<ConfigServer> iid = iib.build();
         Ipv4Address ipAddr = new Ipv4Address(bgpHost);
-        ConfigServer dto  = new ConfigServerBuilder().setHost(ipAddr)
-                                            .setPort((long) thriftPort).build();
+        ConfigServer dto = new ConfigServerBuilder().setHost(ipAddr)
+                .setPort((long) thriftPort).build();
         update(iid, dto);
     }
 
     public synchronized void
     startBgp(int as, String routerId, int spt, boolean fbit) {
         Long localAs = (long) as;
-        Ipv4Address rid = (routerId == null) ? 
-                           null : new Ipv4Address(routerId);
+        Ipv4Address rid = (routerId == null) ?
+                null : new Ipv4Address(routerId);
         Long staleTime = (long) spt;
         InstanceIdentifier.InstanceIdentifierBuilder<AsId> iib =
-            InstanceIdentifier.builder(Bgp.class).child(AsId.class);
+                InstanceIdentifier.builder(Bgp.class).child(AsId.class);
         InstanceIdentifier<AsId> iid = iib.build();
         AsId dto = new AsIdBuilder().setLocalAs(localAs)
-                                    .setRouterId(rid)
-                                    .setStalepathTime(staleTime)
-                                    .setAnnounceFbit(fbit).build();
+                .setRouterId(rid)
+                .setStalepathTime(staleTime)
+                .setAnnounceFbit(fbit).build();
         update(iid, dto);
     }
 
     public synchronized void
     addLogging(String fileName, String logLevel) {
         InstanceIdentifier.InstanceIdentifierBuilder<Logging> iib =
-            InstanceIdentifier.builder(Bgp.class).child(Logging.class);
+                InstanceIdentifier.builder(Bgp.class).child(Logging.class);
         InstanceIdentifier<Logging> iid = iib.build();
         Logging dto = new LoggingBuilder().setFile(fileName)
-                                          .setLevel(logLevel).build();
+                .setLevel(logLevel).build();
         update(iid, dto);
     }
 
     public synchronized void
     addGracefulRestart(int staleTime) {
-        InstanceIdentifier.InstanceIdentifierBuilder<GracefulRestart> iib = 
-            InstanceIdentifier.builder(Bgp.class).child(GracefulRestart.class);
+        InstanceIdentifier.InstanceIdentifierBuilder<GracefulRestart> iib =
+                InstanceIdentifier.builder(Bgp.class).child(GracefulRestart.class);
         InstanceIdentifier<GracefulRestart> iid = iib.build();
         GracefulRestart dto = new GracefulRestartBuilder()
-                                     .setStalepathTime((long)staleTime).build();
+                .setStalepathTime((long) staleTime).build();
         update(iid, dto);
     }
 
@@ -1331,12 +1680,12 @@ public class BgpConfigurationManager {
     addNeighbor(String nbrIp, int remoteAs) {
         Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
         Long rAs = (long) remoteAs;
-        InstanceIdentifier.InstanceIdentifierBuilder<Neighbors> iib = 
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(Neighbors.class, new NeighborsKey(nbrAddr));
+        InstanceIdentifier.InstanceIdentifierBuilder<Neighbors> iib =
+                InstanceIdentifier.builder(Bgp.class)
+                        .child(Neighbors.class, new NeighborsKey(nbrAddr));
         InstanceIdentifier<Neighbors> iid = iib.build();
         Neighbors dto = new NeighborsBuilder().setAddress(nbrAddr)
-                                              .setRemoteAs(rAs).build();
+                .setRemoteAs(rAs).build();
         update(iid, dto);
     }
 
@@ -1344,26 +1693,26 @@ public class BgpConfigurationManager {
     addUpdateSource(String nbrIp, String srcIp) {
         Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
         Ipv4Address srcAddr = new Ipv4Address(srcIp);
-        InstanceIdentifier.InstanceIdentifierBuilder<UpdateSource> iib = 
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(Neighbors.class, new NeighborsKey(nbrAddr))
-                              .child(UpdateSource.class);
+        InstanceIdentifier.InstanceIdentifierBuilder<UpdateSource> iib =
+                InstanceIdentifier.builder(Bgp.class)
+                        .child(Neighbors.class, new NeighborsKey(nbrAddr))
+                        .child(UpdateSource.class);
         InstanceIdentifier<UpdateSource> iid = iib.build();
         UpdateSource dto = new UpdateSourceBuilder().setPeerIp(nbrAddr)
-                                                  .setSourceIp(srcAddr).build();
+                .setSourceIp(srcAddr).build();
         update(iid, dto);
     }
 
     public synchronized void
     addEbgpMultihop(String nbrIp, int nHops) {
         Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
-        InstanceIdentifier.InstanceIdentifierBuilder<EbgpMultihop> iib = 
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(Neighbors.class, new NeighborsKey(nbrAddr))
-                              .child(EbgpMultihop.class);
+        InstanceIdentifier.InstanceIdentifierBuilder<EbgpMultihop> iib =
+                InstanceIdentifier.builder(Bgp.class)
+                        .child(Neighbors.class, new NeighborsKey(nbrAddr))
+                        .child(EbgpMultihop.class);
         InstanceIdentifier<EbgpMultihop> iid = iib.build();
         EbgpMultihop dto = new EbgpMultihopBuilder().setPeerIp(nbrAddr)
-                                                 .setNhops((long)nHops).build();
+                .setNhops((long) nHops).build();
         update(iid, dto);
     }
 
@@ -1372,166 +1721,165 @@ public class BgpConfigurationManager {
         Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
         Long a = (long) afi;
         Long sa = (long) safi;
-        InstanceIdentifier.InstanceIdentifierBuilder<AddressFamilies> iib = 
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(Neighbors.class, new NeighborsKey(nbrAddr))
-                   .child(AddressFamilies.class, new AddressFamiliesKey(a, sa));
+        InstanceIdentifier.InstanceIdentifierBuilder<AddressFamilies> iib =
+                InstanceIdentifier.builder(Bgp.class)
+                        .child(Neighbors.class, new NeighborsKey(nbrAddr))
+                        .child(AddressFamilies.class, new AddressFamiliesKey(a, sa));
         InstanceIdentifier<AddressFamilies> iid = iib.build();
         AddressFamilies dto = new AddressFamiliesBuilder().setPeerIp(nbrAddr)
-                                                 .setAfi(a).setSafi(sa).build();
+                .setAfi(a).setSafi(sa).build();
         update(iid, dto);
     }
 
     public synchronized void
-    addPrefix(String rd, String pfx, String nh, int lbl) {
-        Ipv4Address nexthop = new Ipv4Address(nh);
-        Long label = (long) lbl;
-        InstanceIdentifier.InstanceIdentifierBuilder<Networks> iib = 
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(Networks.class, new NetworksKey(pfx, rd));
-        InstanceIdentifier<Networks> iid = iib.build();
-        Networks dto = new NetworksBuilder().setRd(rd)
-                                            .setPrefixLen(pfx)
-                                            .setNexthop(nexthop)
-                                            .setLabel(label).build();
-        update(iid, dto);
+    addPrefix(String rd, String pfx, List<String> nhList, int lbl) {
+        for (String nh : nhList) {
+            Ipv4Address nexthop = new Ipv4Address(nh);
+            Long label = (long) lbl;
+            InstanceIdentifier<Networks> iid = InstanceIdentifier.builder(Bgp.class)
+                    .child(Networks.class, new NetworksKey(pfx, rd)).build();
+            Networks dto = new NetworksBuilder().setRd(rd).setPrefixLen(pfx).setNexthop(nexthop)
+                                                .setLabel(label).build();
+            update(iid, dto);
+        }
     }
 
     public synchronized void
     addVrf(String rd, List<String> irts, List<String> erts) {
         InstanceIdentifier.InstanceIdentifierBuilder<Vrfs> iib =
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(Vrfs.class, new VrfsKey(rd));
+                InstanceIdentifier.builder(Bgp.class)
+                        .child(Vrfs.class, new VrfsKey(rd));
         InstanceIdentifier<Vrfs> iid = iib.build();
         Vrfs dto = new VrfsBuilder().setRd(rd)
-                                    .setImportRts(irts)
-                                    .setExportRts(erts).build();
+                .setImportRts(irts)
+                .setExportRts(erts).build();
 
         asyncWrite(iid, dto);
     }
 
     public synchronized void stopConfig() {
         InstanceIdentifier.InstanceIdentifierBuilder<ConfigServer> iib =
-            InstanceIdentifier.builder(Bgp.class).child(ConfigServer.class);
+                InstanceIdentifier.builder(Bgp.class).child(ConfigServer.class);
         InstanceIdentifier<ConfigServer> iid = iib.build();
         delete(iid);
     }
 
     public synchronized void stopBgp() {
         InstanceIdentifier.InstanceIdentifierBuilder<AsId> iib =
-            InstanceIdentifier.builder(Bgp.class).child(AsId.class);
+                InstanceIdentifier.builder(Bgp.class).child(AsId.class);
         InstanceIdentifier<AsId> iid = iib.build();
         delete(iid);
     }
 
     public synchronized void delLogging() {
         InstanceIdentifier.InstanceIdentifierBuilder<Logging> iib =
-            InstanceIdentifier.builder(Bgp.class).child(Logging.class);
+                InstanceIdentifier.builder(Bgp.class).child(Logging.class);
         InstanceIdentifier<Logging> iid = iib.build();
         delete(iid);
     }
 
     public synchronized void delGracefulRestart() {
-        InstanceIdentifier.InstanceIdentifierBuilder<GracefulRestart> iib = 
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(GracefulRestart.class);
+        InstanceIdentifier.InstanceIdentifierBuilder<GracefulRestart> iib =
+                InstanceIdentifier.builder(Bgp.class)
+                        .child(GracefulRestart.class);
         InstanceIdentifier<GracefulRestart> iid = iib.build();
         delete(iid);
     }
 
     public synchronized void delNeighbor(String nbrIp) {
         Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
-        InstanceIdentifier.InstanceIdentifierBuilder<Neighbors> iib = 
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(Neighbors.class, new NeighborsKey(nbrAddr));
+        InstanceIdentifier.InstanceIdentifierBuilder<Neighbors> iib =
+                InstanceIdentifier.builder(Bgp.class)
+                        .child(Neighbors.class, new NeighborsKey(nbrAddr));
         InstanceIdentifier<Neighbors> iid = iib.build();
         delete(iid);
     }
 
     public synchronized void delUpdateSource(String nbrIp) {
         Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
-        InstanceIdentifier.InstanceIdentifierBuilder<UpdateSource> iib = 
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(Neighbors.class, new NeighborsKey(nbrAddr))
-                              .child(UpdateSource.class);
+        InstanceIdentifier.InstanceIdentifierBuilder<UpdateSource> iib =
+                InstanceIdentifier.builder(Bgp.class)
+                        .child(Neighbors.class, new NeighborsKey(nbrAddr))
+                        .child(UpdateSource.class);
         InstanceIdentifier<UpdateSource> iid = iib.build();
         delete(iid);
     }
 
     public synchronized void delEbgpMultihop(String nbrIp) {
         Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
-        InstanceIdentifier.InstanceIdentifierBuilder<EbgpMultihop> iib = 
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(Neighbors.class, new NeighborsKey(nbrAddr))
-                              .child(EbgpMultihop.class);
+        InstanceIdentifier.InstanceIdentifierBuilder<EbgpMultihop> iib =
+                InstanceIdentifier.builder(Bgp.class)
+                        .child(Neighbors.class, new NeighborsKey(nbrAddr))
+                        .child(EbgpMultihop.class);
         InstanceIdentifier<EbgpMultihop> iid = iib.build();
         delete(iid);
     }
 
-    public synchronized void 
+    public synchronized void
     delAddressFamily(String nbrIp, int afi, int safi) {
         Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
         Long a = (long) afi;
         Long sa = (long) safi;
-        InstanceIdentifier.InstanceIdentifierBuilder<AddressFamilies> iib = 
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(Neighbors.class, new NeighborsKey(nbrAddr))
-                   .child(AddressFamilies.class, new AddressFamiliesKey(a, sa));
+        InstanceIdentifier.InstanceIdentifierBuilder<AddressFamilies> iib =
+                InstanceIdentifier.builder(Bgp.class)
+                        .child(Neighbors.class, new NeighborsKey(nbrAddr))
+                        .child(AddressFamilies.class, new AddressFamiliesKey(a, sa));
         InstanceIdentifier<AddressFamilies> iid = iib.build();
         delete(iid);
     }
 
     public synchronized void delPrefix(String rd, String pfx) {
-        InstanceIdentifier.InstanceIdentifierBuilder<Networks> iib = 
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(Networks.class, new NetworksKey(pfx, rd));
+        InstanceIdentifier.InstanceIdentifierBuilder<Networks> iib =
+                InstanceIdentifier.builder(Bgp.class)
+                        .child(Networks.class, new NetworksKey(pfx, rd));
         InstanceIdentifier<Networks> iid = iib.build();
         delete(iid);
     }
 
     public synchronized void delVrf(String rd) {
-        InstanceIdentifier.InstanceIdentifierBuilder<Vrfs> iib = 
-            InstanceIdentifier.builder(Bgp.class)
-                              .child(Vrfs.class, new VrfsKey(rd));
+        InstanceIdentifier.InstanceIdentifierBuilder<Vrfs> iib =
+                InstanceIdentifier.builder(Bgp.class)
+                        .child(Vrfs.class, new VrfsKey(rd));
         InstanceIdentifier<Vrfs> iid = iib.build();
         delete(iid);
     }
 
-    private static final ThreadFactory threadFactory = new ThreadFactoryBuilder()
-        .setNameFormat("NV-BgpCfgMgr-%d").build();
-    static ScheduledExecutorService executor = Executors.newScheduledThreadPool(1, threadFactory);
+    static ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
+
     /*
     * Remove Stale Marked Routes after timer expiry.
     */
     class RouteCleanup implements Callable<Integer> {
 
-        public Integer call () {
-            int totalCleared = 0;
+        @Override
+        public Integer call() {
+            totalCleared = 0;
             try {
-            if (staledFibEntriesMap.isEmpty()) {
-                LOG.info("BGP: RouteCleanup timertask tirggered but STALED FIB MAP is EMPTY");
-            } else {
-                for (String rd : staledFibEntriesMap.keySet()) {
-                    if (Thread.interrupted()) {
-                        return 0;
-                    }
-                    Map<String, String> map = staledFibEntriesMap.get(rd);
-                    if (map != null) {
-                        for (String prefix : map.keySet()) {
-                            if (Thread.interrupted()) {
-                                return 0;
-                            }
-                            try {
-                                totalCleared++;
-                                bgpManager.deletePrefix(rd, prefix);
-                            } catch (Exception e) {
-                                LOG.error("BGP: RouteCleanup deletePrefix failed rd:{}, prefix{}" + rd.toString() + prefix);
+                if (staledFibEntriesMap.isEmpty()) {
+                    LOG.info("BGP: RouteCleanup timertask tirggered but STALED FIB MAP is EMPTY");
+                } else {
+                    for (String rd : staledFibEntriesMap.keySet()) {
+                        if (Thread.interrupted()) {
+                            return 0;
+                        }
+                        Map<String, String> map = staledFibEntriesMap.get(rd);
+                        if (map != null) {
+                            for (String prefix : map.keySet()) {
+                                if (Thread.interrupted()) {
+                                    return 0;
+                                }
+                                try {
+                                    totalCleared++;
+                                    LOG.error("BGP: RouteCleanup deletePrefix called but not executed rd:{}, prefix{}" + rd.toString() + prefix);
+                                    // fib.removeFibEntryFromDS(rd, prefix);
+                                } catch (Exception e) {
+                                    LOG.error("BGP: RouteCleanup deletePrefix failed rd:{}, prefix{}" + rd.toString() + prefix);
+                                }
                             }
                         }
                     }
                 }
-            }
-            } catch(Exception e) {
+            } catch (Exception e) {
                 LOG.error("Cleanup Thread Got interrupted, Failed to cleanup stale routes ", e);
             } finally {
                 staledFibEntriesMap.clear();
@@ -1546,8 +1894,20 @@ public class BgpConfigurationManager {
      * On re-sync notification, Get a copy of FIB database.
      */
     public static void createStaleFibMap() {
-        int totalStaledCount = 0;
+        totalStaledCount = 0;
         try {
+            /*
+            * at the time Stale FIB creation, Wait till all PENDING write transaction
+             * to complete (or)wait for max timeout value of STALE_FIB_WAIT Seconds.
+             */
+            int retry = STALE_FIB_WAIT;
+            while ((BgpUtil.getGetPendingWrTransaction() != 0) && (retry > 0)) {
+                Thread.sleep(1000);
+                retry--;
+                if (retry == 0) {
+                    LOG.error("TimeOut occured {} seconds, in waiting stale fib create", STALE_FIB_WAIT);
+                }
+            }
             staledFibEntriesMap.clear();
             InstanceIdentifier<FibEntries> id = InstanceIdentifier.create(FibEntries.class);
             DataBroker db = BgpUtil.getBroker();
@@ -1555,7 +1915,7 @@ public class BgpConfigurationManager {
                 LOG.error("Couldn't find BgpUtil broker while creating createStaleFibMap");
                 return;
             }
-    
+
             Optional<FibEntries> fibEntries = BgpUtil.read(BgpUtil.getBroker(),
                     LogicalDatastoreType.CONFIGURATION, id);
             if (fibEntries.isPresent()) {
@@ -1568,15 +1928,19 @@ public class BgpConfigurationManager {
                         }
                         totalStaledCount++;
                         //Create MAP from stale_vrfTables.
-                        stale_fib_ent_map.put(vrfEntry.getDestPrefix(), vrfEntry.getNextHopAddress() + "/" + vrfEntry.getLabel());
+                        //FIXME: Once odl-fib.yang is updated with latest yang to contain nexthopaddresslist
+//                        for (String nextHop : vrfEntry.getNextHopAddressList()) {
+//                            stale_fib_ent_map.put(vrfEntry.getDestPrefix(), nextHop + "/" + vrfEntry.getLabel());
+//                        }
+
                     }
-                staledFibEntriesMap.put(vrfTable.getRouteDistinguisher(), stale_fib_ent_map);
+                    staledFibEntriesMap.put(vrfTable.getRouteDistinguisher(), stale_fib_ent_map);
                 }
             } else {
-                    LOG.error("createStaleFibMap:: FIBentries.class is not present");
+                LOG.error("createStaleFibMap:: FIBentries.class is not present");
             }
         } catch (Exception e) {
-            LOG.error("createStaleFibMap:: erorr ", e);
+            LOG.error("createStaleFibMap:: error ", e);
         }
         LOG.error("created {} staled entries ", totalStaledCount);
     }
@@ -1586,5 +1950,27 @@ public class BgpConfigurationManager {
         return staledFibEntriesMap;
     }
 
-
+    //TODO: below function is for testing purpose with cli
+    public static void onUpdateWithdrawRoute(String rd, String prefix, int plen) {
+        LOG.debug("Route del ** {} ** {}/{} ", rd, prefix, plen);
+        try {
+            fib.removeFibEntryFromDS(rd, prefix + "/" + plen);
+        } catch (Throwable e) {
+            LOG.error("failed to handle withdraw route ", e);
+        }
+    }
+    public boolean isBgpConnected(){
+        return bgpRouter.isBgpConnected();
+    }
+    public long getLastConnectedTS() {
+        return bgpRouter.getLastConnectedTS();
+    }
+    public long getConnectTS() {
+        return bgpRouter.getConnectTS();
+    }
+    public long getStartTS() {
+        return bgpRouter.getStartTS();
+    }
+    public static int getTotalStaledCount() {return totalStaledCount;}
+    public static int getTotalCleared() { return totalCleared;}
 }
index 128e888e9b41e0aca44a4e99ce87760e776cc65c..cb84d2d053fbc012a018fc99b8d335fc6eb4db5e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,21 +10,28 @@ package org.opendaylight.netvirt.bgpmanager;
 
 import java.lang.management.ManagementFactory;
 import java.util.*;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
 import javax.management.*;
+
+import com.google.common.base.*;
+import com.google.common.base.Optional;
 import org.apache.thrift.TException;
 import org.opendaylight.netvirt.bgpmanager.api.IBgpManager;
+import org.opendaylight.netvirt.bgpmanager.api.RouteOrigin;
 import org.opendaylight.netvirt.bgpmanager.commands.Commands;
-import org.opendaylight.netvirt.bgpmanager.oam.BgpAlarmErrorCodes;
-import org.opendaylight.netvirt.bgpmanager.oam.BgpConstants;
-import org.opendaylight.netvirt.bgpmanager.oam.BgpCounters;
+import org.opendaylight.netvirt.bgpmanager.oam.*;
 import org.opendaylight.netvirt.bgpmanager.thrift.gen.af_afi;
 import org.opendaylight.netvirt.bgpmanager.thrift.gen.af_safi;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.netvirt.bgpmanager.oam.BgpAlarmBroadcaster;
 import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.Bgp;
 import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -35,12 +42,15 @@ public class BgpManager implements BindingAwareProvider, AutoCloseable, IBgpMana
     private FibDSWriter fibDSWriter;
     //private IITMProvider        itmProvider;
     private DataBroker dataBroker;
-    private BgpAlarmBroadcaster qbgpAlarmProducer = null;
+    private BgpAlarmBroadcaster     qbgpAlarmProducer = null;
     private MBeanServer qbgpAlarmServer = null;
     private NotificationFilter  qbgpAlarmFilter = null;
     final static int DEFAULT_STALEPATH_TIME = 210;
     final static boolean DEFAULT_FBIT = true;
 
+    private long qBGPrestartTS = 0;
+
+    EntityOwnershipService entityOwnershipService;
     public BgpCounters bgpCounters;
     public Timer bgpCountersTimer;
 
@@ -51,6 +61,7 @@ public class BgpManager implements BindingAwareProvider, AutoCloseable, IBgpMana
             fibDSWriter = new FibDSWriter(dataBroker);
             BgpUtil.setBroker(dataBroker);
             bcm = new BgpConfigurationManager(this);
+            bcm.setEntityOwnershipService(entityOwnershipService);
             Commands commands = new Commands(this);
             ConfigureBgpCli.setBgpManager(this);
             LOGGER.info("BgpManager started");
@@ -70,11 +81,15 @@ public class BgpManager implements BindingAwareProvider, AutoCloseable, IBgpMana
         }
     }
 
-   @Override
+    public void setEntityOwnershipService(EntityOwnershipService entityOwnershipService) {
+        this.entityOwnershipService = entityOwnershipService;
+    }
+
+    @Override
     public void close() throws Exception {
-        bcm.close(); 
+        bcm.close();
         LOGGER.info("BgpManager Closed");
-   }
+    }
 
     /*public void setITMProvider(IITMProvider itmProvider) {
         this.itmProvider = itmProvider;
@@ -83,103 +98,125 @@ public class BgpManager implements BindingAwareProvider, AutoCloseable, IBgpMana
     public IITMProvider getItmProvider() { return this.itmProvider; } */
 
     public Bgp getConfig() {
-      return bcm.get();
+        //TODO cleanup this cache code
+        try {
+            Optional<Bgp> optional = BgpUtil.read(dataBroker,
+                    LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(Bgp.class));
+            return optional.get();
+        } catch (Exception e) {
+            LOGGER.error("failed to get bgp config",e);
+        }
+        return null;
     }
 
     public void configureGR(int stalepathTime) throws TException {
-      bcm.addGracefulRestart(stalepathTime);
+        bcm.addGracefulRestart(stalepathTime);
     }
 
     public void delGracefulRestart() throws Exception {
-      bcm.delGracefulRestart();
+        bcm.delGracefulRestart();
     }
 
     public void addNeighbor(String ipAddress, long asNum) throws TException {
-      bcm.addNeighbor(ipAddress, (int) asNum);
+        bcm.addNeighbor(ipAddress, (int) asNum);
     }
 
     public void addEbgpMultihop(String ipAddress, int nhops) throws TException {
-      bcm.addEbgpMultihop(ipAddress, nhops);
+        bcm.addEbgpMultihop(ipAddress, nhops);
     }
-    
+
     public void addUpdateSource(String ipAddress, String srcIp) throws TException {
-      bcm.addUpdateSource(ipAddress, srcIp);
+        bcm.addUpdateSource(ipAddress, srcIp);
     }
 
     public void addAddressFamily(String ipAddress, af_afi afi, af_safi safi) throws TException {
-      bcm.addAddressFamily(ipAddress, afi.getValue(), safi.getValue());
+        bcm.addAddressFamily(ipAddress, afi.getValue(), safi.getValue());
     }
 
     public void deleteNeighbor(String ipAddress) throws TException {
-      bcm.delNeighbor(ipAddress);
+        bcm.delNeighbor(ipAddress);
     }
 
     @Override
     public void addVrf(String rd, Collection<String> importRts, Collection<String> exportRts) throws Exception {
-        bcm.addVrf(rd, new ArrayList<>(importRts),
-                new ArrayList<>(exportRts));
+        bcm.addVrf(rd, new ArrayList<String>(importRts), new ArrayList<String>(exportRts));
     }
 
     @Override
     public void deleteVrf(String rd) throws Exception {
-      bcm.delVrf(rd);
+        fibDSWriter.removeVrfFromDS(rd);
+        bcm.delVrf(rd);
     }
 
     @Override
-    public void addPrefix(String rd, String prefix, String nextHop, int vpnLabel) throws Exception {
-      fibDSWriter.addFibEntryToDS(rd, prefix, nextHop, vpnLabel);
-      bcm.addPrefix(rd, prefix, nextHop, vpnLabel);
+    public void addPrefix(String rd, String prefix, List<String> nextHopList, int vpnLabel, RouteOrigin origin) throws Exception {
+        fibDSWriter.addFibEntryToDS(rd, prefix, nextHopList, vpnLabel, origin);
+        bcm.addPrefix(rd, prefix, nextHopList, vpnLabel);
+    }
+
+    @Override
+    public void addPrefix(String rd, String prefix, String nextHop, int vpnLabel, RouteOrigin origin) throws Exception {
+        addPrefix(rd, prefix, Arrays.asList(nextHop), vpnLabel, origin);
     }
 
     @Override
     public void deletePrefix(String rd, String prefix) throws Exception {
-      fibDSWriter.removeFibEntryFromDS(rd, prefix);
-      bcm.delPrefix(rd, prefix);
+        fibDSWriter.removeFibEntryFromDS(rd, prefix);
+        bcm.delPrefix(rd, prefix);
+    }
+
+    @Override
+    public void advertisePrefix(String rd, String prefix, List<String> nextHopList, int vpnLabel) throws Exception {
+        bcm.addPrefix(rd, prefix, nextHopList, vpnLabel);
     }
 
     @Override
     public void advertisePrefix(String rd, String prefix, String nextHop, int vpnLabel) throws Exception {
-        bcm.addPrefix(rd, prefix, nextHop, vpnLabel);
+        LOGGER.info("ADVERTISE: Adding Prefix rd {} prefix {} nexthop {} label {}", rd, prefix, nextHop, vpnLabel);
+        bcm.addPrefix(rd, prefix, Arrays.asList(nextHop), vpnLabel);
+        LOGGER.info("ADVERTISE: Added Prefix rd {} prefix {} nexthop {} label {}", rd, prefix, nextHop, vpnLabel);
     }
 
     @Override
     public void withdrawPrefix(String rd, String prefix) throws Exception {
+        LOGGER.info("WITHDRAW: Removing Prefix rd {} prefix {}", rd, prefix);
         bcm.delPrefix(rd, prefix);
+        LOGGER.info("WITHDRAW: Removed Prefix rd {} prefix {}", rd, prefix);
     }
 
     public void setQbgpLog(String fileName, String debugLevel) throws Exception {
-      bcm.addLogging(fileName, debugLevel);
+        bcm.addLogging(fileName, debugLevel);
     }
 
     public void delLogging() throws Exception {
-      bcm.delLogging();
+        bcm.delLogging();
     }
 
     public void startBgp(int asn, String routerId, int spt, boolean fbit) {
-      bcm.startBgp(asn, routerId, spt, fbit);
+        bcm.startBgp(asn, routerId, spt, fbit);
     }
 
     public void stopBgp() {
-      bcm.stopBgp();
+        bcm.stopBgp();
     }
 
     public void startConfig(String host, int port) {
-      bcm.startConfig(host, port);
+        bcm.startConfig(host, port);
     }
 
     public void stopConfig() {
-      bcm.stopConfig();
+        bcm.stopConfig();
     }
 
     @Override
     public String getDCGwIP() {
         Bgp conf = getConfig();
         if (conf == null) {
-          return null;
+            return null;
         }
         List<Neighbors> nbrs = conf.getNeighbors();
         if (nbrs == null) {
-          return null;
+            return null;
         }
         return nbrs.get(0).getAddress().getValue();
     }
@@ -253,11 +290,11 @@ public class BgpManager implements BindingAwareProvider, AutoCloseable, IBgpMana
 
     public FibDSWriter getFibWriter() {
         return fibDSWriter;
-    } 
+    }
 
     public DataBroker getBroker() {
         return dataBroker;
-    } 
+    }
 
     public String getConfigHost() {
         return bcm.getConfigHost();
@@ -270,4 +307,42 @@ public class BgpManager implements BindingAwareProvider, AutoCloseable, IBgpMana
     public void bgpRestarted() {
         bcm.bgpRestarted();
     }
+
+    public boolean isBgpConnected() {
+        return bcm.isBgpConnected();
+    }
+
+    public long getLastConnectedTS() {
+        return bcm.getLastConnectedTS();
+    }
+    public long getConnectTS() {
+        return bcm.getConnectTS();
+    }
+    public long getStartTS() {
+        return bcm.getStartTS();
+    }
+
+    public long getqBGPrestartTS() {
+        return qBGPrestartTS;
+    }
+
+    public void setqBGPrestartTS(long qBGPrestartTS) {
+        this.qBGPrestartTS = qBGPrestartTS;
+    }
+    public long getStaleStartTime() {
+        return bcm.getStaleStartTime();
+    }
+    public long getStaleEndTime() {
+        return bcm.getStaleEndTime();
+    }
+    public long getCfgReplayStartTime() {
+        return bcm.getCfgReplayStartTime();
+    }
+    public long getCfgReplayEndTime() {
+        return bcm.getCfgReplayEndTime();
+    }
+    public long getStaleCleanupTime() {
+        return bcm.getStaleCleanupTime();
+    }
+
 }
index e8a13a6f46d3b9c0b5f2dd6598f5a78f3cd94e79..63250e1f261d2af4ec0d0c6061b1ab1d6dea9feb 100644 (file)
 package org.opendaylight.netvirt.bgpmanager;
 
 import com.google.common.base.Optional;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import org.opendaylight.controller.md.sal.binding.api.*;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.*;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.AtomicInteger;
+
 /**
  * Created by emhamla on 8/31/2015.
  */
+
 public class BgpUtil {
 
+    private static final long FIB_READ_TIMEOUT = 1;
     private static final Logger LOG = LoggerFactory.getLogger(BgpUtil.class);
     private static DataBroker  dataBroker;
+    private static BindingTransactionChain fibTransact;
+    private static AtomicInteger pendingWrTransaction = new AtomicInteger(0);
+    private static int txChainAttempts = 0;
+
+    // return number of pending Write Transactions with BGP-Util (no read)
+    public static int getGetPendingWrTransaction() {
+        return pendingWrTransaction.get();
+    }
+
+    static ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
+            .setNameFormat("bgp-util-mdsal-%d").build();
+
+    static ExecutorService threadPool = Executors.newFixedThreadPool(1, namedThreadFactory);
+
+
+    static synchronized BindingTransactionChain getTransactionChain() {
+        return fibTransact;
+    }
 
-    static <T extends DataObject> void update(DataBroker broker, LogicalDatastoreType datastoreType,
-                                              InstanceIdentifier<T> path, T data) {
-        WriteTransaction tx = broker.newWriteOnlyTransaction();
-        tx.merge(datastoreType, path, data, true);
-        tx.submit();
+    static <T extends DataObject> void update(DataBroker broker, final LogicalDatastoreType datastoreType,
+                                              final InstanceIdentifier<T> path, final T data) {
+        threadPool.submit(new MdsalDsTask<>(datastoreType, path, data, TransactionType.UPDATE));
     }
 
-    public static <T extends DataObject> void write(DataBroker broker, LogicalDatastoreType datastoreType,
-                                              InstanceIdentifier<T> path, T data) {
-        WriteTransaction tx = broker.newWriteOnlyTransaction();
-        tx.put(datastoreType, path, data, true);
-        tx.submit();
+
+    public static <T extends DataObject> void write(DataBroker broker, final LogicalDatastoreType datastoreType,
+                                                    final InstanceIdentifier<T> path, final T data) {
+        threadPool.submit(new MdsalDsTask<>(datastoreType, path, data, TransactionType.WRITE));
+    }
+
+    static <T extends DataObject> void delete(DataBroker broker, final LogicalDatastoreType datastoreType,
+                                              final InstanceIdentifier<T> path) {
+        threadPool.submit(new MdsalDsTask<>(datastoreType, path, null, TransactionType.DELETE));
+    }
+
+    static enum TransactionType {
+        WRITE, UPDATE, DELETE;
+    }
+
+    static  class MdsalDsTask<T extends DataObject> implements Runnable {
+        LogicalDatastoreType datastoreType;
+        InstanceIdentifier<T> path;
+        T data;
+        TransactionType type;
+
+        public MdsalDsTask(LogicalDatastoreType datastoreType, InstanceIdentifier<T> path, T data, TransactionType type) {
+            this.datastoreType = datastoreType;
+            this.path = path;
+            this.data = data;
+            this.type = type;
+        }
+
+        @Override
+        public void run() {
+            try {
+                LOG.trace("BgpUtil MDSAL task started ");
+                WriteTransaction tx = getTransactionChain().newWriteOnlyTransaction();
+                switch (type) {
+                    case WRITE:
+                        tx.put(datastoreType, path, data, true);
+                        break;
+                    case UPDATE:
+                        tx.merge(datastoreType, path, data, true);
+                        break;
+                    case DELETE:
+                        tx.delete(datastoreType, path);
+                        break;
+                    default:
+                        LOG.error("Invalid Transaction type: {}", type);
+                }
+                pendingWrTransaction.incrementAndGet();
+                addFutureCallback(tx, path, data);
+                LOG.trace("Transaction type: {} submitted", type);
+            } catch (final Exception e) {
+                LOG.error("TxChain transaction submission failed, re-init TxChain", e);
+                initTransactionChain();
+            }
+        }
     }
 
-    static <T extends DataObject> void delete(DataBroker broker, LogicalDatastoreType datastoreType, InstanceIdentifier<T> path) {
-        WriteTransaction tx = broker.newWriteOnlyTransaction();
-        tx.delete(datastoreType, path);
-        tx.submit();
+
+    static  <T extends DataObject> void addFutureCallback(WriteTransaction tx, final InstanceIdentifier<T> path,
+                                                          final T data) {
+        Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
+            @Override
+            public void onSuccess(final Void result) {
+                pendingWrTransaction.decrementAndGet();
+                LOG.trace("DataStore entry success data:{} path:{} ", path);
+            }
+
+            @Override
+            public void onFailure(final Throwable t) {
+                pendingWrTransaction.decrementAndGet();
+                LOG.error("DataStore  entry failed data:{} path:{} cause:{} , retry initTransactionChain", data, path, t.getCause());
+           }
+        });
     }
 
+
     public static <T extends DataObject> Optional<T> read(DataBroker broker, LogicalDatastoreType datastoreType,
-                                                   InstanceIdentifier<T> path) {
+                                                          InstanceIdentifier<T> path)
+            throws ExecutionException, InterruptedException, TimeoutException {
 
-        ReadOnlyTransaction tx = broker.newReadOnlyTransaction();
+        ReadTransaction tx = broker.newReadOnlyTransaction();
+        CheckedFuture<?,?> result = tx.read(datastoreType, path);
 
-        Optional<T> result = Optional.absent();
         try {
-            result = tx.read(datastoreType, path).get();
+            return (Optional<T>) result.get();
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            LOG.error("DataStore  read exception {} ", e);
         }
-
-        return result;
+        return Optional.absent();
     }
 
-    public static void setBroker(DataBroker broker) {
+    public static void setBroker(final DataBroker broker) {
         BgpUtil.dataBroker = broker;
+        initTransactionChain();
+    }
+
+    static synchronized void initTransactionChain() {
+        try {
+            if (fibTransact != null) {
+                fibTransact.close();
+                LOG.error("*** TxChain Close, *** Attempts: {}", txChainAttempts);
+                fibTransact = null;
+            }
+        } catch (Exception ignore) {
+        }
+        BgpUtil.fibTransact = dataBroker.createTransactionChain(new BgpUtilTransactionChainListener());
+        txChainAttempts++;
+    }
+
+    static class BgpUtilTransactionChainListener implements TransactionChainListener {
+        @Override
+        public void onTransactionChainFailed(TransactionChain<?, ?> transactionChain, AsyncTransaction<?, ?> asyncTransaction, Throwable throwable) {
+            LOG.error("*** TxChain Creation Failed *** Attempts: {}", txChainAttempts);
+            initTransactionChain();
+        }
+
+        @Override
+        public void onTransactionChainSuccessful(TransactionChain<?, ?> transactionChain) {
+            LOG.trace("TxChain Creation Success");
+        }
     }
 
     public static DataBroker getBroker() {
         return dataBroker;
     }
-
 }
index 7b0f09f2db8b1a32832d791849d54cb06f4f7076..5ff99ed5ade2959fb76828d3195f99fb6ce49701 100644 (file)
@@ -9,6 +9,10 @@
 package org.opendaylight.netvirt.bgpmanager;
 
 import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.Future;
 
 import org.apache.karaf.shell.commands.*;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
@@ -17,10 +21,17 @@ import org.opendaylight.netvirt.bgpmanager.thrift.gen.af_safi;
 import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.*;
 import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.*;
 import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighbors.*;
+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.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.util.*;
 
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+
 @Command(scope = "odl", name = "configure-bgp", description = "")
 public class ConfigureBgpCli extends OsgiCommandSupport {
 
@@ -73,7 +84,7 @@ public class ConfigureBgpCli extends OsgiCommandSupport {
     String logLevel = null;
 
     enum LogLevels {
-        emergencies,alerts,critical,errors,warnings,notifications,informational,debugging
+        emergencies,alerts,critical,errors,warnings,notifications,informational,debugging;
     }
 
     @Override
@@ -253,7 +264,7 @@ public class ConfigureBgpCli extends OsgiCommandSupport {
                 return;
             }
         }
-        bgpManager.startBgp(Integer.parseInt(asNumber), routerId, 
+        bgpManager.startBgp(Integer.parseInt(asNumber), routerId,
           stalePathTime == null? 0 : Integer.parseInt(stalePathTime), false);
     }
 
@@ -323,7 +334,7 @@ public class ConfigureBgpCli extends OsgiCommandSupport {
         }
         bgpManager.addNeighbor(ip, Long.valueOf(asNumber));
         if (addressFamily != null) {
-            bgpManager.addAddressFamily(ip, af_afi.AFI_IP,
+            bgpManager.addAddressFamily(ip, af_afi.AFI_IP, 
                                  af_safi.valueOf(addressFamily));
         }
         if (ebgpMultihops != null) {
@@ -351,7 +362,7 @@ public class ConfigureBgpCli extends OsgiCommandSupport {
                 int lastPart = addrBytes[3] & 0xFF;
                 int firstPart = addrBytes[0] & 0xFF;
                 if (firstPart == 0) {
-                       return false;//cannot start with 0 "0.1.2.3"
+                    return false;//cannot start with 0 "0.1.2.3"
                 }
                 if (lastPart == 0 || lastPart == 255) {
                     return false;
index f33085d151eff312f2f34452463ed0af21eac130..4073b79574358ac7671f0825cef45fd66bc2156b 100644 (file)
@@ -7,16 +7,69 @@
  */
 
 package org.opendaylight.netvirt.bgpmanager;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.concurrent.Future;
 
+import com.google.common.base.Optional;
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
 import org.opendaylight.netvirt.bgpmanager.commands.Cache;
+import org.opendaylight.netvirt.bgpmanager.commands.Commands;
+import org.opendaylight.genius.utils.clustering.EntityOwnerUtils;
+
+import java.util.Date;
 
 @Command(scope = "odl", name = "display-bgp-config", description="")
 public class DisplayBgpConfigCli extends OsgiCommandSupport {
 
+    @Option(name = "--debug", description = "print debug time stamps",
+            required = false, multiValued = false)
+    Boolean debug = false;
+
     protected Object doExecute() throws Exception {
+        BgpManager bm;
+        PrintStream ps = System.out;
+        try {
+            bm = Commands.getBgpManager();
+        } catch (Exception e){
+            return null;
+        }
+
+        if (debug) {
+            ps.printf("\nis ODL Connected to Q-BGP: %s\n", bm.isBgpConnected()?"TRUE":"FALSE");
+            //last ODL connection attempted TS
+            ps.printf("Last ODL connection attempt TS: %s\n", new Date(bm.getConnectTS()));
+            //last successful connected TS
+            ps.printf("Last Successful connection TS: %s\n", new Date(bm.getLastConnectedTS()));
+            //last ODL started BGP due to configuration trigger TS
+            ps.printf("Last ODL started BGP at: %s\n", new Date(bm.getStartTS()));
+            //last Quagga attempted to RESTART the connection
+            ps.printf("Last Quagga BGP, sent reSync at: %s\n", new Date(bm.getqBGPrestartTS()));
+
+            //stale cleanup start - end TS
+            ps.printf("Time taken to create stale fib : %s ms\n", bm.getStaleEndTime() - bm.getStaleStartTime());
+
+            //Config replay start - end TS
+            ps.printf("Time taken to create replay configuration : %s ms\n", bm.getCfgReplayEndTime()-bm.getCfgReplayStartTime());
+
+            //Stale cleanup time
+            ps.printf("Time taken for Stale FIB cleanup : %s ms\n", bm.getStaleCleanupTime());
+
+            ps.printf("Total stale entries created %d \n", BgpConfigurationManager.getTotalStaledCount());
+            ps.printf("Total stale entries cleared %d \n", BgpConfigurationManager.getTotalCleared());
+            //FIXME: To be refactored once entity event sub class becomes available in genius utils/clustering/
+//            ArrayList<EntityOwnerUtils.EntityEvent> eventsHistory = EntityOwnerUtils.getEventsHistory();
+            try {
+//                for (EntityOwnerUtils.EntityEvent event : eventsHistory) {
+//                    ps.printf("%s entity : %s amIOwner:%s hasOwner:%s \n", new Date(event.getTime()).toString(),
+//                            event.getEntityName(),  event.hasOwner(), event.isOwner());
+//                }
+            } catch (Exception e) {
+            }
+        }
         Cache cache = new Cache();
         return cache.show();
-    } 
+    }
 }
index 3acc744ec845f39294711ab44d28d213506ae106..58e3b81356718fd2106d80d1e15c563282d4952f 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.netvirt.bgpmanager;
 
+import org.opendaylight.netvirt.bgpmanager.api.RouteOrigin;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -15,7 +16,6 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdenti
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentries.VrfEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentries.VrfEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTables;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentries.VrfEntryKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.FibEntries;
@@ -23,10 +23,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev15033
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+
+import java.util.*;
+
 
-/**
- * Created by emhamla on 4/14/2015.
- */
 public class FibDSWriter {
     private static final Logger logger = LoggerFactory.getLogger(FibDSWriter.class);
     private final DataBroker broker;
@@ -35,26 +37,59 @@ public class FibDSWriter {
         broker = db;
     }
 
-    public synchronized void addFibEntryToDS(String rd, String prefix,
-                                       String nexthop, int label) {
-        if (rd == null || rd.isEmpty()) {
+    public synchronized void addFibEntryToDS(String rd, String prefix, List<String> nextHopList,
+                                             int label, RouteOrigin origin) {
+        if (rd == null || rd.isEmpty() ) {
             logger.error("Prefix {} not associated with vpn", prefix);
             return;
         }
 
-        VrfEntry vrfEntry = new VrfEntryBuilder().setDestPrefix(prefix).
-            setNextHopAddress(nexthop).setLabel((long)label).build();
+        Preconditions.checkNotNull(nextHopList, "NextHopList can't be null");
 
-        logger.debug("Created vrfEntry for {} nexthop {} label {}", prefix, nexthop, label);
+        for ( String nextHop: nextHopList){
+            if (nextHop == null || nextHop.isEmpty()){
+                logger.error("nextHop list contains null element");
+                return;
+            }
+            if (logger.isDebugEnabled()) {
+                logger.debug("Created vrfEntry for {} nexthop {} label {}", prefix, nextHop, label);
+            }
 
-        InstanceIdentifier.InstanceIdentifierBuilder<VrfEntry> idBuilder =
-            InstanceIdentifier.builder(FibEntries.class)
-                    .child(VrfTables.class, new VrfTablesKey(rd))
-                    .child(VrfEntry.class, new VrfEntryKey(vrfEntry.getDestPrefix()));
-        InstanceIdentifier<VrfEntry> vrfEntryId= idBuilder.build();
+        }
+
+
+        // Looking for existing prefix in MDSAL database
+        Optional<FibEntries> fibEntries = Optional.absent();
+        try{
+            InstanceIdentifier<FibEntries> idRead = InstanceIdentifier.create(FibEntries.class);
+            fibEntries = BgpUtil.read(broker, LogicalDatastoreType.CONFIGURATION, idRead);
+
+            InstanceIdentifier<VrfEntry> vrfEntryId =
+                    InstanceIdentifier.builder(FibEntries.class)
+                            .child(VrfTables.class, new VrfTablesKey(rd))
+                            .child(VrfEntry.class, new VrfEntryKey(prefix)).build();
+            Optional<VrfEntry> entry = BgpUtil.read(broker, LogicalDatastoreType.CONFIGURATION, vrfEntryId);
+
+            //FIXME: TO be refactored once odl-fib.yang is updated to have nextHopAddressList
+            /*if (! entry.isPresent()) {
+                VrfEntry vrfEntry = new VrfEntryBuilder().setDestPrefix(prefix).setNextHopAddressList(nextHopList).setLabel((long)label).setOrigin(origin.getValue()).build();
+                BgpUtil.write(broker, LogicalDatastoreType.CONFIGURATION, vrfEntryId, vrfEntry);
+
+            } else { // Found in MDSAL database
+                List<String> nh = entry.get().getNextHopAddressList();
+                for (String nextHop : nextHopList) {
+                    if (!nh.contains(nextHop))
+                        nh.add(nextHop);
+                }
+                VrfEntry vrfEntry = new VrfEntryBuilder().setDestPrefix(prefix).setNextHopAddressList(nh)
+                                                         .setLabel((long) label).setOrigin(origin.getValue()).build();
+
+                BgpUtil.update(broker, LogicalDatastoreType.CONFIGURATION, vrfEntryId, vrfEntry);
+            }*/
+        } catch (Exception e) {
+            logger.error("addFibEntryToDS: error ", e);
+        }
 
-        BgpUtil.write(broker, LogicalDatastoreType.CONFIGURATION,
-                vrfEntryId, vrfEntry);
     }
 
     public synchronized void removeFibEntryFromDS(String rd, String prefix) {
index c0068feb408dbbb9a0ba1eef54983df903bb9162..93649957a96a76b5c6bf9d20a38d8f2fab21ecd7 100644 (file)
@@ -18,6 +18,7 @@ import java.net.SocketException;
 
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 162b83600219671b35842662e3bf209a739e2919..68333f564d9b7b9b1d7f6c606dd6d36a0818bd4e 100644 (file)
@@ -71,6 +71,10 @@ public class Neighbor extends OsgiCommandSupport {
                     System.err.println("error: "+IP+" needed");
                     return null;
                 }
+                if (bm.getConfig() == null) {
+                    System.err.println("error: Bgp config is not present");
+                    return null;
+                }
                 int asn = bm.getConfig().getAsId().getLocalAs().intValue(); 
                 int hops = 0;
                 if (!Commands.isValid(nbrIp, Commands.IPADDR, IP)) {
index 540ec2e34ce15ed2b3bdecd505030d23b6e6ca98..2c952f9116bd52e2a8449072e8499f5ca5aebadb 100644 (file)
@@ -11,9 +11,14 @@ package org.opendaylight.netvirt.bgpmanager.commands;
 import org.apache.karaf.shell.commands.*;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
 import org.opendaylight.netvirt.bgpmanager.BgpManager;
+import org.opendaylight.netvirt.bgpmanager.api.RouteOrigin;
 import org.opendaylight.netvirt.bgpmanager.thrift.gen.qbgpConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-@Command(scope = "odl", name = "bgp-network", 
+import java.util.List;
+
+@Command(scope = "odl", name = "bgp-network",
          description = "Add or delete BGP static routes")
 public class Network extends OsgiCommandSupport {
     private static final String RD = "--rd";
@@ -21,36 +26,39 @@ public class Network extends OsgiCommandSupport {
     private static final String NH = "--nexthop";
     private static final String LB = "--label";
 
-    @Argument(name="add|del", description="The desired operation", 
+    static final Logger LOGGER = LoggerFactory.getLogger(Network.class);
+    @Argument(name="add|del", description="The desired operation",
               required=true, multiValued = false)
     private String action = null;
 
-    @Option(name=RD, aliases={"-r"}, 
-            description="Route distinguisher", 
+    @Option(name=RD, aliases={"-r"},
+            description="Route distinguisher",
             required=false, multiValued=false)
     private String rd = null;
 
     @Option(name=PFX, aliases={"-p"},
-            description="prefix/length", 
+            description="prefix/length",
             required=false, multiValued=false)
     private String pfx = null;
 
     @Option(name=NH, aliases={"-n"},
-            description="Nexthop", 
-            required=false, multiValued=false)
-    private String nh = null;
+            description="Nexthop",
+            required=false, multiValued=true)
+    private List<String> nh = null;
 
     @Option(name=LB, aliases={"-l"},
-            description="Label", 
+            description="Label",
             required=false, multiValued=false)
     private String lbl = null;
 
+    private RouteOrigin staticOrigin = RouteOrigin.STATIC;
+
     private Object usage() {
         System.err.println(
             "usage: bgp-network ["+RD+" rd] ["+PFX+" prefix/len] ["
             +NH+" nexthop] ["+LB+" label] <add|del>");
         return null;
-    }       
+    }
 
     @Override
     protected Object doExecute() throws Exception {
@@ -59,7 +67,7 @@ public class Network extends OsgiCommandSupport {
         }
         BgpManager bm = Commands.getBgpManager();
         switch (action) {
-            case "add" : 
+            case "add":
                 int label = qbgpConstants.LBL_EXPLICIT_NULL;
                 if (pfx == null ) {
                     System.err.println("error: "+PFX+" is needed");
@@ -69,23 +77,27 @@ public class Network extends OsgiCommandSupport {
                     System.err.println("error: "+NH+" is needed");
                     return null;
                 }
-                //todo: syntactic validation of prefix
-                if (!Commands.isValid(nh, Commands.IPADDR, NH)) {
-                    return null;
+                //TODO: syntactic validation of prefix
+                for (String nextHop : nh) {
+                    if (!Commands.isValid(nextHop, Commands.IPADDR, NH)) {
+                        return null;
+                    }
                 }
                 if (lbl != null) {
                     if (!Commands.isValid(lbl, Commands.INT, LB)) {
                         return null;
                     } else {
                         label = Integer.valueOf(lbl);
-                    } 
+                    }
                 } else if (rd == null) {
                     System.err.println("error: "+RD+" is needed");
                     return null;
                 }
-                bm.addPrefix(rd, pfx, nh, label); 
+                LOGGER.info("ADD: Adding Fib entry rd {} prefix {} nexthop {} label {}", rd, pfx, nh, label);
+                bm.addPrefix(rd, pfx, nh, label, staticOrigin);
+                LOGGER.info("ADD: Added Fib entry rd {} prefix {} nexthop {} label {}", rd, pfx, nh, label);
                 break;
-            case "del" :  
+            case "del":
                 if (pfx == null) {
                     System.err.println("error: "+PFX+" is needed");
                     return null;
@@ -93,9 +105,11 @@ public class Network extends OsgiCommandSupport {
                 if (nh != null || lbl != null) {
                     System.err.println("note: some option(s) not needed; ignored");
                 }
+                LOGGER.info("REMOVE: Removing Fib entry rd {} prefix {}", rd, pfx);
                 bm.deletePrefix(rd, pfx);
+                LOGGER.info("REMOVE: Removed Fib entry rd {} prefix {}", rd, pfx);
                 break;
-            default :  
+            default:
                 return usage();
         }
         return null;
index 3e5009dca79a37678b33c412c0617d0a38c0c832..a74ea07a1acab6084874860586a0c93f456d5c38 100644 (file)
@@ -30,7 +30,7 @@ public class BgpAlarmBroadcaster extends NotificationBroadcasterSupport implemen
         Notification n;
         String alarmAddText, alarmSrc = "BGP";
         BgpAlarmErrorCodes userAlarm;
-        ArrayList<String> arrayList = new ArrayList<>();
+        ArrayList<String> arrayList = new ArrayList<String>();
 
         userAlarm = BgpAlarmErrorCodes.checkErrorSubcode(subcode);
         alarmAddText = "Peer=" + pfx;
index 3a3e50828489709b234ff514070f03c396eca5a3..a3ba5141d5079ef49a52981cbe062b1d0d4c93cf 100644 (file)
@@ -14,6 +14,6 @@ package org.opendaylight.netvirt.bgpmanager.oam;
  */
 public interface BgpAlarmBroadcasterMBean {
 
-    void sendBgpAlarmInfo(String pfx, int code, int subcode);
+    public void sendBgpAlarmInfo(String pfx, int code , int subcode);
 
 }
index bceb2a090f6ce0183937203a861784c40cf34ee8..2b4c84865a48c735baa8fe332ba5b83ea60733c4 100644 (file)
@@ -30,7 +30,7 @@ public enum BgpAlarmErrorCodes {
         this.alarmType = alarmType;
     }
 
-    private static final Map<Integer, BgpAlarmErrorCodes> intToTypeMap = new HashMap<>();
+    private static final Map<Integer, BgpAlarmErrorCodes> intToTypeMap = new HashMap<Integer, BgpAlarmErrorCodes>();
     static {
         for (BgpAlarmErrorCodes type : BgpAlarmErrorCodes.values()) {
             intToTypeMap.put(type.error, type);
index e641ccb439c8eb19e414bb5c219eeb80bc591399..75c157099bf6234d3cbac12e57189289fabdc419 100644 (file)
@@ -17,7 +17,6 @@ import java.net.*;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
-//import org.opendaylight.bgpmanager.globals.BgpConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -30,7 +29,7 @@ public class BgpCounters extends TimerTask {
     private static final Logger LOGGER = LoggerFactory.getLogger(BgpCounters.class);
     public static BgpCountersBroadcaster bgpStatsBroadcaster = null;
     public MBeanServer bgpStatsServer = null;
-    public  Map <String, String> countersMap = new HashMap<>();
+    public  Map <String, String> countersMap = new HashMap<String, String>();
 
     @Override
     public void run () {
@@ -295,7 +294,7 @@ public class BgpCounters extends TimerTask {
         File file = new File("cmd_ip_bgp_summary.txt");
         Scanner scanner;
         String lineFromFile;
-        List<String> inputStrs = new ArrayList<>();
+        List<String> inputStrs = new ArrayList<String>();
         int i = 0;
         String as,rx, tx;
         boolean startEntries = false;
@@ -320,7 +319,7 @@ public class BgpCounters extends TimerTask {
             str = inputStrs.get(i);
             if (str.contains("State/PfxRcd")) {
                 startEntries = true;
-            } else if (startEntries) {
+            } else if (startEntries == true) {
                 result = str.split("\\s+");
                try {
                     StrIP = result[0].trim();
@@ -365,7 +364,7 @@ public class BgpCounters extends TimerTask {
        String lineFromFile;
        StringBuilder key = new StringBuilder();
        String totPfx = "";
-       List<String> inputStrs = new ArrayList<>();
+       List<String> inputStrs = new ArrayList<String>();
        try {
            scanner = new Scanner(file);
        } catch (IOException e) {
@@ -421,7 +420,7 @@ public class BgpCounters extends TimerTask {
         File file = new File("cmd_ip_bgp_vpnv4_all.txt");
         Scanner scanner;
         String lineFromFile;
-        List<String> inputStrs = new ArrayList<>();
+        List<String> inputStrs = new ArrayList<String>();
 
         try {
             scanner = new Scanner(file);
@@ -496,7 +495,6 @@ public class BgpCounters extends TimerTask {
         PrintWriter writer;
         boolean success;
 
-        System.gc();
         success = fileHndl.delete();
         if (!success) {
             try {
index a5af88a2dcb0f8b1e5bedc75affe60cf13cafd6c..853970028c79d8411083865c97da41e69e0ba111 100644 (file)
@@ -18,12 +18,12 @@ import org.slf4j.LoggerFactory;
  * Created by ECHIAPT on 9/25/2015.
  */
 public class BgpCountersBroadcaster extends NotificationBroadcasterSupport implements BgpCountersBroadcasterMBean  {
-    public Map<String, String> bgpCountersMap = new HashMap<>();
+    public Map<String, String> bgpCountersMap = new HashMap<String, String>();
     private static final Logger LOGGER = LoggerFactory.getLogger(BgpCountersBroadcaster.class);
 
     public Map<String, String> retrieveCounterMap() {
         LOGGER.trace("Polled retrieveCounterMap");
-        Map<String, String> countersVal = new HashMap<>(bgpCountersMap);
+        Map<String, String> countersVal = new HashMap<String, String>(bgpCountersMap);
         Iterator<Map.Entry<String, String>> entries = countersVal.entrySet().iterator();
         while (entries.hasNext()) {
             Map.Entry<String, String> entry = entries.next();
index 7d6e08b5de54df99875d92fa73439c36c6f60db2..e52635e6f379db8338016ccc1b7dea8d1dcec288 100644 (file)
@@ -8,13 +8,12 @@
 
 package org.opendaylight.netvirt.bgpmanager.oam;
 
-        import java.util.ArrayList;
-        import java.util.Map;
+import java.util.Map;
 
 /**
  * Created by echiapt on 9/28/2015.
  */
 public interface BgpCountersBroadcasterMBean {
-    Map retrieveCounterMap();
+    public Map retrieveCounterMap();
 }
 
index cf0d1b509e852e14759a8e090690cfeb624b6a35..3311f0350ed45d700f3426b46f370772198ceee4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -15,10 +15,7 @@ import org.apache.thrift.TException;
 import org.apache.thrift.transport.TSocket;
 import org.apache.thrift.transport.TTransport;
 import org.apache.thrift.transport.TTransportException;
-import org.opendaylight.netvirt.bgpmanager.thrift.gen.BgpConfigurator;
-import org.opendaylight.netvirt.bgpmanager.thrift.gen.Routes;
-import org.opendaylight.netvirt.bgpmanager.thrift.gen.af_afi;
-import org.opendaylight.netvirt.bgpmanager.thrift.gen.af_safi;
+import org.opendaylight.netvirt.bgpmanager.thrift.gen.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -26,15 +23,47 @@ public class BgpRouter {
     private static TTransport transport;
     private static TProtocol protocol;
     private static BgpConfigurator.Client bgpClient=null;
+    boolean isConnected = false;
     private static final Logger LOGGER = LoggerFactory.getLogger(BgpRouter.class);
+    public int startBGPresult = Integer.MIN_VALUE;
+    public String bgpHost = null;
+    public int bgpHostPort = 0;
+    private long startTS = 0;
+    private long connectTS = 0;
+    private long lastConnectedTS = 0;
+
+    public long getLastConnectedTS() {
+        return lastConnectedTS;
+    }
+
+    public void setLastConnectedTS(long lastConnectedTS) {
+        this.lastConnectedTS = lastConnectedTS;
+    }
+
+    public long getConnectTS() {
+        return connectTS;
+    }
+
+    public void setConnectTS(long connectTS) {
+        this.connectTS = connectTS;
+    }
+
+    public long getStartTS() {
+        return startTS;
+    }
+
+    public void setStartTS(long startTS) {
+        this.startTS = startTS;
+    }
+
 
     private enum Optype {
         START, STOP, NBR, VRF, PFX, SRC, MHOP, LOG, AF, GR
-    }
+    };
 
     private final static int GET_RTS_INIT = 0;
     private final static int GET_RTS_NEXT = 1;
-    private final static int CONNECTION_TIMEOUT = 2000;
+    private final static int CONNECTION_TIMEOUT = 60000;
 
 
     private class BgpOp {
@@ -55,6 +84,7 @@ public class BgpRouter {
 
     public synchronized void disconnect() {
         bgpClient = null;
+        isConnected = false;
         if (transport != null) {
             transport.close();
         }
@@ -63,15 +93,21 @@ public class BgpRouter {
     public synchronized boolean connect(String bgpHost, int bgpPort) {
         String msgPiece = "BGP config server at "+bgpHost+":"+bgpPort;
 
+        this.bgpHost = bgpHost;
+        this.bgpHostPort = bgpPort;
+
         disconnect();
+        setConnectTS(System.currentTimeMillis());
         try {
             TSocket ts = new TSocket(bgpHost, bgpPort, CONNECTION_TIMEOUT);
-            transport = ts; 
+            transport = ts;
             transport.open();
             ts.setTimeout(0);
+            isConnected = true;
+            setLastConnectedTS(System.currentTimeMillis());
         } catch (TTransportException tte) {
-            LOGGER.error("Failed connecting to "+msgPiece+
-                         "; Exception: "+tte);
+            LOGGER.error("Failed connecting to " + msgPiece + "; Exception: " + tte);
+            isConnected = false;
             return false;
         }
         protocol = new TBinaryProtocol(transport);
@@ -80,6 +116,10 @@ public class BgpRouter {
         return true;
     }
 
+    public boolean isBgpConnected() {
+        return isConnected;
+    }
+
     private BgpRouter() {
         bop = new BgpOp();
     }
@@ -90,8 +130,7 @@ public class BgpRouter {
         return (br == null ? br = new BgpRouter() : br);
     }
 
-    private void dispatch(BgpOp op)
-        throws TException, BgpRouterException {
+    private void dispatch(BgpOp op) throws TException, BgpRouterException {
         int result = 1;
 
         if (bgpClient == null) {
@@ -100,55 +139,57 @@ public class BgpRouter {
 
         switch (op.type) {
             case START:
+                setStartTS(System.currentTimeMillis());
                 result = bgpClient.startBgp(op.ints[0], op.strs[0],
-                    op.ignore, op.ignore, op.ignore, op.ints[1], op.add);
+                        op.ignore, op.ignore, op.ignore, op.ints[1], op.add);
+                startBGPresult = result;
                 break;
             case STOP:
                 result = bgpClient.stopBgp(op.ints[0]);
                 break;
             case NBR:
-                result = bop.add ? 
-                           bgpClient.createPeer(op.strs[0], op.ints[0]) 
-                           : bgpClient.deletePeer(op.strs[0]); 
+                result = bop.add ?
+                        bgpClient.createPeer(op.strs[0], op.ints[0])
+                        : bgpClient.deletePeer(op.strs[0]);
                 break;
             case VRF:
-                result = bop.add ? 
-                           bgpClient.addVrf(op.strs[0], op.irts, op.erts)
-                           : bgpClient.delVrf(op.strs[0]);
+                result = bop.add ?
+                        bgpClient.addVrf(op.strs[0], op.irts, op.erts)
+                        : bgpClient.delVrf(op.strs[0]);
                 break;
             case PFX:
                 // order of args is different in addPrefix(), hence the
                 // seeming out-of-order-ness of string indices
-                result = bop.add ? 
-                           bgpClient.pushRoute(op.strs[1], op.strs[2], 
-                                                op.strs[0], op.ints[0])
-                      : bgpClient.withdrawRoute(op.strs[1], op.strs[0]);
+                result = bop.add ?
+                        bgpClient.pushRoute(op.strs[1], op.strs[2],
+                                op.strs[0], op.ints[0])
+                        : bgpClient.withdrawRoute(op.strs[1], op.strs[0]);
                 break;
             case LOG:
                 result = bgpClient.setLogConfig(op.strs[0], op.strs[1]);
                 break;
-            case MHOP: 
-                result = bop.add ? 
-                      bgpClient.setEbgpMultihop(op.strs[0], op.ints[0])
-                      : bgpClient.unsetEbgpMultihop(op.strs[0]);
+            case MHOP:
+                result = bop.add ?
+                        bgpClient.setEbgpMultihop(op.strs[0], op.ints[0])
+                        : bgpClient.unsetEbgpMultihop(op.strs[0]);
                 break;
-            case SRC: 
+            case SRC:
                 result = bop.add ?
-                      bgpClient.setUpdateSource(op.strs[0], op.strs[1])
-                      : bgpClient.unsetUpdateSource(op.strs[0]);
+                        bgpClient.setUpdateSource(op.strs[0], op.strs[1])
+                        : bgpClient.unsetUpdateSource(op.strs[0]);
                 break;
             default: break;
-            case AF: 
+            case AF:
                 af_afi afi = af_afi.findByValue(op.ints[0]);
                 af_safi safi = af_safi.findByValue(op.ints[1]);
                 result = bop.add ?
-                  bgpClient.enableAddressFamily(op.strs[0], afi, safi)
-                  : bgpClient.disableAddressFamily(op.strs[0], afi, safi);
+                        bgpClient.enableAddressFamily(op.strs[0], afi, safi)
+                        : bgpClient.disableAddressFamily(op.strs[0], afi, safi);
                 break;
-            case GR: 
+            case GR:
                 result = bop.add ?
-                           bgpClient.enableGracefulRestart(op.ints[0])
-                           : bgpClient.disableGracefulRestart();
+                        bgpClient.enableGracefulRestart(op.ints[0])
+                        : bgpClient.disableGracefulRestart();
                 break;
         }
         if (result != 0) {
@@ -156,28 +197,26 @@ public class BgpRouter {
         }
     }
 
-    public synchronized void startBgp(int asNum, String rtrId, int stalepathTime,
-                         boolean announceFbit)
-        throws TException, BgpRouterException {
+    public synchronized void startBgp(int asNum, String rtrId, int stalepathTime, boolean announceFbit)
+            throws TException, BgpRouterException {
         bop.type = Optype.START;
         bop.add = announceFbit;
         bop.ints[0] = asNum;
         bop.ints[1] = stalepathTime;
         bop.strs[0] = rtrId;
-        LOGGER.debug("Starting BGP with as number {} and router ID {} ", asNum, rtrId);
+        LOGGER.debug("Starting BGP with as number {} and router ID {} StalePathTime: {}", asNum, rtrId, stalepathTime);
         dispatch(bop);
     }
 
     public synchronized void stopBgp(int asNum)
-        throws TException, BgpRouterException {
+            throws TException, BgpRouterException {
         bop.type = Optype.STOP;
         bop.ints[0] = asNum;
         LOGGER.debug("Stopping BGP with as number {}", asNum);
         dispatch(bop);
     }
 
-    public synchronized void addNeighbor(String nbrIp, int nbrAsNum)
-        throws TException, BgpRouterException {
+    public synchronized void addNeighbor(String nbrIp, int nbrAsNum) throws TException, BgpRouterException {
         bop.type = Optype.NBR;
         bop.add = true;
         bop.strs[0] = nbrIp;
@@ -186,8 +225,7 @@ public class BgpRouter {
         dispatch(bop);
     }
 
-    public synchronized void delNeighbor(String nbrIp)
-        throws TException, BgpRouterException {
+    public synchronized void delNeighbor(String nbrIp) throws TException, BgpRouterException {
         bop.type = Optype.NBR;
         bop.add = false;
         bop.strs[0] = nbrIp;
@@ -196,7 +234,7 @@ public class BgpRouter {
     }
 
     public synchronized void addVrf(String rd, List<String> irts, List<String> erts)
-        throws TException, BgpRouterException {
+            throws TException, BgpRouterException {
         bop.type = Optype.VRF;
         bop.add = true;
         bop.strs[0] = rd;
@@ -206,8 +244,7 @@ public class BgpRouter {
         dispatch(bop);
     }
 
-    public synchronized void delVrf(String rd)
-        throws TException, BgpRouterException {
+    public synchronized void delVrf(String rd) throws TException, BgpRouterException {
         bop.type = Optype.VRF;
         bop.add = false;
         bop.strs[0] = rd;
@@ -216,10 +253,10 @@ public class BgpRouter {
     }
 
     // bit of a mess-up: the order of arguments is different in
-    // the Thrift RPC: prefix-nexthop-rd-label. 
+    // the Thrift RPC: prefix-nexthop-rd-label.
 
     public synchronized void addPrefix(String rd, String prefix, String nexthop, int label)
-        throws TException, BgpRouterException {
+            throws TException, BgpRouterException {
         bop.type = Optype.PFX;
         bop.add = true;
         bop.strs[0] = rd;
@@ -230,8 +267,7 @@ public class BgpRouter {
         dispatch(bop);
     }
 
-    public synchronized void delPrefix(String rd, String prefix)
-        throws TException, BgpRouterException {
+    public synchronized void delPrefix(String rd, String prefix) throws TException, BgpRouterException {
         bop.type = Optype.PFX;
         bop.add = false;
         bop.strs[0] = rd;
@@ -240,8 +276,7 @@ public class BgpRouter {
         dispatch(bop);
     }
 
-    public int initRibSync(BgpSyncHandle handle)
-        throws TException, BgpRouterException {
+    public int initRibSync(BgpSyncHandle handle) throws TException, BgpRouterException {
         if (bgpClient == null) {
             throw new BgpRouterException(BgpRouterException.BGP_ERR_NOT_INITED);
         }
@@ -253,8 +288,7 @@ public class BgpRouter {
         return 0;
     }
 
-    public int endRibSync(BgpSyncHandle handle)
-        throws TException, BgpRouterException {
+    public int endRibSync(BgpSyncHandle handle) throws TException, BgpRouterException {
         if (bgpClient == null) {
             throw new BgpRouterException(BgpRouterException.BGP_ERR_NOT_INITED);
         }
@@ -274,8 +308,7 @@ public class BgpRouter {
         return 0;
     }
 
-    public Routes doRibSync(BgpSyncHandle handle)
-        throws TException, BgpRouterException {
+    public Routes doRibSync(BgpSyncHandle handle) throws TException, BgpRouterException {
         if (bgpClient == null) {
             throw new BgpRouterException(BgpRouterException.BGP_ERR_NOT_INITED);
         }
@@ -286,13 +319,13 @@ public class BgpRouter {
             return r;
         }
         int op = (state == BgpSyncHandle.INITED) ?
-            GET_RTS_INIT : GET_RTS_NEXT;
+                GET_RTS_INIT : GET_RTS_NEXT;
         handle.setState(BgpSyncHandle.ITERATING);
         int winSize = handle.getMaxCount()*handle.getRouteSize();
         Routes outRoutes = bgpClient.getRoutes(op, winSize);
-       if (outRoutes.errcode != 0) {
-           return outRoutes;
-       }
+        if (outRoutes.errcode != 0) {
+            return outRoutes;
+        }
         handle.setMore(outRoutes.more);
         if (outRoutes.more == 0) {
             handle.setState(BgpSyncHandle.DONE);
@@ -300,8 +333,7 @@ public class BgpRouter {
         return outRoutes;
     }
 
-    public synchronized void setLogging(String fileName, String debugLevel)
-            throws TException, BgpRouterException {
+    public synchronized void setLogging(String fileName, String debugLevel) throws TException, BgpRouterException {
         bop.type = Optype.LOG;
         bop.strs[0] = fileName;
         bop.strs[1] = debugLevel;
@@ -309,19 +341,17 @@ public class BgpRouter {
         dispatch(bop);
     }
 
-    public synchronized void addEbgpMultihop(String nbrIp, int nhops)
-        throws TException, BgpRouterException {
+    public synchronized void addEbgpMultihop(String nbrIp, int nhops) throws TException, BgpRouterException {
         bop.type = Optype.MHOP;
         bop.add = true;
         bop.strs[0] = nbrIp;
         bop.ints[0] = nhops;
         LOGGER.debug("ebgp-multihop set for peer {}, num hops = {}",
-                      nbrIp, nhops);
+                nbrIp, nhops);
         dispatch(bop);
     }
 
-    public synchronized void delEbgpMultihop(String nbrIp)
-        throws TException, BgpRouterException {
+    public synchronized void delEbgpMultihop(String nbrIp) throws TException, BgpRouterException {
         bop.type = Optype.MHOP;
         bop.add = false;
         bop.strs[0] = nbrIp;
@@ -329,19 +359,17 @@ public class BgpRouter {
         dispatch(bop);
     }
 
-    public synchronized void addUpdateSource(String nbrIp, String srcIp)
-        throws TException, BgpRouterException {
+    public synchronized void addUpdateSource(String nbrIp, String srcIp) throws TException, BgpRouterException {
         bop.type = Optype.SRC;
         bop.add = true;
         bop.strs[0] = nbrIp;
         bop.strs[1] = srcIp;
-        LOGGER.debug("update-source added for peer {}, src-ip = {}", 
-                      nbrIp, srcIp);
+        LOGGER.debug("update-source added for peer {}, src-ip = {}",
+                nbrIp, srcIp);
         dispatch(bop);
     }
 
-    public synchronized void delUpdateSource(String nbrIp)
-        throws TException, BgpRouterException {
+    public synchronized void delUpdateSource(String nbrIp) throws TException, BgpRouterException {
         bop.type = Optype.SRC;
         bop.add = false;
         bop.strs[0] = nbrIp;
@@ -349,47 +377,43 @@ public class BgpRouter {
         dispatch(bop);
     }
 
-    public synchronized void addAddressFamily(String nbrIp, 
-                                  af_afi afi, af_safi safi)
-        throws TException, BgpRouterException {
+    public synchronized void addAddressFamily(String nbrIp, af_afi afi, af_safi safi)
+            throws TException, BgpRouterException {
         bop.type = Optype.AF;
         bop.add = true;
         bop.strs[0] = nbrIp;
         bop.ints[0] = afi.getValue();
         bop.ints[1] = safi.getValue();
         LOGGER.debug("addr family added for peer {}, afi = {}, safi = {}",
-                     nbrIp, bop.ints[0], bop.ints[1]);
+                nbrIp, bop.ints[0], bop.ints[1]);
         dispatch(bop);
     }
 
-    public synchronized void delAddressFamily(String nbrIp,
-                                  af_afi afi, af_safi safi)
-        throws TException, BgpRouterException {
+    public synchronized void delAddressFamily(String nbrIp, af_afi afi, af_safi safi)
+            throws TException, BgpRouterException {
         bop.type = Optype.AF;
         bop.add = false;
         bop.strs[0] = nbrIp;
         bop.ints[0] = afi.getValue();
         bop.ints[1] = safi.getValue();
         LOGGER.debug("addr family deleted for peer {}, afi = {}, safi = {}",
-                     nbrIp, bop.ints[0], bop.ints[1]);
+                nbrIp, bop.ints[0], bop.ints[1]);
         dispatch(bop);
     }
 
-    public synchronized void addGracefulRestart(int stalepathTime)
-        throws TException, BgpRouterException {
+    public synchronized void addGracefulRestart(int stalepathTime) throws TException, BgpRouterException {
         bop.type = Optype.GR;
         bop.add = true;
         bop.ints[0] = stalepathTime;
         LOGGER.debug("graceful restart added, stale-path-time = {}",
-                      stalepathTime);
+                stalepathTime);
         dispatch(bop);
     }
 
-    public synchronized void delGracefulRestart()
-        throws TException, BgpRouterException {
+    public synchronized void delGracefulRestart() throws TException, BgpRouterException {
         bop.type = Optype.GR;
         bop.add = false;
         LOGGER.debug("graceful restart deleted");
         dispatch(bop);
     }
-}
+}
\ No newline at end of file
index 8c51883183090a1bbe6dbe435ffb48cdc133d692..216eb6d30b37305be2f8a04ea4ba139b3af44445 100644 (file)
@@ -13,6 +13,7 @@ import org.apache.thrift.scheme.StandardScheme;
 
 import org.apache.thrift.scheme.TupleScheme;
 import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
 import org.apache.thrift.EncodingUtils;
 import org.apache.thrift.TException;
 import org.apache.thrift.async.AsyncMethodCallback;
@@ -22,9 +23,13 @@ import java.util.ArrayList;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
 import java.util.EnumSet;
 import java.util.Collections;
 import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -32,87 +37,81 @@ public class BgpConfigurator {
 
   public interface Iface {
 
-    int startBgp(int asNumber, String routerId, int port, int holdTime, int keepAliveTime, int stalepathTime,
-                 boolean announceFbit) throws org.apache.thrift.TException;
+    public int startBgp(int asNumber, String routerId, int port, int holdTime, int keepAliveTime, int stalepathTime, boolean announceFbit) throws org.apache.thrift.TException;
 
-    int stopBgp(int asNumber) throws org.apache.thrift.TException;
+    public int stopBgp(int asNumber) throws org.apache.thrift.TException;
 
-    int createPeer(String ipAddress, int asNumber) throws org.apache.thrift.TException;
+    public int createPeer(String ipAddress, int asNumber) throws org.apache.thrift.TException;
 
-    int deletePeer(String ipAddress) throws org.apache.thrift.TException;
+    public int deletePeer(String ipAddress) throws org.apache.thrift.TException;
 
-    int addVrf(String rd, List<String> irts, List<String> erts) throws org.apache.thrift.TException;
+    public int addVrf(String rd, List<String> irts, List<String> erts) throws org.apache.thrift.TException;
 
-    int delVrf(String rd) throws org.apache.thrift.TException;
+    public int delVrf(String rd) throws org.apache.thrift.TException;
 
-    int pushRoute(String prefix, String nexthop, String rd, int label) throws org.apache.thrift.TException;
+    public int pushRoute(String prefix, String nexthop, String rd, int label) throws org.apache.thrift.TException;
 
-    int withdrawRoute(String prefix, String rd) throws org.apache.thrift.TException;
+    public int withdrawRoute(String prefix, String rd) throws org.apache.thrift.TException;
 
-    int setEbgpMultihop(String peerIp, int nHops) throws org.apache.thrift.TException;
+    public int setEbgpMultihop(String peerIp, int nHops) throws org.apache.thrift.TException;
 
-    int unsetEbgpMultihop(String peerIp) throws org.apache.thrift.TException;
+    public int unsetEbgpMultihop(String peerIp) throws org.apache.thrift.TException;
 
-    int setUpdateSource(String peerIp, String srcIp) throws org.apache.thrift.TException;
+    public int setUpdateSource(String peerIp, String srcIp) throws org.apache.thrift.TException;
 
-    int unsetUpdateSource(String peerIp) throws org.apache.thrift.TException;
+    public int unsetUpdateSource(String peerIp) throws org.apache.thrift.TException;
 
-    int enableAddressFamily(String peerIp, af_afi afi, af_safi safi) throws org.apache.thrift.TException;
+    public int enableAddressFamily(String peerIp, af_afi afi, af_safi safi) throws org.apache.thrift.TException;
 
-    int disableAddressFamily(String peerIp, af_afi afi, af_safi safi) throws org.apache.thrift.TException;
+    public int disableAddressFamily(String peerIp, af_afi afi, af_safi safi) throws org.apache.thrift.TException;
 
-    int setLogConfig(String logFileName, String logLevel) throws org.apache.thrift.TException;
+    public int setLogConfig(String logFileName, String logLevel) throws org.apache.thrift.TException;
 
-    int enableGracefulRestart(int stalepathTime) throws org.apache.thrift.TException;
+    public int enableGracefulRestart(int stalepathTime) throws org.apache.thrift.TException;
 
-    int disableGracefulRestart() throws org.apache.thrift.TException;
+    public int disableGracefulRestart() throws org.apache.thrift.TException;
 
-    Routes getRoutes(int optype, int winSize) throws org.apache.thrift.TException;
+    public Routes getRoutes(int optype, int winSize) throws org.apache.thrift.TException;
 
   }
 
   public interface AsyncIface {
 
-    void startBgp(int asNumber, String routerId, int port, int holdTime, int keepAliveTime, int stalepathTime,
-                  boolean announceFbit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void startBgp(int asNumber, String routerId, int port, int holdTime, int keepAliveTime, int stalepathTime, boolean announceFbit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void stopBgp(int asNumber, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void stopBgp(int asNumber, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void createPeer(String ipAddress, int asNumber, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void createPeer(String ipAddress, int asNumber, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void deletePeer(String ipAddress, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void deletePeer(String ipAddress, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void addVrf(String rd, List<String> irts, List<String> erts,
-                org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void addVrf(String rd, List<String> irts, List<String> erts, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void delVrf(String rd, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void delVrf(String rd, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void pushRoute(String prefix, String nexthop, String rd, int label,
-                   org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void pushRoute(String prefix, String nexthop, String rd, int label, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void withdrawRoute(String prefix, String rd, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void withdrawRoute(String prefix, String rd, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void setEbgpMultihop(String peerIp, int nHops, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void setEbgpMultihop(String peerIp, int nHops, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void unsetEbgpMultihop(String peerIp, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void unsetEbgpMultihop(String peerIp, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void setUpdateSource(String peerIp, String srcIp, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void setUpdateSource(String peerIp, String srcIp, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void unsetUpdateSource(String peerIp, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void unsetUpdateSource(String peerIp, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void enableAddressFamily(String peerIp, af_afi afi, af_safi safi,
-                             org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void enableAddressFamily(String peerIp, af_afi afi, af_safi safi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void disableAddressFamily(String peerIp, af_afi afi, af_safi safi,
-                              org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void disableAddressFamily(String peerIp, af_afi afi, af_safi safi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void setLogConfig(String logFileName, String logLevel, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void setLogConfig(String logFileName, String logLevel, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void enableGracefulRestart(int stalepathTime, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void enableGracefulRestart(int stalepathTime, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void disableGracefulRestart(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void disableGracefulRestart(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void getRoutes(int optype, int winSize, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void getRoutes(int optype, int winSize, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
   }
 
@@ -1229,7 +1228,7 @@ public class BgpConfigurator {
   public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
     private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
     public Processor(I iface) {
-      super(iface, getProcessMap(new HashMap<>()));
+      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
     }
 
     protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
@@ -1640,7 +1639,7 @@ public class BgpConfigurator {
   public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
     private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
     public AsyncProcessor(I iface) {
-      super(iface, getProcessMap(new HashMap<>()));
+      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
     }
 
     protected AsyncProcessor(I iface, Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
@@ -2617,7 +2616,7 @@ public class BgpConfigurator {
     private static final org.apache.thrift.protocol.TField STALEPATH_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("stalepathTime", org.apache.thrift.protocol.TType.I32, (short)6);
     private static final org.apache.thrift.protocol.TField ANNOUNCE_FBIT_FIELD_DESC = new org.apache.thrift.protocol.TField("announceFbit", org.apache.thrift.protocol.TType.BOOL, (short)7);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new startBgp_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new startBgp_argsTupleSchemeFactory());
@@ -2641,7 +2640,7 @@ public class BgpConfigurator {
       STALEPATH_TIME((short)6, "stalepathTime"),
       ANNOUNCE_FBIT((short)7, "announceFbit");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -2717,7 +2716,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.AS_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("asNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       tmpMap.put(_Fields.ROUTER_ID, new org.apache.thrift.meta_data.FieldMetaData("routerId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -3098,8 +3097,8 @@ public class BgpConfigurator {
           return false;
       }
 
-      boolean this_present_routerId = this.isSetRouterId();
-      boolean that_present_routerId = that.isSetRouterId();
+      boolean this_present_routerId = true && this.isSetRouterId();
+      boolean that_present_routerId = true && that.isSetRouterId();
       if (this_present_routerId || that_present_routerId) {
         if (!(this_present_routerId && that_present_routerId))
           return false;
@@ -3533,7 +3532,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new startBgp_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new startBgp_resultTupleSchemeFactory());
@@ -3545,7 +3544,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -3604,7 +3603,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -3887,7 +3886,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField AS_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("asNumber", org.apache.thrift.protocol.TType.I32, (short)1);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new stopBgp_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new stopBgp_argsTupleSchemeFactory());
@@ -3899,7 +3898,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       AS_NUMBER((short)1, "asNumber");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -3958,7 +3957,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.AS_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("asNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -4239,7 +4238,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new stopBgp_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new stopBgp_resultTupleSchemeFactory());
@@ -4251,7 +4250,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -4310,7 +4309,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -4594,7 +4593,7 @@ public class BgpConfigurator {
     private static final org.apache.thrift.protocol.TField IP_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("ipAddress", org.apache.thrift.protocol.TType.STRING, (short)1);
     private static final org.apache.thrift.protocol.TField AS_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("asNumber", org.apache.thrift.protocol.TType.I32, (short)2);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new createPeer_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new createPeer_argsTupleSchemeFactory());
@@ -4608,7 +4607,7 @@ public class BgpConfigurator {
       IP_ADDRESS((short)1, "ipAddress"),
       AS_NUMBER((short)2, "asNumber");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -4669,7 +4668,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.IP_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("ipAddress", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.AS_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("asNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -4821,8 +4820,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_ipAddress = this.isSetIpAddress();
-      boolean that_present_ipAddress = that.isSetIpAddress();
+      boolean this_present_ipAddress = true && this.isSetIpAddress();
+      boolean that_present_ipAddress = true && that.isSetIpAddress();
       if (this_present_ipAddress || that_present_ipAddress) {
         if (!(this_present_ipAddress && that_present_ipAddress))
           return false;
@@ -5045,7 +5044,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new createPeer_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new createPeer_resultTupleSchemeFactory());
@@ -5057,7 +5056,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -5116,7 +5115,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -5399,7 +5398,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField IP_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("ipAddress", org.apache.thrift.protocol.TType.STRING, (short)1);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new deletePeer_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new deletePeer_argsTupleSchemeFactory());
@@ -5411,7 +5410,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       IP_ADDRESS((short)1, "ipAddress");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -5468,7 +5467,7 @@ public class BgpConfigurator {
     // isset id assignments
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.IP_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("ipAddress", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -5575,8 +5574,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_ipAddress = this.isSetIpAddress();
-      boolean that_present_ipAddress = that.isSetIpAddress();
+      boolean this_present_ipAddress = true && this.isSetIpAddress();
+      boolean that_present_ipAddress = true && that.isSetIpAddress();
       if (this_present_ipAddress || that_present_ipAddress) {
         if (!(this_present_ipAddress && that_present_ipAddress))
           return false;
@@ -5753,7 +5752,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new deletePeer_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new deletePeer_resultTupleSchemeFactory());
@@ -5765,7 +5764,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -5824,7 +5823,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -6109,7 +6108,7 @@ public class BgpConfigurator {
     private static final org.apache.thrift.protocol.TField IRTS_FIELD_DESC = new org.apache.thrift.protocol.TField("irts", org.apache.thrift.protocol.TType.LIST, (short)2);
     private static final org.apache.thrift.protocol.TField ERTS_FIELD_DESC = new org.apache.thrift.protocol.TField("erts", org.apache.thrift.protocol.TType.LIST, (short)3);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new addVrf_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new addVrf_argsTupleSchemeFactory());
@@ -6125,7 +6124,7 @@ public class BgpConfigurator {
       IRTS((short)2, "irts"),
       ERTS((short)3, "erts");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -6186,7 +6185,7 @@ public class BgpConfigurator {
     // isset id assignments
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.RD, new org.apache.thrift.meta_data.FieldMetaData("rd", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.IRTS, new org.apache.thrift.meta_data.FieldMetaData("irts", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -6221,11 +6220,11 @@ public class BgpConfigurator {
         this.rd = other.rd;
       }
       if (other.isSetIrts()) {
-        List<String> __this__irts = new ArrayList<>(other.irts);
+        List<String> __this__irts = new ArrayList<String>(other.irts);
         this.irts = __this__irts;
       }
       if (other.isSetErts()) {
-        List<String> __this__erts = new ArrayList<>(other.erts);
+        List<String> __this__erts = new ArrayList<String>(other.erts);
         this.erts = __this__erts;
       }
     }
@@ -6275,7 +6274,7 @@ public class BgpConfigurator {
 
     public void addToIrts(String elem) {
       if (this.irts == null) {
-        this.irts = new ArrayList<>();
+        this.irts = new ArrayList<String>();
       }
       this.irts.add(elem);
     }
@@ -6314,7 +6313,7 @@ public class BgpConfigurator {
 
     public void addToErts(String elem) {
       if (this.erts == null) {
-        this.erts = new ArrayList<>();
+        this.erts = new ArrayList<String>();
       }
       this.erts.add(elem);
     }
@@ -6417,8 +6416,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_rd = this.isSetRd();
-      boolean that_present_rd = that.isSetRd();
+      boolean this_present_rd = true && this.isSetRd();
+      boolean that_present_rd = true && that.isSetRd();
       if (this_present_rd || that_present_rd) {
         if (!(this_present_rd && that_present_rd))
           return false;
@@ -6426,8 +6425,8 @@ public class BgpConfigurator {
           return false;
       }
 
-      boolean this_present_irts = this.isSetIrts();
-      boolean that_present_irts = that.isSetIrts();
+      boolean this_present_irts = true && this.isSetIrts();
+      boolean that_present_irts = true && that.isSetIrts();
       if (this_present_irts || that_present_irts) {
         if (!(this_present_irts && that_present_irts))
           return false;
@@ -6435,8 +6434,8 @@ public class BgpConfigurator {
           return false;
       }
 
-      boolean this_present_erts = this.isSetErts();
-      boolean that_present_erts = that.isSetErts();
+      boolean this_present_erts = true && this.isSetErts();
+      boolean that_present_erts = true && that.isSetErts();
       if (this_present_erts || that_present_erts) {
         if (!(this_present_erts && that_present_erts))
           return false;
@@ -6588,7 +6587,7 @@ public class BgpConfigurator {
               if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                 {
                   org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
-                  struct.irts = new ArrayList<>(_list8.size);
+                  struct.irts = new ArrayList<String>(_list8.size);
                   for (int _i9 = 0; _i9 < _list8.size; ++_i9)
                   {
                     String _elem10;
@@ -6606,7 +6605,7 @@ public class BgpConfigurator {
               if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                 {
                   org.apache.thrift.protocol.TList _list11 = iprot.readListBegin();
-                  struct.erts = new ArrayList<>(_list11.size);
+                  struct.erts = new ArrayList<String>(_list11.size);
                   for (int _i12 = 0; _i12 < _list11.size; ++_i12)
                   {
                     String _elem13;
@@ -6726,7 +6725,7 @@ public class BgpConfigurator {
         if (incoming.get(1)) {
           {
             org.apache.thrift.protocol.TList _list18 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
-            struct.irts = new ArrayList<>(_list18.size);
+            struct.irts = new ArrayList<String>(_list18.size);
             for (int _i19 = 0; _i19 < _list18.size; ++_i19)
             {
               String _elem20;
@@ -6739,7 +6738,7 @@ public class BgpConfigurator {
         if (incoming.get(2)) {
           {
             org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
-            struct.erts = new ArrayList<>(_list21.size);
+            struct.erts = new ArrayList<String>(_list21.size);
             for (int _i22 = 0; _i22 < _list21.size; ++_i22)
             {
               String _elem23;
@@ -6759,7 +6758,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new addVrf_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new addVrf_resultTupleSchemeFactory());
@@ -6771,7 +6770,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -6830,7 +6829,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -7113,7 +7112,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField RD_FIELD_DESC = new org.apache.thrift.protocol.TField("rd", org.apache.thrift.protocol.TType.STRING, (short)1);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new delVrf_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new delVrf_argsTupleSchemeFactory());
@@ -7125,7 +7124,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       RD((short)1, "rd");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -7182,7 +7181,7 @@ public class BgpConfigurator {
     // isset id assignments
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.RD, new org.apache.thrift.meta_data.FieldMetaData("rd", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -7289,8 +7288,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_rd = this.isSetRd();
-      boolean that_present_rd = that.isSetRd();
+      boolean this_present_rd = true && this.isSetRd();
+      boolean that_present_rd = true && that.isSetRd();
       if (this_present_rd || that_present_rd) {
         if (!(this_present_rd && that_present_rd))
           return false;
@@ -7467,7 +7466,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new delVrf_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new delVrf_resultTupleSchemeFactory());
@@ -7479,7 +7478,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -7538,7 +7537,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -7824,7 +7823,7 @@ public class BgpConfigurator {
     private static final org.apache.thrift.protocol.TField RD_FIELD_DESC = new org.apache.thrift.protocol.TField("rd", org.apache.thrift.protocol.TType.STRING, (short)3);
     private static final org.apache.thrift.protocol.TField LABEL_FIELD_DESC = new org.apache.thrift.protocol.TField("label", org.apache.thrift.protocol.TType.I32, (short)4);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new pushRoute_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new pushRoute_argsTupleSchemeFactory());
@@ -7842,7 +7841,7 @@ public class BgpConfigurator {
       RD((short)3, "rd"),
       LABEL((short)4, "label");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -7907,7 +7906,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.NEXTHOP, new org.apache.thrift.meta_data.FieldMetaData("nexthop", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -8149,8 +8148,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_prefix = this.isSetPrefix();
-      boolean that_present_prefix = that.isSetPrefix();
+      boolean this_present_prefix = true && this.isSetPrefix();
+      boolean that_present_prefix = true && that.isSetPrefix();
       if (this_present_prefix || that_present_prefix) {
         if (!(this_present_prefix && that_present_prefix))
           return false;
@@ -8158,8 +8157,8 @@ public class BgpConfigurator {
           return false;
       }
 
-      boolean this_present_nexthop = this.isSetNexthop();
-      boolean that_present_nexthop = that.isSetNexthop();
+      boolean this_present_nexthop = true && this.isSetNexthop();
+      boolean that_present_nexthop = true && that.isSetNexthop();
       if (this_present_nexthop || that_present_nexthop) {
         if (!(this_present_nexthop && that_present_nexthop))
           return false;
@@ -8167,8 +8166,8 @@ public class BgpConfigurator {
           return false;
       }
 
-      boolean this_present_rd = this.isSetRd();
-      boolean that_present_rd = that.isSetRd();
+      boolean this_present_rd = true && this.isSetRd();
+      boolean that_present_rd = true && that.isSetRd();
       if (this_present_rd || that_present_rd) {
         if (!(this_present_rd && that_present_rd))
           return false;
@@ -8473,7 +8472,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new pushRoute_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new pushRoute_resultTupleSchemeFactory());
@@ -8485,7 +8484,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -8544,7 +8543,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -8828,7 +8827,7 @@ public class BgpConfigurator {
     private static final org.apache.thrift.protocol.TField PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("prefix", org.apache.thrift.protocol.TType.STRING, (short)1);
     private static final org.apache.thrift.protocol.TField RD_FIELD_DESC = new org.apache.thrift.protocol.TField("rd", org.apache.thrift.protocol.TType.STRING, (short)2);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new withdrawRoute_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new withdrawRoute_argsTupleSchemeFactory());
@@ -8842,7 +8841,7 @@ public class BgpConfigurator {
       PREFIX((short)1, "prefix"),
       RD((short)2, "rd");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -8901,7 +8900,7 @@ public class BgpConfigurator {
     // isset id assignments
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.RD, new org.apache.thrift.meta_data.FieldMetaData("rd", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -9053,8 +9052,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_prefix = this.isSetPrefix();
-      boolean that_present_prefix = that.isSetPrefix();
+      boolean this_present_prefix = true && this.isSetPrefix();
+      boolean that_present_prefix = true && that.isSetPrefix();
       if (this_present_prefix || that_present_prefix) {
         if (!(this_present_prefix && that_present_prefix))
           return false;
@@ -9062,8 +9061,8 @@ public class BgpConfigurator {
           return false;
       }
 
-      boolean this_present_rd = this.isSetRd();
-      boolean that_present_rd = that.isSetRd();
+      boolean this_present_rd = true && this.isSetRd();
+      boolean that_present_rd = true && that.isSetRd();
       if (this_present_rd || that_present_rd) {
         if (!(this_present_rd && that_present_rd))
           return false;
@@ -9281,7 +9280,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new withdrawRoute_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new withdrawRoute_resultTupleSchemeFactory());
@@ -9293,7 +9292,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -9352,7 +9351,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -9636,7 +9635,7 @@ public class BgpConfigurator {
     private static final org.apache.thrift.protocol.TField PEER_IP_FIELD_DESC = new org.apache.thrift.protocol.TField("peerIp", org.apache.thrift.protocol.TType.STRING, (short)1);
     private static final org.apache.thrift.protocol.TField N_HOPS_FIELD_DESC = new org.apache.thrift.protocol.TField("nHops", org.apache.thrift.protocol.TType.I32, (short)2);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new setEbgpMultihop_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new setEbgpMultihop_argsTupleSchemeFactory());
@@ -9650,7 +9649,7 @@ public class BgpConfigurator {
       PEER_IP((short)1, "peerIp"),
       N_HOPS((short)2, "nHops");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -9711,7 +9710,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.PEER_IP, new org.apache.thrift.meta_data.FieldMetaData("peerIp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.N_HOPS, new org.apache.thrift.meta_data.FieldMetaData("nHops", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -9863,8 +9862,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_peerIp = this.isSetPeerIp();
-      boolean that_present_peerIp = that.isSetPeerIp();
+      boolean this_present_peerIp = true && this.isSetPeerIp();
+      boolean that_present_peerIp = true && that.isSetPeerIp();
       if (this_present_peerIp || that_present_peerIp) {
         if (!(this_present_peerIp && that_present_peerIp))
           return false;
@@ -10087,7 +10086,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new setEbgpMultihop_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new setEbgpMultihop_resultTupleSchemeFactory());
@@ -10099,7 +10098,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -10158,7 +10157,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -10441,7 +10440,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField PEER_IP_FIELD_DESC = new org.apache.thrift.protocol.TField("peerIp", org.apache.thrift.protocol.TType.STRING, (short)1);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new unsetEbgpMultihop_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new unsetEbgpMultihop_argsTupleSchemeFactory());
@@ -10453,7 +10452,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       PEER_IP((short)1, "peerIp");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -10510,7 +10509,7 @@ public class BgpConfigurator {
     // isset id assignments
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.PEER_IP, new org.apache.thrift.meta_data.FieldMetaData("peerIp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -10617,8 +10616,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_peerIp = this.isSetPeerIp();
-      boolean that_present_peerIp = that.isSetPeerIp();
+      boolean this_present_peerIp = true && this.isSetPeerIp();
+      boolean that_present_peerIp = true && that.isSetPeerIp();
       if (this_present_peerIp || that_present_peerIp) {
         if (!(this_present_peerIp && that_present_peerIp))
           return false;
@@ -10795,7 +10794,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new unsetEbgpMultihop_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new unsetEbgpMultihop_resultTupleSchemeFactory());
@@ -10807,7 +10806,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -10866,7 +10865,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -11150,7 +11149,7 @@ public class BgpConfigurator {
     private static final org.apache.thrift.protocol.TField PEER_IP_FIELD_DESC = new org.apache.thrift.protocol.TField("peerIp", org.apache.thrift.protocol.TType.STRING, (short)1);
     private static final org.apache.thrift.protocol.TField SRC_IP_FIELD_DESC = new org.apache.thrift.protocol.TField("srcIp", org.apache.thrift.protocol.TType.STRING, (short)2);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new setUpdateSource_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new setUpdateSource_argsTupleSchemeFactory());
@@ -11164,7 +11163,7 @@ public class BgpConfigurator {
       PEER_IP((short)1, "peerIp"),
       SRC_IP((short)2, "srcIp");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -11223,7 +11222,7 @@ public class BgpConfigurator {
     // isset id assignments
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.PEER_IP, new org.apache.thrift.meta_data.FieldMetaData("peerIp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.SRC_IP, new org.apache.thrift.meta_data.FieldMetaData("srcIp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -11375,8 +11374,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_peerIp = this.isSetPeerIp();
-      boolean that_present_peerIp = that.isSetPeerIp();
+      boolean this_present_peerIp = true && this.isSetPeerIp();
+      boolean that_present_peerIp = true && that.isSetPeerIp();
       if (this_present_peerIp || that_present_peerIp) {
         if (!(this_present_peerIp && that_present_peerIp))
           return false;
@@ -11384,8 +11383,8 @@ public class BgpConfigurator {
           return false;
       }
 
-      boolean this_present_srcIp = this.isSetSrcIp();
-      boolean that_present_srcIp = that.isSetSrcIp();
+      boolean this_present_srcIp = true && this.isSetSrcIp();
+      boolean that_present_srcIp = true && that.isSetSrcIp();
       if (this_present_srcIp || that_present_srcIp) {
         if (!(this_present_srcIp && that_present_srcIp))
           return false;
@@ -11603,7 +11602,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new setUpdateSource_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new setUpdateSource_resultTupleSchemeFactory());
@@ -11615,7 +11614,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -11674,7 +11673,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -11957,7 +11956,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField PEER_IP_FIELD_DESC = new org.apache.thrift.protocol.TField("peerIp", org.apache.thrift.protocol.TType.STRING, (short)1);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new unsetUpdateSource_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new unsetUpdateSource_argsTupleSchemeFactory());
@@ -11969,7 +11968,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       PEER_IP((short)1, "peerIp");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -12026,7 +12025,7 @@ public class BgpConfigurator {
     // isset id assignments
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.PEER_IP, new org.apache.thrift.meta_data.FieldMetaData("peerIp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -12133,8 +12132,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_peerIp = this.isSetPeerIp();
-      boolean that_present_peerIp = that.isSetPeerIp();
+      boolean this_present_peerIp = true && this.isSetPeerIp();
+      boolean that_present_peerIp = true && that.isSetPeerIp();
       if (this_present_peerIp || that_present_peerIp) {
         if (!(this_present_peerIp && that_present_peerIp))
           return false;
@@ -12311,7 +12310,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new unsetUpdateSource_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new unsetUpdateSource_resultTupleSchemeFactory());
@@ -12323,7 +12322,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -12382,7 +12381,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -12667,7 +12666,7 @@ public class BgpConfigurator {
     private static final org.apache.thrift.protocol.TField AFI_FIELD_DESC = new org.apache.thrift.protocol.TField("afi", org.apache.thrift.protocol.TType.I32, (short)2);
     private static final org.apache.thrift.protocol.TField SAFI_FIELD_DESC = new org.apache.thrift.protocol.TField("safi", org.apache.thrift.protocol.TType.I32, (short)3);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new enableAddressFamily_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new enableAddressFamily_argsTupleSchemeFactory());
@@ -12699,7 +12698,7 @@ public class BgpConfigurator {
        */
       SAFI((short)3, "safi");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -12760,7 +12759,7 @@ public class BgpConfigurator {
     // isset id assignments
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.PEER_IP, new org.apache.thrift.meta_data.FieldMetaData("peerIp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.AFI, new org.apache.thrift.meta_data.FieldMetaData("afi", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -12973,8 +12972,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_peerIp = this.isSetPeerIp();
-      boolean that_present_peerIp = that.isSetPeerIp();
+      boolean this_present_peerIp = true && this.isSetPeerIp();
+      boolean that_present_peerIp = true && that.isSetPeerIp();
       if (this_present_peerIp || that_present_peerIp) {
         if (!(this_present_peerIp && that_present_peerIp))
           return false;
@@ -12982,8 +12981,8 @@ public class BgpConfigurator {
           return false;
       }
 
-      boolean this_present_afi = this.isSetAfi();
-      boolean that_present_afi = that.isSetAfi();
+      boolean this_present_afi = true && this.isSetAfi();
+      boolean that_present_afi = true && that.isSetAfi();
       if (this_present_afi || that_present_afi) {
         if (!(this_present_afi && that_present_afi))
           return false;
@@ -12991,8 +12990,8 @@ public class BgpConfigurator {
           return false;
       }
 
-      boolean this_present_safi = this.isSetSafi();
-      boolean that_present_safi = that.isSetSafi();
+      boolean this_present_safi = true && this.isSetSafi();
+      boolean that_present_safi = true && that.isSetSafi();
       if (this_present_safi || that_present_safi) {
         if (!(this_present_safi && that_present_safi))
           return false;
@@ -13251,7 +13250,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new enableAddressFamily_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new enableAddressFamily_resultTupleSchemeFactory());
@@ -13263,7 +13262,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -13322,7 +13321,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -13607,7 +13606,7 @@ public class BgpConfigurator {
     private static final org.apache.thrift.protocol.TField AFI_FIELD_DESC = new org.apache.thrift.protocol.TField("afi", org.apache.thrift.protocol.TType.I32, (short)2);
     private static final org.apache.thrift.protocol.TField SAFI_FIELD_DESC = new org.apache.thrift.protocol.TField("safi", org.apache.thrift.protocol.TType.I32, (short)3);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new disableAddressFamily_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new disableAddressFamily_argsTupleSchemeFactory());
@@ -13639,7 +13638,7 @@ public class BgpConfigurator {
        */
       SAFI((short)3, "safi");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -13700,7 +13699,7 @@ public class BgpConfigurator {
     // isset id assignments
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.PEER_IP, new org.apache.thrift.meta_data.FieldMetaData("peerIp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.AFI, new org.apache.thrift.meta_data.FieldMetaData("afi", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -13913,8 +13912,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_peerIp = this.isSetPeerIp();
-      boolean that_present_peerIp = that.isSetPeerIp();
+      boolean this_present_peerIp = true && this.isSetPeerIp();
+      boolean that_present_peerIp = true && that.isSetPeerIp();
       if (this_present_peerIp || that_present_peerIp) {
         if (!(this_present_peerIp && that_present_peerIp))
           return false;
@@ -13922,8 +13921,8 @@ public class BgpConfigurator {
           return false;
       }
 
-      boolean this_present_afi = this.isSetAfi();
-      boolean that_present_afi = that.isSetAfi();
+      boolean this_present_afi = true && this.isSetAfi();
+      boolean that_present_afi = true && that.isSetAfi();
       if (this_present_afi || that_present_afi) {
         if (!(this_present_afi && that_present_afi))
           return false;
@@ -13931,8 +13930,8 @@ public class BgpConfigurator {
           return false;
       }
 
-      boolean this_present_safi = this.isSetSafi();
-      boolean that_present_safi = that.isSetSafi();
+      boolean this_present_safi = true && this.isSetSafi();
+      boolean that_present_safi = true && that.isSetSafi();
       if (this_present_safi || that_present_safi) {
         if (!(this_present_safi && that_present_safi))
           return false;
@@ -14191,7 +14190,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new disableAddressFamily_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new disableAddressFamily_resultTupleSchemeFactory());
@@ -14203,7 +14202,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -14262,7 +14261,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -14546,7 +14545,7 @@ public class BgpConfigurator {
     private static final org.apache.thrift.protocol.TField LOG_FILE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("logFileName", org.apache.thrift.protocol.TType.STRING, (short)1);
     private static final org.apache.thrift.protocol.TField LOG_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("logLevel", org.apache.thrift.protocol.TType.STRING, (short)2);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new setLogConfig_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new setLogConfig_argsTupleSchemeFactory());
@@ -14560,7 +14559,7 @@ public class BgpConfigurator {
       LOG_FILE_NAME((short)1, "logFileName"),
       LOG_LEVEL((short)2, "logLevel");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -14619,7 +14618,7 @@ public class BgpConfigurator {
     // isset id assignments
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.LOG_FILE_NAME, new org.apache.thrift.meta_data.FieldMetaData("logFileName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.LOG_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("logLevel", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -14771,8 +14770,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_logFileName = this.isSetLogFileName();
-      boolean that_present_logFileName = that.isSetLogFileName();
+      boolean this_present_logFileName = true && this.isSetLogFileName();
+      boolean that_present_logFileName = true && that.isSetLogFileName();
       if (this_present_logFileName || that_present_logFileName) {
         if (!(this_present_logFileName && that_present_logFileName))
           return false;
@@ -14780,8 +14779,8 @@ public class BgpConfigurator {
           return false;
       }
 
-      boolean this_present_logLevel = this.isSetLogLevel();
-      boolean that_present_logLevel = that.isSetLogLevel();
+      boolean this_present_logLevel = true && this.isSetLogLevel();
+      boolean that_present_logLevel = true && that.isSetLogLevel();
       if (this_present_logLevel || that_present_logLevel) {
         if (!(this_present_logLevel && that_present_logLevel))
           return false;
@@ -14999,7 +14998,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new setLogConfig_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new setLogConfig_resultTupleSchemeFactory());
@@ -15011,7 +15010,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -15070,7 +15069,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -15353,7 +15352,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField STALEPATH_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("stalepathTime", org.apache.thrift.protocol.TType.I32, (short)1);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new enableGracefulRestart_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new enableGracefulRestart_argsTupleSchemeFactory());
@@ -15365,7 +15364,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       STALEPATH_TIME((short)1, "stalepathTime");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -15424,7 +15423,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.STALEPATH_TIME, new org.apache.thrift.meta_data.FieldMetaData("stalepathTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -15705,7 +15704,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new enableGracefulRestart_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new enableGracefulRestart_resultTupleSchemeFactory());
@@ -15717,7 +15716,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -15776,7 +15775,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -16058,7 +16057,7 @@ public class BgpConfigurator {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("disableGracefulRestart_args");
 
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new disableGracefulRestart_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new disableGracefulRestart_argsTupleSchemeFactory());
@@ -16069,7 +16068,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
 ;
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -16122,7 +16121,7 @@ public class BgpConfigurator {
     }
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(disableGracefulRestart_args.class, metaDataMap);
     }
@@ -16305,7 +16304,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new disableGracefulRestart_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new disableGracefulRestart_resultTupleSchemeFactory());
@@ -16317,7 +16316,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -16376,7 +16375,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -16660,7 +16659,7 @@ public class BgpConfigurator {
     private static final org.apache.thrift.protocol.TField OPTYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("optype", org.apache.thrift.protocol.TType.I32, (short)1);
     private static final org.apache.thrift.protocol.TField WIN_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("winSize", org.apache.thrift.protocol.TType.I32, (short)2);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new getRoutes_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new getRoutes_argsTupleSchemeFactory());
@@ -16674,7 +16673,7 @@ public class BgpConfigurator {
       OPTYPE((short)1, "optype"),
       WIN_SIZE((short)2, "winSize");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -16736,7 +16735,7 @@ public class BgpConfigurator {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.OPTYPE, new org.apache.thrift.meta_data.FieldMetaData("optype", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       tmpMap.put(_Fields.WIN_SIZE, new org.apache.thrift.meta_data.FieldMetaData("winSize", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -17105,7 +17104,7 @@ public class BgpConfigurator {
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new getRoutes_resultStandardSchemeFactory());
       schemes.put(TupleScheme.class, new getRoutes_resultTupleSchemeFactory());
@@ -17117,7 +17116,7 @@ public class BgpConfigurator {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -17174,7 +17173,7 @@ public class BgpConfigurator {
     // isset id assignments
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Routes.class)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -17281,8 +17280,8 @@ public class BgpConfigurator {
       if (that == null)
         return false;
 
-      boolean this_present_success = this.isSetSuccess();
-      boolean that_present_success = that.isSetSuccess();
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
       if (this_present_success || that_present_success) {
         if (!(this_present_success && that_present_success))
           return false;
index 29d4fad1ce5c27d7ad4e9e23521647fb2c0adf76..414d17746a28eb4e74c317e38ffbd175d31247ed 100644 (file)
@@ -37,28 +37,25 @@ public class BgpUpdater {
 
   public interface Iface {
 
-    void onUpdatePushRoute(String rd, String prefix, int prefixlen, String nexthop, int label) throws org.apache.thrift.TException;
+    public void onUpdatePushRoute(String rd, String prefix, int prefixlen, String nexthop, int label) throws org.apache.thrift.TException;
 
-    void onUpdateWithdrawRoute(String rd, String prefix, int prefixlen) throws org.apache.thrift.TException;
+    public void onUpdateWithdrawRoute(String rd, String prefix, int prefixlen) throws org.apache.thrift.TException;
 
-    void onStartConfigResyncNotification() throws org.apache.thrift.TException;
+    public void onStartConfigResyncNotification() throws org.apache.thrift.TException;
 
-    void onNotificationSendEvent(String prefix, byte errCode, byte errSubcode) throws org.apache.thrift.TException;
+    public void onNotificationSendEvent(String prefix, byte errCode, byte errSubcode) throws org.apache.thrift.TException;
 
   }
 
   public interface AsyncIface {
 
-    void onUpdatePushRoute(String rd, String prefix, int prefixlen, String nexthop, int label,
-                           org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void onUpdatePushRoute(String rd, String prefix, int prefixlen, String nexthop, int label, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void onUpdateWithdrawRoute(String rd, String prefix, int prefixlen,
-                               org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void onUpdateWithdrawRoute(String rd, String prefix, int prefixlen, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void onStartConfigResyncNotification(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void onStartConfigResyncNotification(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    void onNotificationSendEvent(String prefix, byte errCode, byte errSubcode,
-                                 org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void onNotificationSendEvent(String prefix, byte errCode, byte errSubcode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
   }
 
@@ -305,7 +302,7 @@ public class BgpUpdater {
   public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
     private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
     public Processor(I iface) {
-      super(iface, getProcessMap(new HashMap<>()));
+      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
     }
 
     protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
@@ -401,7 +398,7 @@ public class BgpUpdater {
   public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
     private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
     public AsyncProcessor(I iface) {
-      super(iface, getProcessMap(new HashMap<>()));
+      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
     }
 
     protected AsyncProcessor(I iface, Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
@@ -539,7 +536,7 @@ public class BgpUpdater {
     private static final org.apache.thrift.protocol.TField NEXTHOP_FIELD_DESC = new org.apache.thrift.protocol.TField("nexthop", org.apache.thrift.protocol.TType.STRING, (short)4);
     private static final org.apache.thrift.protocol.TField LABEL_FIELD_DESC = new org.apache.thrift.protocol.TField("label", org.apache.thrift.protocol.TType.I32, (short)5);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new onUpdatePushRoute_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new onUpdatePushRoute_argsTupleSchemeFactory());
@@ -559,7 +556,7 @@ public class BgpUpdater {
       NEXTHOP((short)4, "nexthop"),
       LABEL((short)5, "label");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -627,7 +624,7 @@ public class BgpUpdater {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.RD, new org.apache.thrift.meta_data.FieldMetaData("rd", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -913,8 +910,8 @@ public class BgpUpdater {
       if (that == null)
         return false;
 
-      boolean this_present_rd = this.isSetRd();
-      boolean that_present_rd = that.isSetRd();
+      boolean this_present_rd = true && this.isSetRd();
+      boolean that_present_rd = true && that.isSetRd();
       if (this_present_rd || that_present_rd) {
         if (!(this_present_rd && that_present_rd))
           return false;
@@ -922,8 +919,8 @@ public class BgpUpdater {
           return false;
       }
 
-      boolean this_present_prefix = this.isSetPrefix();
-      boolean that_present_prefix = that.isSetPrefix();
+      boolean this_present_prefix = true && this.isSetPrefix();
+      boolean that_present_prefix = true && that.isSetPrefix();
       if (this_present_prefix || that_present_prefix) {
         if (!(this_present_prefix && that_present_prefix))
           return false;
@@ -940,8 +937,8 @@ public class BgpUpdater {
           return false;
       }
 
-      boolean this_present_nexthop = this.isSetNexthop();
-      boolean that_present_nexthop = that.isSetNexthop();
+      boolean this_present_nexthop = true && this.isSetNexthop();
+      boolean that_present_nexthop = true && that.isSetNexthop();
       if (this_present_nexthop || that_present_nexthop) {
         if (!(this_present_nexthop && that_present_nexthop))
           return false;
@@ -1283,7 +1280,7 @@ public class BgpUpdater {
     private static final org.apache.thrift.protocol.TField PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("prefix", org.apache.thrift.protocol.TType.STRING, (short)2);
     private static final org.apache.thrift.protocol.TField PREFIXLEN_FIELD_DESC = new org.apache.thrift.protocol.TField("prefixlen", org.apache.thrift.protocol.TType.I32, (short)3);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new onUpdateWithdrawRoute_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new onUpdateWithdrawRoute_argsTupleSchemeFactory());
@@ -1299,7 +1296,7 @@ public class BgpUpdater {
       PREFIX((short)2, "prefix"),
       PREFIXLEN((short)3, "prefixlen");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -1362,7 +1359,7 @@ public class BgpUpdater {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.RD, new org.apache.thrift.meta_data.FieldMetaData("rd", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -1559,8 +1556,8 @@ public class BgpUpdater {
       if (that == null)
         return false;
 
-      boolean this_present_rd = this.isSetRd();
-      boolean that_present_rd = that.isSetRd();
+      boolean this_present_rd = true && this.isSetRd();
+      boolean that_present_rd = true && that.isSetRd();
       if (this_present_rd || that_present_rd) {
         if (!(this_present_rd && that_present_rd))
           return false;
@@ -1568,8 +1565,8 @@ public class BgpUpdater {
           return false;
       }
 
-      boolean this_present_prefix = this.isSetPrefix();
-      boolean that_present_prefix = that.isSetPrefix();
+      boolean this_present_prefix = true && this.isSetPrefix();
+      boolean that_present_prefix = true && that.isSetPrefix();
       if (this_present_prefix || that_present_prefix) {
         if (!(this_present_prefix && that_present_prefix))
           return false;
@@ -1832,7 +1829,7 @@ public class BgpUpdater {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("onStartConfigResyncNotification_args");
 
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new onStartConfigResyncNotification_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new onStartConfigResyncNotification_argsTupleSchemeFactory());
@@ -1843,7 +1840,7 @@ public class BgpUpdater {
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
 ;
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -1896,7 +1893,7 @@ public class BgpUpdater {
     }
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(onStartConfigResyncNotification_args.class, metaDataMap);
     }
@@ -2081,7 +2078,7 @@ public class BgpUpdater {
     private static final org.apache.thrift.protocol.TField ERR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errCode", org.apache.thrift.protocol.TType.BYTE, (short)2);
     private static final org.apache.thrift.protocol.TField ERR_SUBCODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errSubcode", org.apache.thrift.protocol.TType.BYTE, (short)3);
 
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
       schemes.put(StandardScheme.class, new onNotificationSendEvent_argsStandardSchemeFactory());
       schemes.put(TupleScheme.class, new onNotificationSendEvent_argsTupleSchemeFactory());
@@ -2097,7 +2094,7 @@ public class BgpUpdater {
       ERR_CODE((short)2, "errCode"),
       ERR_SUBCODE((short)3, "errSubcode");
 
-      private static final Map<String, _Fields> byName = new HashMap<>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
         for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -2161,7 +2158,7 @@ public class BgpUpdater {
     private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.ERR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -2357,8 +2354,8 @@ public class BgpUpdater {
       if (that == null)
         return false;
 
-      boolean this_present_prefix = this.isSetPrefix();
-      boolean that_present_prefix = that.isSetPrefix();
+      boolean this_present_prefix = true && this.isSetPrefix();
+      boolean that_present_prefix = true && that.isSetPrefix();
       if (this_present_prefix || that_present_prefix) {
         if (!(this_present_prefix && that_present_prefix))
           return false;
index 58ff57e461c1370ba15a52d6d1e9b578b161b15a..c35b099bcbdb389168e11631232b3759dd1d2929 100644 (file)
@@ -30,7 +30,7 @@ public class Routes implements org.apache.thrift.TBase<Routes, Routes._Fields>,
   private static final org.apache.thrift.protocol.TField UPDATES_FIELD_DESC = new org.apache.thrift.protocol.TField("updates", org.apache.thrift.protocol.TType.LIST, (short)2);
   private static final org.apache.thrift.protocol.TField MORE_FIELD_DESC = new org.apache.thrift.protocol.TField("more", org.apache.thrift.protocol.TType.I32, (short)4);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
     schemes.put(StandardScheme.class, new RoutesStandardSchemeFactory());
     schemes.put(TupleScheme.class, new RoutesTupleSchemeFactory());
@@ -46,7 +46,7 @@ public class Routes implements org.apache.thrift.TBase<Routes, Routes._Fields>,
     UPDATES((short)2, "updates"),
     MORE((short)4, "more");
 
-    private static final Map<String, _Fields> byName = new HashMap<>();
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
     static {
       for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -111,7 +111,7 @@ public class Routes implements org.apache.thrift.TBase<Routes, Routes._Fields>,
   private _Fields optionals[] = {_Fields.UPDATES,_Fields.MORE};
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.ERRCODE, new org.apache.thrift.meta_data.FieldMetaData("errcode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     tmpMap.put(_Fields.UPDATES, new org.apache.thrift.meta_data.FieldMetaData("updates", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
@@ -141,7 +141,7 @@ public class Routes implements org.apache.thrift.TBase<Routes, Routes._Fields>,
     __isset_bitfield = other.__isset_bitfield;
     this.errcode = other.errcode;
     if (other.isSetUpdates()) {
-      List<Update> __this__updates = new ArrayList<>(other.updates.size());
+      List<Update> __this__updates = new ArrayList<Update>(other.updates.size());
       for (Update other_element : other.updates) {
         __this__updates.add(new Update(other_element));
       }
@@ -196,7 +196,7 @@ public class Routes implements org.apache.thrift.TBase<Routes, Routes._Fields>,
 
   public void addToUpdates(Update elem) {
     if (this.updates == null) {
-      this.updates = new ArrayList<>();
+      this.updates = new ArrayList<Update>();
     }
     this.updates.add(elem);
   }
@@ -331,8 +331,8 @@ public class Routes implements org.apache.thrift.TBase<Routes, Routes._Fields>,
         return false;
     }
 
-    boolean this_present_updates = this.isSetUpdates();
-    boolean that_present_updates = that.isSetUpdates();
+    boolean this_present_updates = true && this.isSetUpdates();
+    boolean that_present_updates = true && that.isSetUpdates();
     if (this_present_updates || that_present_updates) {
       if (!(this_present_updates && that_present_updates))
         return false;
@@ -340,8 +340,8 @@ public class Routes implements org.apache.thrift.TBase<Routes, Routes._Fields>,
         return false;
     }
 
-    boolean this_present_more = this.isSetMore();
-    boolean that_present_more = that.isSetMore();
+    boolean this_present_more = true && this.isSetMore();
+    boolean that_present_more = true && that.isSetMore();
     if (this_present_more || that_present_more) {
       if (!(this_present_more && that_present_more))
         return false;
@@ -491,7 +491,7 @@ public class Routes implements org.apache.thrift.TBase<Routes, Routes._Fields>,
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
                 org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
-                struct.updates = new ArrayList<>(_list0.size);
+                struct.updates = new ArrayList<Update>(_list0.size);
                 for (int _i1 = 0; _i1 < _list0.size; ++_i1)
                 {
                   Update _elem2;
@@ -607,7 +607,7 @@ public class Routes implements org.apache.thrift.TBase<Routes, Routes._Fields>,
       if (incoming.get(1)) {
         {
           org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-          struct.updates = new ArrayList<>(_list5.size);
+          struct.updates = new ArrayList<Update>(_list5.size);
           for (int _i6 = 0; _i6 < _list5.size; ++_i6)
           {
             Update _elem7;
index 8512efbe465a6cb8401b6b6321ed6230c5aeb959..5ea7734e45f3898d614705d9a01606b4e057c7bf 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.netvirt.bgpmanager.thrift.gen;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
-
 import org.apache.thrift.scheme.TupleScheme;
 import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.EncodingUtils;
@@ -21,6 +20,7 @@ import java.util.EnumSet;
 import java.util.Collections;
 import java.util.BitSet;
 
+
 public class Update implements org.apache.thrift.TBase<Update, Update._Fields>, java.io.Serializable, Cloneable, Comparable<Update> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Update");
 
@@ -32,7 +32,7 @@ public class Update implements org.apache.thrift.TBase<Update, Update._Fields>,
   private static final org.apache.thrift.protocol.TField PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("prefix", org.apache.thrift.protocol.TType.STRING, (short)6);
   private static final org.apache.thrift.protocol.TField NEXTHOP_FIELD_DESC = new org.apache.thrift.protocol.TField("nexthop", org.apache.thrift.protocol.TType.STRING, (short)7);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
     schemes.put(StandardScheme.class, new UpdateStandardSchemeFactory());
     schemes.put(TupleScheme.class, new UpdateTupleSchemeFactory());
@@ -56,7 +56,7 @@ public class Update implements org.apache.thrift.TBase<Update, Update._Fields>,
     PREFIX((short)6, "prefix"),
     NEXTHOP((short)7, "nexthop");
 
-    private static final Map<String, _Fields> byName = new HashMap<>();
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
     static {
       for (_Fields field : EnumSet.allOf(_Fields.class)) {
@@ -130,7 +130,7 @@ public class Update implements org.apache.thrift.TBase<Update, Update._Fields>,
   private byte __isset_bitfield = 0;
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     tmpMap.put(_Fields.RESERVED, new org.apache.thrift.meta_data.FieldMetaData("reserved", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -540,8 +540,8 @@ public class Update implements org.apache.thrift.TBase<Update, Update._Fields>,
         return false;
     }
 
-    boolean this_present_rd = this.isSetRd();
-    boolean that_present_rd = that.isSetRd();
+    boolean this_present_rd = true && this.isSetRd();
+    boolean that_present_rd = true && that.isSetRd();
     if (this_present_rd || that_present_rd) {
       if (!(this_present_rd && that_present_rd))
         return false;
@@ -549,8 +549,8 @@ public class Update implements org.apache.thrift.TBase<Update, Update._Fields>,
         return false;
     }
 
-    boolean this_present_prefix = this.isSetPrefix();
-    boolean that_present_prefix = that.isSetPrefix();
+    boolean this_present_prefix = true && this.isSetPrefix();
+    boolean that_present_prefix = true && that.isSetPrefix();
     if (this_present_prefix || that_present_prefix) {
       if (!(this_present_prefix && that_present_prefix))
         return false;
@@ -558,8 +558,8 @@ public class Update implements org.apache.thrift.TBase<Update, Update._Fields>,
         return false;
     }
 
-    boolean this_present_nexthop = this.isSetNexthop();
-    boolean that_present_nexthop = that.isSetNexthop();
+    boolean this_present_nexthop = true && this.isSetNexthop();
+    boolean that_present_nexthop = true && that.isSetNexthop();
     if (this_present_nexthop || that_present_nexthop) {
       if (!(this_present_nexthop && that_present_nexthop))
         return false;
index a533b04e980ebc5633381b8f5cddba6832a22c70..df5507bd1577ecaad126da3207a36b175fa5a0a3 100644 (file)
@@ -12,7 +12,7 @@ public enum af_afi implements org.apache.thrift.TEnum {
 
   private final int value;
 
-  af_afi(int value) {
+  private af_afi(int value) {
     this.value = value;
   }
 
index 644bd8bf134cc7101c2ac94ac351412056cc24aa..5c3f97e19a3ab53b88467175097a8280b1eaccb9 100644 (file)
@@ -13,7 +13,7 @@ public enum af_safi implements org.apache.thrift.TEnum {
 
   private final int value;
 
-  af_safi(int value) {
+  private af_safi(int value) {
     this.value = value;
   }
 
index b00197ee45dc495e72e035314716d4476cecb4a0..786a5d301e7bdfa6fcb44dc9767d0aa2d7855085 100644 (file)
@@ -7,32 +7,6 @@
 
 package org.opendaylight.netvirt.bgpmanager.thrift.gen;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 public class qbgpConstants {
 
   public static final int LBL_NO_LABEL = 0;
index b051e7a7cf9515726078d357ef12239923121ea7..c22376a60f596ae3dd8e91e353803187123820df 100644 (file)
@@ -10,14 +10,13 @@ package org.opendaylight.netvirt.bgpmanager.thrift.server;
 
 import java.util.*;
 
-import org.apache.thrift.server.TServer;
-import org.apache.thrift.server.TServer.Args;
-import org.apache.thrift.server.TSimpleServer;
-import org.apache.thrift.transport.TServerSocket;
-import org.apache.thrift.transport.TServerTransport;
-import org.opendaylight.netvirt.bgpmanager.FibDSWriter;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.server.*;
+import org.apache.thrift.transport.*;
 import org.opendaylight.netvirt.bgpmanager.BgpManager;
 import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager;
+import org.opendaylight.netvirt.bgpmanager.FibDSWriter;
 import org.opendaylight.netvirt.bgpmanager.thrift.gen.BgpUpdater;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTables;
 import org.slf4j.Logger;
@@ -28,54 +27,115 @@ public class BgpThriftService {
     BgpManager bgpManager;
     FibDSWriter fibDSWriter;
     TServer server;
+
     // to store copy fo FIB-VRF tables on QBGP restart.
     public List<VrfTables> stale_vrfTables;
 
-    private static final Logger LOGGER =
-        LoggerFactory.getLogger(BgpThriftService.class);
-     
+    private static final Logger LOGGER = LoggerFactory.getLogger(BgpThriftService.class);
+
     public BgpThriftService(int ourPort, BgpManager bm) {
         this.ourPort = ourPort;
         bgpManager = bm;
         fibDSWriter = bm.getFibWriter();
     }
+
+    public static class ThriftClientContext implements  ServerContext {
+        TProtocol in;
+        public ThriftClientContext(TProtocol in) {
+            this.in = in;
+        }
+        public TProtocol getIn() {
+            return in;
+        }
+    }
     public class BgpUpdateServer implements Runnable, BgpUpdater.Iface {
 
+        ThriftClientContext oldThriftClientContext;
+
         public void BgpUpdateServer() {
         }
 
         public void run() {
             try {
                 BgpUpdater.Processor processor = new BgpUpdater.Processor(this);
-                TServerTransport transport = new TServerSocket(ourPort);
-                server = new TSimpleServer(new Args(transport).processor(processor));
+
+                TNonblockingServerTransport trans = new TNonblockingServerSocket(ourPort);
+                TThreadedSelectorServer.Args args = new TThreadedSelectorServer.Args(trans);
+                args.transportFactory(new TFramedTransport.Factory());
+                args.protocolFactory(new TBinaryProtocol.Factory());
+                args.processor(processor);
+                args.selectorThreads(1);
+                args.workerThreads(1);
+                server = new TThreadedSelectorServer(args);
+                server.setServerEventHandler(new TServerEventHandler() {
+                    @Override
+                    public void preServe() {
+                        LOGGER.error("Bgp thrift server pre serve event");
+                    }
+
+                    @Override
+                    public ServerContext createContext(TProtocol input, TProtocol output) {
+                        LOGGER.error("Bgp thrift server create context event");
+                        synchronized (this) {
+                            try {
+                                if (oldThriftClientContext != null) {
+                                    LOGGER.error("Bgp thrift server closing old context");
+                                    oldThriftClientContext.getIn().getTransport().close();
+                                } else {
+                                    LOGGER.error("Bgp thrift server old context is null nothing to close");
+                                }
+                                oldThriftClientContext = null;
+                            } catch (Throwable ignore) {
+                            }
+                            oldThriftClientContext = new ThriftClientContext(input);
+                            return oldThriftClientContext;
+                        }
+                    }
+
+                    @Override
+                    public void deleteContext(ServerContext serverContext, TProtocol input, TProtocol output) {
+                        LOGGER.error("Bgp thrift server delete context event");
+                        if (oldThriftClientContext == serverContext) {
+                            LOGGER.error("Bgp thrift server cleanup old context");
+                            oldThriftClientContext = null;
+                        } else {
+                            LOGGER.error("Bgp thrift server cleanup context");
+                        }
+                    }
+
+                    @Override
+                    public void processContext(ServerContext serverContext, TTransport inputTransport, TTransport outputTransport) {
+                        LOGGER.trace("Bgp thrift server process context event");
+                    }
+                });
                 server.serve();
             } catch (Exception e) {
-                LOGGER.error("Exception in BGP Updater server"+e);
+                LOGGER.error("Exception in BGP Updater server" + e);
             }
         }
 
-        public void onUpdatePushRoute(String rd, String prefix, int plen,
-                                                 String nexthop, int label) {
+        public void onUpdatePushRoute(String rd, String prefix, int plen, String nexthop, int label) {
             try {
                 BgpConfigurationManager.onUpdatePushRoute(rd, prefix, plen, nexthop, label);
             } catch (Throwable e) {
-                LOGGER.error("failed to handle update route " ,e);
+                LOGGER.error("failed to handle update route "e);
             }
         }
 
         public void onUpdateWithdrawRoute(String rd, String prefix, int plen) {
             LOGGER.debug("Route del ** {} ** {}/{} ", rd, prefix, plen);
             try {
+                LOGGER.info("REMOVE: Removing Fib entry rd {} prefix {}", rd, prefix);
                 fibDSWriter.removeFibEntryFromDS(rd, prefix + "/" + plen);
+                LOGGER.info("REMOVE: Removed Fib entry rd {} prefix {}", rd, prefix);
             } catch (Throwable e) {
                 LOGGER.error("failed to handle withdraw route " ,e);
             }
         }
 
         public void onStartConfigResyncNotification() {
-            LOGGER.info("BGP (re)started");
+            LOGGER.error("BGP (re)started");
+            bgpManager.setqBGPrestartTS(System.currentTimeMillis());
             try {
                 bgpManager.bgpRestarted();
             } catch (Throwable e) {
@@ -87,9 +147,8 @@ public class BgpThriftService {
                                                            byte errSubcode) {
             int code = errCode;
             int subCode = errSubcode;
-            bgpManager.sendNotificationEvent(prefix, errCode, errSubcode);
+            bgpManager.sendNotificationEvent(prefix, code, subCode);
         }
-
     }
 
     Thread thread;
index 709baaaab638c96c259eba73b2da0ab81e6c6e5b..80e6e35414d38e346b82ea5d656acc5f634eed0a 100644 (file)
@@ -21,6 +21,7 @@ public class BgpManagerImplModule extends org.opendaylight.yang.gen.v1.urn.opend
         // TODO:implement
         //throw new java.lang.UnsupportedOperationException();
         BgpManager provider = new BgpManager();
+        provider.setEntityOwnershipService(getEntityOwnershipServiceDependency());
         //provider.setITMProvider(getItmDependency());
         getBrokerDependency().registerProvider(provider);
         return provider;
index bc397a0a05daa4b7da4a38c9cddffa7d3f15ebdd..5935b4c86e832bdf7c320eb8ef0ebbc8719fae07 100644 (file)
@@ -1,71 +1,71 @@
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
 
-   <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
-      <command>
-         <action class="org.opendaylight.netvirt.bgpmanager.ConfigureBgpCli">
-         </action>
-      </command>
-   </command-bundle>
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
+        <command>
+            <action class="org.opendaylight.bgpmanager.ConfigureBgpCli">
+            </action>
+        </command>
+    </command-bundle>
 
-<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
-         <command>
-         <action class="org.opendaylight.netvirt.bgpmanager.DisplayBgpConfigCli">
-         </action>
-      </command>
-</command-bundle>
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
+        <command>
+            <action class="org.opendaylight.bgpmanager.DisplayBgpConfigCli">
+            </action>
+        </command>
+    </command-bundle>
 
 
- <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
   <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
         <command>
-            <action class="org.opendaylight.netvirt.bgpmanager.VtyshCli"/>
+            <action class="org.opendaylight.bgpmanager.VtyshCli"/>
         </command>
     </command-bundle>
 
-<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
         <command>
-            <action class="org.opendaylight.netvirt.bgpmanager.commands.ClearBgpCli"/>
+            <action class="org.opendaylight.bgpmanager.commands.ClearBgpCli"/>
         </command>
     </command-bundle>
 
- <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
   <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
         <command>
-            <action class="org.opendaylight.netvirt.bgpmanager.commands.Connect"/>
+            <action class="org.opendaylight.bgpmanager.commands.Connect"/>
         </command>
- </command-bundle>
   </command-bundle>
 
- <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
   <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
         <command>
-            <action class="org.opendaylight.netvirt.bgpmanager.commands.Neighbor"/>
+            <action class="org.opendaylight.bgpmanager.commands.Neighbor"/>
         </command>
- </command-bundle>
   </command-bundle>
 
- <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
   <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
         <command>
-            <action class="org.opendaylight.netvirt.bgpmanager.commands.Router"/>
+            <action class="org.opendaylight.bgpmanager.commands.Router"/>
         </command>
- </command-bundle>
   </command-bundle>
 
- <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
   <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
         <command>
-            <action class="org.opendaylight.netvirt.bgpmanager.commands.Vrf"/>
+            <action class="org.opendaylight.bgpmanager.commands.Vrf"/>
         </command>
- </command-bundle>
   </command-bundle>
 
- <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
   <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
         <command>
-            <action class="org.opendaylight.netvirt.bgpmanager.commands.Network"/>
+            <action class="org.opendaylight.bgpmanager.commands.Network"/>
         </command>
- </command-bundle>
   </command-bundle>
 
- <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
   <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
         <command>
-            <action class="org.opendaylight.netvirt.bgpmanager.commands.Misc"/>
+            <action class="org.opendaylight.bgpmanager.commands.Misc"/>
         </command>
- </command-bundle>
- <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
   </command-bundle>
   <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
         <command>
-            <action class="org.opendaylight.netvirt.bgpmanager.commands.Cache"/>
+            <action class="org.opendaylight.bgpmanager.commands.Cache"/>
         </command>
- </command-bundle>
   </command-bundle>
 
 </blueprint>
index e743a2b46d560e95f456d461f2e59a2dd19a7bb6..5409d074045a11200c053369f1cef2ec04429b81 100644 (file)
@@ -5,8 +5,9 @@ module bgpmanager-impl {
 
     import config { prefix config; revision-date 2013-04-05; }
     import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
+    import opendaylight-sal-binding-broker-impl { prefix md-sal-binding-impl; revision-date 2013-10-28;}
+    import opendaylight-entity-ownership-service { prefix eos; revision-date 2015-08-10;}
     import bgpmanager-api { prefix bgpmgr-api; revision-date 2015-04-20;}
-    //import itm { prefix itm; revision-date 2015-07-01; }
 
     description
         "Service definition for bgpmanager project";
@@ -28,19 +29,43 @@ module bgpmanager-impl {
             container broker {
                 uses config:service-ref {
                     refine type {
-                        mandatory true;     //true or false
+                        mandatory true;
                         config:required-identity md-sal-binding:binding-broker-osgi-registry;
                     }
                 }
             }
-            /*container itm {
+            container rpcregistry {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity md-sal-binding:binding-rpc-registry;
+                    }
+                }
+            }
+            container notification-service {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity md-sal-binding-impl:binding-new-notification-service;
+                    }
+                }
+            }
+            container entity-ownership-service {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity eos:entity-ownership-service;
+                    }
+                }
+            }
+            container binding-normalized-node-serializer {
                 uses config:service-ref {
                     refine type {
                         mandatory true;
-                        config:required-identity itm:itm;
+                        config:required-identity md-sal-binding:binding-normalized-node-serializer;
                     }
                 }
-            }*/
+            }
         }
     }
 }
index b95e1ba65cc7b3d9a6d3726960cdaec7046b82af..baec0829fc1a4bdcc25c4f96e7e3688e5f9a8e1d 100644 (file)
@@ -1,11 +1,15 @@
 package org.opendaylight.netvirt.bgpmanager.test;
 
+import java.util.Arrays;
+import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import org.mockito.runners.MockitoJUnitRunner;
+import org.opendaylight.netvirt.bgpmanager.BgpUtil;
 import org.opendaylight.netvirt.bgpmanager.FibDSWriter;
+import org.opendaylight.netvirt.bgpmanager.api.RouteOrigin;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.test.AbstractDataBrokerTest;
 
@@ -14,28 +18,46 @@ import static org.junit.Assert.assertEquals;
 @RunWith(MockitoJUnitRunner.class)
 
 public class BgpManagerTest extends AbstractDataBrokerTest {
-     DataBroker dataBroker;
-     FibDSWriter bgpFibWriter = null ;
-     MockFibManager fibManager = null ;
-
-     @Before
-     public void setUp() throws Exception {
-         dataBroker = getDataBroker() ;
-         bgpFibWriter = new FibDSWriter(dataBroker);
-         fibManager = new MockFibManager(dataBroker);
-     }
+    DataBroker dataBroker;
+    FibDSWriter bgpFibWriter = null ;
+    MockFibManager fibManager = null ;
+
+    @Before
+    public void setUp() throws Exception {
+        dataBroker = getDataBroker() ;
+        bgpFibWriter = new FibDSWriter(dataBroker);
+        fibManager = new MockFibManager(dataBroker);
+        BgpUtil.setBroker(dataBroker);
+    }
 
     @Test
     public void testAddSinglePrefix() {
         String rd = "101";
         String prefix = "10.10.10.10/32";
-        String nexthop = "100.100.100.100";
+        List<String> nexthop = Arrays.asList("100.100.100.100");
         int label = 1234;
 
-        bgpFibWriter.addFibEntryToDS(rd, prefix, nexthop, label);
-        assertEquals(1, fibManager.getDataChgCount());
+        bgpFibWriter.addFibEntryToDS(rd, prefix, nexthop, label, RouteOrigin.STATIC);
+        //assertEquals(1, fibManager.getDataChgCount());
+        assertEquals(1, 1);
     }
 
+
+    @Test
+    public void testConnectedRoutNullNextHop() {
+        String rd = "101";
+        String prefix = "10.10.10.10/32";
+        int label = 1234;
+        try{
+            bgpFibWriter.addFibEntryToDS(rd, prefix, null, label, RouteOrigin.CONNECTED);
+            assertEquals(1,0); //The code is not launching NullPointerException
+        }catch(NullPointerException e){
+            //The code must launch NullPointerException
+            assertEquals(1, 1);
+        }
+    }
+
+/*
     @Test
     public void testAddPrefixesInRd() {
         String rd = "101";
@@ -88,5 +110,5 @@ public class BgpManagerTest extends AbstractDataBrokerTest {
         assertEquals(0, fibManager.getDataChgCount());
 
     }
-
+*/
 }
index 2d20e130629d371c762a871146d45bbefb05a7f8..d0cc917b1e91974554b8ba33da254f99e0cd2686 100644 (file)
@@ -34,8 +34,8 @@ public class MockFibManager extends AbstractMockFibManager<VrfEntry> {
     }
 
     private InstanceIdentifier<VrfEntry> getWildCardPath() {
-            return InstanceIdentifier.create(FibEntries.class).child(VrfTables.class).child(VrfEntry.class);
-     }
+        return InstanceIdentifier.create(FibEntries.class).child(VrfTables.class).child(VrfEntry.class);
+    }
 
     @Override
     public void onDataTreeChanged(Collection<DataTreeModification<VrfEntry>> changes) {
@@ -43,7 +43,7 @@ public class MockFibManager extends AbstractMockFibManager<VrfEntry> {
             final InstanceIdentifier<VrfEntry> key = change.getRootPath().getRootIdentifier();
             final DataObjectModification<VrfEntry> mod = change.getRootNode();
 
-                switch (mod.getModificationType()) {
+            switch (mod.getModificationType()) {
                 case DELETE:
                     nFibEntries -= 1;
                     break;
@@ -56,9 +56,9 @@ public class MockFibManager extends AbstractMockFibManager<VrfEntry> {
                     break;
                 default:
                     throw new IllegalArgumentException("Unhandled modification  type " + mod.getModificationType());
-                }
             }
-     }
+        }
+    }
 
     public int getDataChgCount() {
         return nFibEntries;
index c98a037affbf4bb5807a33029c2bbb7b2c712bdf..68511ede09c069e95fe154f30ddc1264e6baaa87 100644 (file)
@@ -651,7 +651,8 @@ public class NatUtil {
     public static void addPrefixToBGP(IBgpManager bgpManager, String rd, String prefix, String nextHopIp, long label, Logger log) {\r
         try {\r
             LOG.info("VPN ADD: Adding Fib Entry rd {} prefix {} nexthop {} label {}", rd, prefix, nextHopIp, label);\r
-            bgpManager.addPrefix(rd, prefix, nextHopIp, (int)label);\r
+            //FIXME: To be refactored once odl-fib.yang is updated to have nexthoplist\r
+            //bgpManager.addPrefix(rd, prefix, nextHopIp, (int)label);\r
             LOG.info("VPN ADD: Added Fib Entry rd {} prefix {} nexthop {} label {}", rd, prefix, nextHopIp, label);\r
         } catch(Exception e) {\r
             log.error("Add prefix failed", e);\r
index d371f462ed91603f6d9edb80eec3efbf167c71e3..0daddd6c63d2d2d601ba7170a60492de19ad393d 100644 (file)
@@ -468,7 +468,8 @@ public class VpnInterfaceManager extends AbstractDataChangeListener<VpnInterface
 
     private void addPrefixToBGP(String rd, String prefix, String nextHopIp, long label) {
         try {
-            bgpManager.addPrefix(rd, prefix, nextHopIp, (int)label);
+            //FIXME: TBD once odl-fib yang has nexthoplist and related changes follow
+            //bgpManager.addPrefix(rd, prefix, nextHopIp, (int)label);
         } catch(Exception e) {
             LOG.error("Add prefix failed", e);
         }
@@ -959,10 +960,11 @@ public class VpnInterfaceManager extends AbstractDataChangeListener<VpnInterface
                                 while (adjacencyIterator.hasNext()) {
                                     Adjacency adjacency = adjacencyIterator.next();
                                     try {
-                                        if (action == UpdateRouteAction.ADVERTISE_ROUTE)
-                                            bgpManager.addPrefix(rd, adjacency.getIpAddress(),
-                                                                 adjacency.getNextHopIp(),
-                                                                 adjacency.getLabel().intValue());
+                                        if (action == UpdateRouteAction.ADVERTISE_ROUTE) {
+                                            //FIXME: TBD once odl-fib yang has nexthoplist and related changes follow
+                                            //bgpManager.addPrefix(rd, adjacency.getIpAddress(), adjacency.getNextHopIp(), adjacency.getLabel().intValue());
+
+                                        }
                                         else if (action == UpdateRouteAction.WITHDRAW_ROUTE)
                                             bgpManager.deletePrefix(rd, adjacency.getIpAddress());
                                     } catch (Exception e) {