Remove addNeighbor(ip,as) 01/54001/3
authorJose-Santos Pulido Garcia <jose.santos.pulido.garcia@ericsson.com>
Tue, 28 Mar 2017 18:09:22 +0000 (20:09 +0200)
committerSam Hague <shague@redhat.com>
Wed, 29 Mar 2017 15:47:36 +0000 (15:47 +0000)
Methods 'addNeighbor(ip,as)' of classes 'BgpRouter',
'BgpConfigurationManager', and 'BgpManager' are no longer
used.

Change-Id: If7e36c822d89827d6383fcf5352240601b22ae5d
Signed-off-by: Jose-Santos Pulido Garcia <jose.santos.pulido.garcia@ericsson.com>
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/thrift/client/BgpRouter.java

index 266fb78c122c066de72e2cb53b12eb7aaed696d1..a1d543917f6b3681ab13bbfbdb161bf8e4b08091 100755 (executable)
@@ -2013,14 +2013,6 @@ public class BgpConfigurationManager {
 
     public synchronized void addNeighbor(
             String nbrIp, long remoteAs, @Nullable final TcpMd5SignaturePasswordType md5Secret) {
-        addNeighborAux(nbrIp, remoteAs, md5Secret);
-    } // public addNeighbor(nbrIp, remoteAs, md5Secret)
-
-    public synchronized void addNeighbor(String nbrIp, long remoteAs) {
-        addNeighborAux(nbrIp, remoteAs, null);
-    } // public addNeighbor(nbrIp, remoteAs)
-
-    private void addNeighborAux(String nbrIp, long remoteAs, @Nullable final TcpMd5SignaturePasswordType md5Secret) {
         Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
         InstanceIdentifier.InstanceIdentifierBuilder<Neighbors> iib =
                 InstanceIdentifier.builder(Bgp.class)
@@ -2033,7 +2025,7 @@ public class BgpConfigurationManager {
         Neighbors dto = new NeighborsBuilder().setAddress(nbrAddr)
                 .setRemoteAs(remoteAs).setTcpSecurityOption(tcpSecOption).build();
         update(iid, dto);
-    } // private addNeighborAux(nbrIp, remoteAs, md5Secret)
+    } // public addNeighbor(nbrIp, remoteAs, md5Secret)
 
     public synchronized void addUpdateSource(String nbrIp, String srcIp) {
         Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
index 52d395671d92d6b88d411867095c844b1e90b468..394ea934a8ee8ca15ef75e669b52c514f4036ee3 100644 (file)
@@ -73,10 +73,6 @@ public class BgpManager implements AutoCloseable, IBgpManager {
         bcm.delGracefulRestart();
     }
 
-    public void addNeighbor(String ipAddress, long asNum) throws TException {
-        bcm.addNeighbor(ipAddress, asNum);
-    }
-
     public void addNeighbor(String ipAddress, long asNum,
             @Nullable final TcpMd5SignaturePasswordType md5Password) throws TException {
         bcm.addNeighbor(ipAddress, asNum, md5Password);
index 0b5a292b0b4ccee2f1618af7779e032561c83c9a..3dfec7b109334d37e5b8fed7fe70238ac3c9aee6 100644 (file)
@@ -273,26 +273,20 @@ public class BgpRouter {
         dispatch(bop);
     }
 
-    public synchronized void addNeighbor(String nbrIp, long nbrAsNum) throws TException, BgpRouterException {
-        LOGGER.debug("Adding BGP Neighbor {} with as number {} ", nbrIp, nbrAsNum);
-        addNeighborAux(nbrIp, nbrAsNum, null);
-    }
-
     public synchronized void addNeighbor(String nbrIp, long nbrAsNum, @Nullable String md5Secret)
             throws TException, BgpRouterException {
-        LOGGER.debug("Adding BGP Neighbor {} with as number {} and MD5 secret {}", nbrIp, nbrAsNum, md5Secret);
-        addNeighborAux(nbrIp, nbrAsNum, md5Secret);
-    } // public addNeighbor( nbrIp, nbrAsNum, md5Secret )
-
-    private void addNeighborAux(String nbrIp, long nbrAsNum, @Nullable String md5Secret)
-            throws TException, BgpRouterException {
+        if (md5Secret == null) {
+            LOGGER.debug("Adding BGP Neighbor {} with as number {} ", nbrIp, nbrAsNum);
+        } else {
+            LOGGER.debug("Adding BGP Neighbor {} with as number {} and MD5 secret {}", nbrIp, nbrAsNum, md5Secret);
+        }
         bop.type = Optype.NBR;
         bop.add = true;
         bop.strs[0] = nbrIp;
         bop.asNumber = nbrAsNum;
         bop.strs[1] = md5Secret;
         dispatch(bop);
-    } // private addNeighborAux
+    } // public addNeighbor( nbrIp, nbrAsNum, md5Secret )
 
     public synchronized void delNeighbor(String nbrIp) throws TException, BgpRouterException {
         bop.type = Optype.NBR;