bgp: mark parameters of hc2vpp RouteWriters as @NonNull 57/13257/1
authorMarek Gradzki <mgradzki@cisco.com>
Wed, 27 Jun 2018 19:13:29 +0000 (21:13 +0200)
committerMarek Gradzki <mgradzki@cisco.com>
Wed, 27 Jun 2018 19:13:31 +0000 (21:13 +0200)
Requires https://gerrit.fd.io/r/#/c/13254/

Change-Id: Icacf161f1c47f9471f19b0d89e5f2396942537ec
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
bgp/bgp-prefix-sid/src/main/java/io/fd/hc2vpp/bgp/prefix/sid/BgpPrefixSidMplsWriter.java
bgp/inet/src/main/java/io/fd/hc2vpp/bgp/inet/Ipv4Writer.java
bgp/inet/src/main/java/io/fd/hc2vpp/bgp/inet/Ipv6Writer.java

index 472642e..f62e035 100644 (file)
@@ -24,7 +24,6 @@ import io.fd.honeycomb.translate.write.WriteFailedException;
 import io.fd.vpp.jvpp.core.dto.MplsRouteAddDel;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
 import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.labeled.unicast.routes.LabeledUnicastRoutes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.labeled.unicast.routes.list.LabeledUnicastRoute;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.BgpRib;
@@ -60,7 +59,7 @@ final class BgpPrefixSidMplsWriter
 
     @Override
     public void create(@Nonnull final InstanceIdentifier<LabeledUnicastRoute> id,
-                       @Nullable final LabeledUnicastRoute route)
+                       @Nonnull final LabeledUnicastRoute route)
         throws WriteFailedException.CreateFailedException {
         LOG.debug("Translating id={}, route={}", id, route);
         // Compute label based on BGP Prefix SID TLVs and add following VPP FIB entries
@@ -82,7 +81,7 @@ final class BgpPrefixSidMplsWriter
 
     @Override
     public void delete(@Nonnull final InstanceIdentifier<LabeledUnicastRoute> id,
-                       @Nullable final LabeledUnicastRoute route)
+                       @Nonnull final LabeledUnicastRoute route)
         throws WriteFailedException.DeleteFailedException {
         LOG.debug("Removing id={}, route={}", id, route);
         // Remove non-eos VPP MPLS FIB entry:
@@ -101,8 +100,8 @@ final class BgpPrefixSidMplsWriter
 
     @Override
     public void update(@Nonnull final InstanceIdentifier<LabeledUnicastRoute> id,
-                       @Nullable final LabeledUnicastRoute routeBefore,
-                       @Nullable final LabeledUnicastRoute routeAfter)
+                       @Nonnull final LabeledUnicastRoute routeBefore,
+                       @Nonnull final LabeledUnicastRoute routeAfter)
         throws WriteFailedException.UpdateFailedException {
         throw new WriteFailedException.UpdateFailedException(id, routeBefore, routeAfter,
             new UnsupportedOperationException("Operation not supported"));
index 60af916..c628d38 100644 (file)
@@ -26,15 +26,14 @@ import io.fd.honeycomb.translate.write.WriteFailedException;
 import io.fd.vpp.jvpp.core.dto.IpAddDelRoute;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
 import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev171207.ipv4.routes.Ipv4Routes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev171207.ipv4.routes.ipv4.routes.Ipv4Route;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.BgpRib;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.bgp.rib.Rib;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.bgp.rib.rib.LocRib;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.Tables;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.BgpRib;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.CNextHop;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.Ipv4NextHopCase;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -58,7 +57,7 @@ final class Ipv4Writer implements RouteWriter<Ipv4Route>, Ipv4Translator, JvppRe
 
     @Override
     public void create(@Nonnull final InstanceIdentifier<Ipv4Route> id,
-                       @Nullable final Ipv4Route route)
+                       @Nonnull final Ipv4Route route)
         throws WriteFailedException.CreateFailedException {
         final IpAddDelRoute request = request(route, true);
         LOG.debug("Translating id={}, route={} to {}", id, route, request);
@@ -68,7 +67,7 @@ final class Ipv4Writer implements RouteWriter<Ipv4Route>, Ipv4Translator, JvppRe
 
     @Override
     public void delete(@Nonnull final InstanceIdentifier<Ipv4Route> id,
-                       @Nullable final Ipv4Route route)
+                       @Nonnull final Ipv4Route route)
         throws WriteFailedException.DeleteFailedException {
         LOG.debug("Removing id={}, route={}", id, route);
         getReplyForDelete(vppApi.ipAddDelRoute(request(route, false)).toCompletableFuture(), id);
@@ -77,8 +76,8 @@ final class Ipv4Writer implements RouteWriter<Ipv4Route>, Ipv4Translator, JvppRe
 
     @Override
     public void update(@Nonnull final InstanceIdentifier<Ipv4Route> id,
-                       @Nullable final Ipv4Route routeBefore,
-                       @Nullable final Ipv4Route routeAfter)
+                       @Nonnull final Ipv4Route routeBefore,
+                       @Nonnull final Ipv4Route routeAfter)
         throws WriteFailedException.UpdateFailedException {
         throw new WriteFailedException.UpdateFailedException(id, routeBefore, routeAfter,
             new UnsupportedOperationException("Operation not supported"));
index 45c147a..f3712e2 100644 (file)
@@ -26,7 +26,6 @@ import io.fd.honeycomb.translate.write.WriteFailedException;
 import io.fd.vpp.jvpp.core.dto.IpAddDelRoute;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
 import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev171207.ipv6.routes.Ipv6Routes;
@@ -58,7 +57,7 @@ final class Ipv6Writer implements RouteWriter<Ipv6Route>, Ipv6Translator, JvppRe
 
     @Override
     public void create(@Nonnull final InstanceIdentifier<Ipv6Route> id,
-                       @Nullable final Ipv6Route route)
+                       @Nonnull final Ipv6Route route)
         throws WriteFailedException.CreateFailedException {
         final IpAddDelRoute request = request(route, true);
         LOG.debug("Translating id={}, route={} to {}", id, route, request);
@@ -68,7 +67,7 @@ final class Ipv6Writer implements RouteWriter<Ipv6Route>, Ipv6Translator, JvppRe
 
     @Override
     public void delete(@Nonnull final InstanceIdentifier<Ipv6Route> id,
-                       @Nullable final Ipv6Route route)
+                       @Nonnull final Ipv6Route route)
         throws WriteFailedException.DeleteFailedException {
         LOG.debug("Removing id={}, route={}", id, route);
         getReplyForDelete(vppApi.ipAddDelRoute(request(route, false)).toCompletableFuture(), id);
@@ -77,8 +76,8 @@ final class Ipv6Writer implements RouteWriter<Ipv6Route>, Ipv6Translator, JvppRe
 
     @Override
     public void update(@Nonnull final InstanceIdentifier<Ipv6Route> id,
-                       @Nullable final Ipv6Route routeBefore,
-                       @Nullable final Ipv6Route routeAfter)
+                       @Nonnull final Ipv6Route routeBefore,
+                       @Nonnull final Ipv6Route routeAfter)
         throws WriteFailedException.UpdateFailedException {
         throw new WriteFailedException.UpdateFailedException(id, routeBefore, routeAfter,
             new UnsupportedOperationException("Operation not supported"));