summaryrefslogtreecommitdiffstats
path: root/bgp/inet
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-06-27 21:13:29 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-06-27 21:13:31 +0200
commit6e00ba6bc6ead5b6d5215cf89cdfeaec08eac9d4 (patch)
tree2e72673c60119996c15c154326391813f2c58072 /bgp/inet
parentfdc7c0fec54aa81ec251889deb5756bf0bc9e906 (diff)
bgp: mark parameters of hc2vpp RouteWriters as @NonNull
Requires https://gerrit.fd.io/r/#/c/13254/ Change-Id: Icacf161f1c47f9471f19b0d89e5f2396942537ec Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'bgp/inet')
-rw-r--r--bgp/inet/src/main/java/io/fd/hc2vpp/bgp/inet/Ipv4Writer.java11
-rw-r--r--bgp/inet/src/main/java/io/fd/hc2vpp/bgp/inet/Ipv6Writer.java9
2 files changed, 9 insertions, 11 deletions
diff --git a/bgp/inet/src/main/java/io/fd/hc2vpp/bgp/inet/Ipv4Writer.java b/bgp/inet/src/main/java/io/fd/hc2vpp/bgp/inet/Ipv4Writer.java
index 60af9166e..c628d3844 100644
--- a/bgp/inet/src/main/java/io/fd/hc2vpp/bgp/inet/Ipv4Writer.java
+++ b/bgp/inet/src/main/java/io/fd/hc2vpp/bgp/inet/Ipv4Writer.java
@@ -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"));
diff --git a/bgp/inet/src/main/java/io/fd/hc2vpp/bgp/inet/Ipv6Writer.java b/bgp/inet/src/main/java/io/fd/hc2vpp/bgp/inet/Ipv6Writer.java
index 45c147af3..f3712e2f4 100644
--- a/bgp/inet/src/main/java/io/fd/hc2vpp/bgp/inet/Ipv6Writer.java
+++ b/bgp/inet/src/main/java/io/fd/hc2vpp/bgp/inet/Ipv6Writer.java
@@ -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"));