HONEYCOMB-289 - Type-aware read customizers 04/3904/2
authorJan Srnicek <[email protected]>
Mon, 21 Nov 2016 13:44:15 +0000 (14:44 +0100)
committerJan Srnicek <[email protected]>
Thu, 24 Nov 2016 07:48:49 +0000 (07:48 +0000)
Refactoring due to https://gerrit.fd.io/r/#/c/3898/

Change-Id: I3ddcc06aca0a730db9fd727a3d2b10cd085f870e
Signed-off-by: Jan Srnicek <[email protected]>
18 files changed:
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/AdjacencyCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/BridgeDomainSubtableCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/InterfaceCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/ItrRemoteLocatorSetCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapResolverCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/RemoteMappingCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/VniTableCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/VrfSubtableCustomizer.java
nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/NatReaderFactory.java
nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/ifc/IfcNatReaderFactory.java
nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/read/ifc/InterfaceInboundNatCustomizerTest.java
nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/read/ifc/InterfaceOutboundNatCustomizerTest.java
v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/ip/Ipv4AddressCustomizer.java
v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/ip/SubInterfaceIpv4AddressCustomizer.java
v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/ip/Ipv4AddressCustomizerTest.java
v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/ip/SubInterfaceIpv4AddressCustomizerTest.java

index 710bb8d..a7167c3 100755 (executable)
@@ -20,6 +20,8 @@ package io.fd.hc2vpp.lisp.translate.read;
 import static com.google.common.base.Preconditions.checkNotNull;
 
 import com.google.common.base.Optional;
+import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
+import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
 import io.fd.hc2vpp.lisp.context.util.AdjacenciesMappingContext;
 import io.fd.hc2vpp.lisp.context.util.EidMappingContext;
 import io.fd.hc2vpp.lisp.translate.read.dump.executor.params.MappingsDumpParams;
@@ -31,8 +33,6 @@ import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
 import io.fd.honeycomb.translate.util.RWUtils;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
 import io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor;
-import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
-import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
 import io.fd.vpp.jvpp.core.dto.LispAdjacenciesGet;
 import io.fd.vpp.jvpp.core.dto.LispAdjacenciesGetReply;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
@@ -70,6 +70,7 @@ public class AdjacencyCustomizer extends FutureJVppCustomizer
         super(futureJvpp);
         dumpCacheManager = new DumpCacheManager.DumpCacheManagerBuilder<LispAdjacenciesGetReply, AdjacencyDumpParams>()
                 .withExecutor(createExecutor())
+                .acceptOnly(LispAdjacenciesGetReply.class)
                 .build();
 
         this.adjacenciesMappingContext =
@@ -155,19 +156,32 @@ public class AdjacencyCustomizer extends FutureJVppCustomizer
         };
     }
 
+    private static final class AdjacencyDumpParams {
+
+        private final int vni;
+
+        AdjacencyDumpParams(final int vni) {
+            this.vni = vni;
+        }
+
+        public int getVni() {
+            return this.vni;
+        }
+    }
+
     private class EidPairProducer implements EidTranslator {
 
         private final EidMappingContext localMappingContext;
         private final EidMappingContext remoteMappingContext;
 
-        public EidPairProducer(final EidMappingContext localMappingContext,
-                               final EidMappingContext remoteMappingContext) {
+        EidPairProducer(final EidMappingContext localMappingContext,
+                        final EidMappingContext remoteMappingContext) {
             this.localMappingContext = checkNotNull(localMappingContext, "Local mapping context cannot be null");
             this.remoteMappingContext = checkNotNull(remoteMappingContext, "Remote mapping context cannot be null");
         }
 
-        public EidIdentificatorPair createPair(final LispAdjacency data, final int vni,
-                                               final MappingContext mappingContext) {
+        EidIdentificatorPair createPair(final LispAdjacency data, final int vni,
+                                        final MappingContext mappingContext) {
             return new EidIdentificatorPairBuilder()
                     .setLocalEidId(new MappingId(localMappingContext.getId(getArrayAsEidLocal(
                             MappingsDumpParams.EidType.valueOf(data.eidType), data.leid, vni), mappingContext)))
@@ -176,17 +190,4 @@ public class AdjacencyCustomizer extends FutureJVppCustomizer
                     .build();
         }
     }
-
-    private static final class AdjacencyDumpParams {
-
-        private final int vni;
-
-        AdjacencyDumpParams(final int vni) {
-            this.vni = vni;
-        }
-
-        public int getVni() {
-            return this.vni;
-        }
-    }
 }
index 1e6ce3a..726d5ed 100644 (file)
@@ -19,6 +19,8 @@ package io.fd.hc2vpp.lisp.translate.read;
 import static com.google.common.base.Preconditions.checkNotNull;
 
 import com.google.common.base.Optional;
+import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.hc2vpp.lisp.translate.read.dump.executor.params.SubtableDumpParams;
 import io.fd.hc2vpp.lisp.translate.read.trait.SubtableReader;
 import io.fd.honeycomb.translate.read.ReadContext;
@@ -26,8 +28,6 @@ import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager.DumpCacheManagerBuilder;
-import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetails;
 import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetailsReplyDump;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
@@ -59,6 +59,7 @@ public class BridgeDomainSubtableCustomizer extends FutureJVppCustomizer impleme
         dumpManager =
                 new DumpCacheManagerBuilder<LispEidTableMapDetailsReplyDump, SubtableDumpParams>()
                         .withExecutor(createExecutor(futureJvppCore))
+                        .acceptOnly(LispEidTableMapDetailsReplyDump.class)
                         .build();
         this.bridgeDomainContext = checkNotNull(bridgeDomainContext, "Bridge domain context cannot be null");
     }
index c4bf0b8..0c6cc40 100755 (executable)
@@ -21,6 +21,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
 
 import com.google.common.base.Optional;
+import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.hc2vpp.lisp.translate.read.dump.executor.params.LocatorDumpParams;
 import io.fd.hc2vpp.lisp.translate.read.dump.executor.params.LocatorDumpParams.LocatorDumpParamsBuilder;
 import io.fd.hc2vpp.lisp.translate.read.trait.LocatorReader;
@@ -29,8 +31,6 @@ import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
 import io.fd.honeycomb.translate.util.RWUtils;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.vpp.jvpp.core.dto.LispLocatorDetails;
 import io.fd.vpp.jvpp.core.dto.LispLocatorDetailsReplyDump;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
@@ -67,6 +67,7 @@ public class InterfaceCustomizer
         this.dumpCacheManager =
                 new DumpCacheManager.DumpCacheManagerBuilder<LispLocatorDetailsReplyDump, LocatorDumpParams>()
                         .withExecutor(createLocatorDumpExecutor(futureJvpp))
+                        .acceptOnly(LispLocatorDetailsReplyDump.class)
                         .build();
     }
 
index eb078fe..654d1fc 100644 (file)
@@ -20,14 +20,14 @@ package io.fd.hc2vpp.lisp.translate.read;
 import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
 
 import com.google.common.base.Optional;
+import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
+import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
+import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
 import io.fd.honeycomb.translate.read.ReadContext;
 import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager.DumpCacheManagerBuilder;
-import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
-import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
-import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
 import io.fd.vpp.jvpp.core.dto.LispGetMapRequestItrRlocs;
 import io.fd.vpp.jvpp.core.dto.LispGetMapRequestItrRlocsReply;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
@@ -51,6 +51,7 @@ public class ItrRemoteLocatorSetCustomizer extends FutureJVppCustomizer
                 .withExecutor(((identifier, params) -> getReplyForRead(
                         futureJVppCore.lispGetMapRequestItrRlocs(new LispGetMapRequestItrRlocs()).toCompletableFuture(),
                         identifier)))
+                .acceptOnly(LispGetMapRequestItrRlocsReply.class)
                 .build();
     }
 
index 06d56c1..c6deb02 100755 (executable)
@@ -24,6 +24,8 @@ import static io.fd.hc2vpp.lisp.translate.read.dump.executor.params.MappingsDump
 import static io.fd.hc2vpp.lisp.translate.read.dump.executor.params.MappingsDumpParams.QuantityType;
 
 import com.google.common.base.Optional;
+import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.hc2vpp.lisp.context.util.EidMappingContext;
 import io.fd.hc2vpp.lisp.translate.read.dump.executor.params.MappingsDumpParams;
 import io.fd.hc2vpp.lisp.translate.read.trait.MappingReader;
@@ -33,8 +35,6 @@ import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
 import io.fd.honeycomb.translate.util.RWUtils;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.vpp.jvpp.core.dto.LispEidTableDetails;
 import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
@@ -78,6 +78,7 @@ public class LocalMappingCustomizer
         this.dumpManager =
                 new DumpCacheManager.DumpCacheManagerBuilder<LispEidTableDetailsReplyDump, MappingsDumpParams>()
                         .withExecutor(createMappingDumpExecutor(futureJvpp))
+                        .acceptOnly(LispEidTableDetailsReplyDump.class)
                         .build();
     }
 
index 9b2ec5a..322022a 100755 (executable)
@@ -20,14 +20,14 @@ import static com.google.common.base.Preconditions.checkNotNull;
 import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
 
 import com.google.common.base.Optional;
+import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
+import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.hc2vpp.lisp.translate.read.trait.LocatorSetReader;
 import io.fd.honeycomb.translate.read.ReadContext;
 import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
-import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetails;
 import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetailsReplyDump;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
@@ -60,6 +60,7 @@ public class LocatorSetCustomizer extends FutureJVppCustomizer
         this.locatorSetContext = checkNotNull(locatorSetContext, "Locator Set mapping context cannot be null");
         this.dumpManager = new DumpCacheManager.DumpCacheManagerBuilder<LispLocatorSetDetailsReplyDump, Void>()
                 .withExecutor(createExecutor(futureJvpp))
+                .acceptOnly(LispLocatorSetDetailsReplyDump.class)
                 .build();
     }
 
index cc73d77..cf6ca8b 100755 (executable)
@@ -19,14 +19,14 @@ package io.fd.hc2vpp.lisp.translate.read;
 import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
 
 import com.google.common.base.Optional;
+import io.fd.hc2vpp.common.translate.util.AddressTranslator;
+import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
+import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
 import io.fd.honeycomb.translate.read.ReadContext;
 import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
 import io.fd.honeycomb.translate.util.RWUtils;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.hc2vpp.common.translate.util.AddressTranslator;
-import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
-import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
 import io.fd.vpp.jvpp.core.dto.LispMapResolverDetails;
 import io.fd.vpp.jvpp.core.dto.LispMapResolverDetailsReplyDump;
 import io.fd.vpp.jvpp.core.dto.LispMapResolverDump;
@@ -61,6 +61,7 @@ public class MapResolverCustomizer extends FutureJVppCustomizer
                         .withExecutor((identifier, params) -> getReplyForRead(
                                 futureJvpp.lispMapResolverDump(new LispMapResolverDump()).toCompletableFuture(),
                                 identifier))
+                        .acceptOnly(LispMapResolverDetailsReplyDump.class)
                         .build();
     }
 
index 2a36a25..3b00d28 100755 (executable)
@@ -25,6 +25,10 @@ import static org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.l
 
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableSet;
+import io.fd.hc2vpp.common.translate.util.AddressTranslator;
+import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
+import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.hc2vpp.lisp.context.util.EidMappingContext;
 import io.fd.hc2vpp.lisp.translate.read.dump.executor.params.LocatorDumpParams;
 import io.fd.hc2vpp.lisp.translate.read.dump.executor.params.LocatorDumpParams.LocatorDumpParamsBuilder;
@@ -40,11 +44,7 @@ import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
 import io.fd.honeycomb.translate.util.RWUtils;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.util.read.cache.IdentifierCacheKeyFactory;
-import io.fd.hc2vpp.common.translate.util.AddressTranslator;
-import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
-import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
+import io.fd.honeycomb.translate.util.read.cache.TypeAwareIdentifierCacheKeyFactory;
 import io.fd.vpp.jvpp.core.dto.LispEidTableDetails;
 import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump;
 import io.fd.vpp.jvpp.core.dto.LispLocatorDetails;
@@ -105,16 +105,25 @@ public class RemoteMappingCustomizer extends FutureJVppCustomizer
         this.dumpManager =
                 new DumpCacheManager.DumpCacheManagerBuilder<LispEidTableDetailsReplyDump, MappingsDumpParams>()
                         .withExecutor(createMappingDumpExecutor(futureJvpp))
+                        .acceptOnly(LispEidTableDetailsReplyDump.class)
                         .build();
 
         // cache key needs to have locator set scope to not mix with cached data
         this.locatorsDumpManager =
                 new DumpCacheManager.DumpCacheManagerBuilder<LispLocatorDetailsReplyDump, LocatorDumpParams>()
                         .withExecutor(createLocatorDumpExecutor(futureJvpp))
-                        .withCacheKeyFactory(new IdentifierCacheKeyFactory(ImmutableSet.of(LocatorSet.class)))
+                        .withCacheKeyFactory(new TypeAwareIdentifierCacheKeyFactory(LispLocatorDetailsReplyDump.class,
+                                ImmutableSet.of(LocatorSet.class)))
+                        .acceptOnly(LispLocatorDetailsReplyDump.class)
                         .build();
     }
 
+    //compensate ~0 as default value of ttl
+    private static long resolveTtl(final int ttlValue) {
+        return ttlValue == -1
+                ? Integer.MAX_VALUE
+                : ttlValue;
+    }
 
     @Override
     public RemoteMappingBuilder getBuilder(InstanceIdentifier<RemoteMapping> id) {
@@ -175,13 +184,6 @@ public class RemoteMappingCustomizer extends FutureJVppCustomizer
         resolveMappings(id, builder, details, ctx.getModificationCache(), ctx.getMappingContext());
     }
 
-    //compensate ~0 as default value of ttl
-    private static long resolveTtl(final int ttlValue) {
-        return ttlValue == -1
-                ? Integer.MAX_VALUE
-                : ttlValue;
-    }
-
     @Override
     public List<RemoteMappingKey> getAllIds(InstanceIdentifier<RemoteMapping> id, ReadContext context)
             throws ReadFailedException {
index c0680a7..e38ae02 100755 (executable)
@@ -20,13 +20,13 @@ import static com.google.common.base.Preconditions.checkState;
 import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
 
 import com.google.common.base.Optional;
+import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
+import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
 import io.fd.honeycomb.translate.read.ReadContext;
 import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
 import io.fd.honeycomb.translate.util.RWUtils;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
-import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
 import io.fd.vpp.jvpp.core.dto.LispEidTableVniDetails;
 import io.fd.vpp.jvpp.core.dto.LispEidTableVniDetailsReplyDump;
 import io.fd.vpp.jvpp.core.dto.LispEidTableVniDump;
@@ -60,6 +60,7 @@ public class VniTableCustomizer extends FutureJVppCustomizer
         this.dumpManager = new DumpCacheManager.DumpCacheManagerBuilder<LispEidTableVniDetailsReplyDump, Void>()
                 .withExecutor(((identifier, params) -> getReplyForRead(
                         futureJvpp.lispEidTableVniDump(new LispEidTableVniDump()).toCompletableFuture(), identifier)))
+                .acceptOnly(LispEidTableVniDetailsReplyDump.class)
                 .build();
     }
 
index 0a73dc3..b092cb4 100644 (file)
@@ -19,6 +19,7 @@ package io.fd.hc2vpp.lisp.translate.read;
 import static com.google.common.base.Preconditions.checkNotNull;
 
 import com.google.common.base.Optional;
+import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
 import io.fd.hc2vpp.lisp.translate.read.dump.executor.params.SubtableDumpParams;
 import io.fd.hc2vpp.lisp.translate.read.trait.SubtableReader;
 import io.fd.honeycomb.translate.read.ReadContext;
@@ -26,7 +27,6 @@ import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager.DumpCacheManagerBuilder;
-import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
 import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetails;
 import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetailsReplyDump;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
@@ -54,6 +54,7 @@ public class VrfSubtableCustomizer extends FutureJVppCustomizer
         super(futureJvpp);
         dumpManager = new DumpCacheManagerBuilder<LispEidTableMapDetailsReplyDump, SubtableDumpParams>()
                 .withExecutor(createExecutor(futureJvpp))
+                .acceptOnly(LispEidTableMapDetailsReplyDump.class)
                 .build();
     }
 
index 76c4785..497ed1c 100644 (file)
@@ -64,11 +64,13 @@ public class NatReaderFactory implements ReaderFactory {
         this.mapEntryDumpMgr =
                 new DumpCacheManager.DumpCacheManagerBuilder<SnatStaticMappingDetailsReplyDump, Void>()
                         .withExecutor(new MappingEntryCustomizer.MappingEntryDumpExecutor(jvppSnat))
+                        .acceptOnly(SnatStaticMappingDetailsReplyDump.class)
                         .build();
 
         this.addressRangeDumpMgr =
                 new DumpCacheManager.DumpCacheManagerBuilder<SnatAddressDetailsReplyDump, Void>()
                         .withExecutor(new ExternalIpPoolCustomizer.AddressRangeDumpExecutor(jvppSnat))
+                        .acceptOnly(SnatAddressDetailsReplyDump.class)
                         .build();
     }
 
index 87a70f7..6417852 100644 (file)
@@ -19,14 +19,14 @@ package io.fd.hc2vpp.nat.read.ifc;
 
 import com.google.inject.Inject;
 import com.google.inject.name.Named;
+import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.honeycomb.translate.impl.read.GenericInitReader;
 import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.read.ReaderFactory;
 import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
 import io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor;
-import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.vpp.jvpp.snat.dto.SnatInterfaceDetailsReplyDump;
 import io.fd.vpp.jvpp.snat.dto.SnatInterfaceDump;
 import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade;
@@ -60,6 +60,7 @@ public final class IfcNatReaderFactory implements ReaderFactory {
                                @Named("interface-context") final NamingContext ifcContext) {
         this.snatIfcDumpMgr = new DumpCacheManager.DumpCacheManagerBuilder<SnatInterfaceDetailsReplyDump, Void>()
                 .withExecutor(new SnatInterfaceExecutor(jvppSnat))
+                .acceptOnly(SnatInterfaceDetailsReplyDump.class)
                 .build();
         this.ifcContext = ifcContext;
     }
index b5c0dab..d4078b0 100644 (file)
@@ -20,13 +20,13 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 import com.google.common.collect.Lists;
+import io.fd.hc2vpp.common.test.read.ReaderCustomizerTest;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.honeycomb.translate.impl.read.GenericReader;
 import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
 import io.fd.honeycomb.translate.util.RWUtils;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
 import io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
-import io.fd.hc2vpp.common.test.read.ReaderCustomizerTest;
 import io.fd.vpp.jvpp.snat.dto.SnatInterfaceDetails;
 import io.fd.vpp.jvpp.snat.dto.SnatInterfaceDetailsReplyDump;
 import org.junit.Test;
@@ -60,6 +60,14 @@ public class InterfaceInboundNatCustomizerTest
         super(Inbound.class, NatBuilder.class);
     }
 
+    static <T extends ChildOf<Nat>> InstanceIdentifier<T> getId(Class<T> boundType) {
+        return InstanceIdentifier.create(InterfacesState.class)
+                .child(Interface.class, new InterfaceKey(IFC_NAME))
+                .augmentation(NatInterfaceStateAugmentation.class)
+                .child(Nat.class)
+                .child(boundType);
+    }
+
     @Override
     protected void setUp() throws Exception {
         id = getId(Inbound.class);
@@ -68,17 +76,10 @@ public class InterfaceInboundNatCustomizerTest
         Mockito.doReturn(new SnatInterfaceDetailsReplyDump()).when(natExecutor).executeDump(id, null);
         dumpMgr = new DumpCacheManager.DumpCacheManagerBuilder<SnatInterfaceDetailsReplyDump, Void>()
                 .withExecutor(natExecutor)
+                .acceptOnly(SnatInterfaceDetailsReplyDump.class)
                 .build();
     }
 
-    static <T extends ChildOf<Nat>> InstanceIdentifier<T> getId(Class<T> boundType) {
-        return InstanceIdentifier.create(InterfacesState.class)
-                .child(Interface.class, new InterfaceKey(IFC_NAME))
-                .augmentation(NatInterfaceStateAugmentation.class)
-                .child(Nat.class)
-                .child(boundType);
-    }
-
     @Test
     public void testNoPresence() throws Exception {
         assertFalse(getReader().read(id, ctx).isPresent());
index 34f5b09..30f0278 100644 (file)
@@ -21,13 +21,13 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 import com.google.common.collect.Lists;
+import io.fd.hc2vpp.common.test.read.ReaderCustomizerTest;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.honeycomb.translate.impl.read.GenericReader;
 import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
 import io.fd.honeycomb.translate.util.RWUtils;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
 import io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
-import io.fd.hc2vpp.common.test.read.ReaderCustomizerTest;
 import io.fd.vpp.jvpp.snat.dto.SnatInterfaceDetails;
 import io.fd.vpp.jvpp.snat.dto.SnatInterfaceDetailsReplyDump;
 import org.junit.Test;
@@ -63,6 +63,7 @@ public class InterfaceOutboundNatCustomizerTest
         Mockito.doReturn(new SnatInterfaceDetailsReplyDump()).when(abc).executeDump(id, null);
         dumpMgr = new DumpCacheManager.DumpCacheManagerBuilder<SnatInterfaceDetailsReplyDump, Void>()
                 .withExecutor(abc)
+                .acceptOnly(SnatInterfaceDetailsReplyDump.class)
                 .build();
     }
 
index a71c006..43d82ec 100644 (file)
@@ -19,19 +19,19 @@ package io.fd.hc2vpp.v3po.interfacesstate.ip;
 import static com.google.common.base.Preconditions.checkNotNull;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableSet;
 import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableSet;
+import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
+import io.fd.hc2vpp.v3po.interfacesstate.InterfaceCustomizer;
+import io.fd.hc2vpp.v3po.interfacesstate.ip.dump.params.AddressDumpParams;
 import io.fd.honeycomb.translate.read.ReadContext;
 import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.Initialized;
 import io.fd.honeycomb.translate.spi.read.InitializingListReaderCustomizer;
 import io.fd.honeycomb.translate.util.RWUtils;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.util.read.cache.IdentifierCacheKeyFactory;
-import io.fd.hc2vpp.v3po.interfacesstate.InterfaceCustomizer;
-import io.fd.hc2vpp.v3po.interfacesstate.ip.dump.params.AddressDumpParams;
-import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
+import io.fd.honeycomb.translate.util.read.cache.TypeAwareIdentifierCacheKeyFactory;
 import io.fd.vpp.jvpp.core.dto.IpAddressDetails;
 import io.fd.vpp.jvpp.core.dto.IpAddressDetailsReplyDump;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
@@ -72,10 +72,35 @@ public class Ipv4AddressCustomizer extends FutureJVppCustomizer
                 new DumpCacheManager.DumpCacheManagerBuilder<IpAddressDetailsReplyDump, AddressDumpParams>()
                         .withExecutor(createExecutor(futureJVppCore))
                         // Key needs to contain interface ID to distinguish dumps between interfaces
-                        .withCacheKeyFactory(new IdentifierCacheKeyFactory(ImmutableSet.of(Interface.class)))
+                        .withCacheKeyFactory(new TypeAwareIdentifierCacheKeyFactory(IpAddressDetailsReplyDump.class,
+                                ImmutableSet.of(Interface.class)))
                         .build();
     }
 
+    private static Subnet getSubnet(final Address address) {
+        final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.ipv4.address.Subnet
+                subnet = address.getSubnet();
+
+        // Only prefix length supported
+        Preconditions.checkArgument(
+                subnet instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.ipv4.address.subnet.PrefixLength);
+
+        return new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.address.subnet.PrefixLengthBuilder()
+                .setPrefixLength(
+                        ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.ipv4.address.subnet.PrefixLength) subnet)
+                                .getPrefixLength()).build();
+    }
+
+    static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.Address> getCfgId(
+            final InstanceIdentifier<Address> id) {
+        return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class))
+                .augmentation(Interface1.class)
+                .child(Ipv4.class)
+                .child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.Address.class,
+                        new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.AddressKey(
+                                id.firstKeyOf(Address.class).getIp()));
+    }
+
     @Override
     @Nonnull
     public AddressBuilder getBuilder(@Nonnull InstanceIdentifier<Address> id) {
@@ -140,27 +165,4 @@ public class Ipv4AddressCustomizer extends FutureJVppCustomizer
                         .setSubnet(getSubnet(readValue))
                         .build());
     }
-
-    private static Subnet getSubnet(final Address address) {
-        final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.ipv4.address.Subnet
-                subnet = address.getSubnet();
-
-        // Only prefix length supported
-        Preconditions.checkArgument(
-                subnet instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.ipv4.address.subnet.PrefixLength);
-
-        return new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.address.subnet.PrefixLengthBuilder()
-                .setPrefixLength(
-                ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.ipv4.address.subnet.PrefixLength) subnet)
-                        .getPrefixLength()).build();
-    }
-
-    static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.Address> getCfgId(
-            final InstanceIdentifier<Address> id) {
-        return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class))
-                .augmentation(Interface1.class)
-                .child(Ipv4.class)
-                .child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.Address.class,
-                        new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.AddressKey(id.firstKeyOf(Address.class).getIp()));
-    }
 }
index 3288e0c..cb239dc 100644 (file)
@@ -20,18 +20,18 @@ import static com.google.common.base.Preconditions.checkNotNull;
 
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableSet;
+import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.hc2vpp.v3po.interfacesstate.SubInterfaceCustomizer;
 import io.fd.hc2vpp.v3po.interfacesstate.ip.dump.params.AddressDumpParams;
+import io.fd.hc2vpp.v3po.util.SubInterfaceUtils;
 import io.fd.honeycomb.translate.read.ReadContext;
 import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.Initialized;
 import io.fd.honeycomb.translate.spi.read.InitializingListReaderCustomizer;
 import io.fd.honeycomb.translate.util.RWUtils;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
-import io.fd.honeycomb.translate.util.read.cache.IdentifierCacheKeyFactory;
-import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
-import io.fd.hc2vpp.v3po.util.SubInterfaceUtils;
+import io.fd.honeycomb.translate.util.read.cache.TypeAwareIdentifierCacheKeyFactory;
 import io.fd.vpp.jvpp.core.dto.IpAddressDetails;
 import io.fd.vpp.jvpp.core.dto.IpAddressDetailsReplyDump;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
@@ -69,10 +69,16 @@ public class SubInterfaceIpv4AddressCustomizer extends FutureJVppCustomizer
         this.dumpManager = new DumpCacheManager.DumpCacheManagerBuilder<IpAddressDetailsReplyDump, AddressDumpParams>()
                 .withExecutor(createExecutor(futureJVppCore))
                 //same as with ipv4 addresses for interfaces, these must have cache scope of their parent sub-interface
-                .withCacheKeyFactory(new IdentifierCacheKeyFactory(ImmutableSet.of(SubInterface.class)))
+                .withCacheKeyFactory(new TypeAwareIdentifierCacheKeyFactory(IpAddressDetailsReplyDump.class,
+                        ImmutableSet.of(SubInterface.class)))
                 .build();
     }
 
+    private static String getSubInterfaceName(@Nonnull final InstanceIdentifier<Address> id) {
+        return SubInterfaceUtils.getSubInterfaceName(id.firstKeyOf(Interface.class).getName(),
+                Math.toIntExact(id.firstKeyOf(SubInterface.class).getIdentifier()));
+    }
+
     @Override
     @Nonnull
     public AddressBuilder getBuilder(@Nonnull InstanceIdentifier<Address> id) {
@@ -123,11 +129,6 @@ public class SubInterfaceIpv4AddressCustomizer extends FutureJVppCustomizer
         ((Ipv4Builder) builder).setAddress(readData);
     }
 
-    private static String getSubInterfaceName(@Nonnull final InstanceIdentifier<Address> id) {
-        return SubInterfaceUtils.getSubInterfaceName(id.firstKeyOf(Interface.class).getName(),
-                Math.toIntExact(id.firstKeyOf(SubInterface.class).getIdentifier()));
-    }
-
     @Override
     public Initialized<Address> init(
             @Nonnull final InstanceIdentifier<Address> id, @Nonnull final Address readValue,
index bac21c8..0ab64b2 100644 (file)
@@ -27,13 +27,13 @@ import static org.mockito.Mockito.when;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
+import io.fd.hc2vpp.common.test.read.ListReaderCustomizerTest;
+import io.fd.hc2vpp.common.translate.util.Ipv4Translator;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
 import io.fd.honeycomb.translate.util.read.cache.CacheKeyFactory;
-import io.fd.honeycomb.translate.util.read.cache.IdentifierCacheKeyFactory;
-import io.fd.hc2vpp.common.translate.util.Ipv4Translator;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
-import io.fd.hc2vpp.common.test.read.ListReaderCustomizerTest;
+import io.fd.honeycomb.translate.util.read.cache.TypeAwareIdentifierCacheKeyFactory;
 import io.fd.vpp.jvpp.core.dto.IpAddressDetails;
 import io.fd.vpp.jvpp.core.dto.IpAddressDetailsReplyDump;
 import io.fd.vpp.jvpp.core.dto.IpAddressDump;
@@ -76,6 +76,15 @@ public class Ipv4AddressCustomizerTest extends ListReaderCustomizerTest<Address,
         super(Address.class, Ipv4Builder.class);
     }
 
+    private static InstanceIdentifier<Address> getId(final String address, final String ifaceName) {
+        return InstanceIdentifier.builder(InterfacesState.class)
+                .child(Interface.class, new InterfaceKey(ifaceName))
+                .augmentation(Interface2.class)
+                .child(Ipv4.class)
+                .child(Address.class, new AddressKey(new Ipv4AddressNoZone(new Ipv4Address(address))))
+                .build();
+    }
+
     @Override
     public void setUp() {
         interfacesContext = new NamingContext("generatedIfaceName", IFC_CTX_NAME);
@@ -96,7 +105,8 @@ public class Ipv4AddressCustomizerTest extends ListReaderCustomizerTest<Address,
                         .child(Address.class, new AddressKey(new Ipv4AddressNoZone("192.168.2.1")));
 
         // to simulate complex key
-        cacheKeyFactory = new IdentifierCacheKeyFactory(ImmutableSet.of(Interface.class));
+        cacheKeyFactory = new TypeAwareIdentifierCacheKeyFactory(IpAddressDetailsReplyDump.class,
+                ImmutableSet.of(Interface.class));
     }
 
     @Override
@@ -104,15 +114,6 @@ public class Ipv4AddressCustomizerTest extends ListReaderCustomizerTest<Address,
         return new Ipv4AddressCustomizer(api, interfacesContext);
     }
 
-    private static InstanceIdentifier<Address> getId(final String address, final String ifaceName) {
-        return InstanceIdentifier.builder(InterfacesState.class)
-                .child(Interface.class, new InterfaceKey(ifaceName))
-                .augmentation(Interface2.class)
-                .child(Ipv4.class)
-                .child(Address.class, new AddressKey(new Ipv4AddressNoZone(new Ipv4Address(address))))
-                .build();
-    }
-
     @Test
     public void testReadCurrentAttributesFor2Ifcs() throws ReadFailedException {
         //changed to mock to not store first dumped data(otherwise that double thenReturn on line 118 is not gonna work)
index 4842f5d..8c67735 100644 (file)
@@ -29,13 +29,13 @@ import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import com.google.common.collect.ImmutableSet;
+import io.fd.hc2vpp.common.test.read.ListReaderCustomizerTest;
+import io.fd.hc2vpp.common.translate.util.Ipv4Translator;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
 import io.fd.honeycomb.translate.read.ReadFailedException;
 import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
 import io.fd.honeycomb.translate.util.read.cache.CacheKeyFactory;
-import io.fd.honeycomb.translate.util.read.cache.IdentifierCacheKeyFactory;
-import io.fd.hc2vpp.common.translate.util.Ipv4Translator;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
-import io.fd.hc2vpp.common.test.read.ListReaderCustomizerTest;
+import io.fd.honeycomb.translate.util.read.cache.TypeAwareIdentifierCacheKeyFactory;
 import io.fd.vpp.jvpp.core.dto.IpAddressDetails;
 import io.fd.vpp.jvpp.core.dto.IpAddressDetailsReplyDump;
 import java.util.Arrays;
@@ -76,19 +76,26 @@ public class SubInterfaceIpv4AddressCustomizerTest extends ListReaderCustomizerT
                     .augmentation(SubinterfaceStateAugmentation.class)
                     .child(SubInterfaces.class).child(SubInterface.class, new SubInterfaceKey(SUB_IF_ID))
                     .child(Ipv4.class);
-    private InstanceIdentifier<Address> ifaceOneAddressOneIdentifier;
-    private InstanceIdentifier<Address> ifaceTwoAddressOneIdentifier;
-    private CacheKeyFactory cacheKeyFactory;
     private static final Ipv4AddressNoZone IP1 = new Ipv4AddressNoZone("10.1.1.1");
     private static final Ipv4AddressNoZone IP2 = new Ipv4AddressNoZone("10.1.1.2");
     private static final short PREFIX_LENGTH = 16;
-
+    private InstanceIdentifier<Address> ifaceOneAddressOneIdentifier;
+    private InstanceIdentifier<Address> ifaceTwoAddressOneIdentifier;
+    private CacheKeyFactory cacheKeyFactory;
     private NamingContext interfaceContext;
 
     public SubInterfaceIpv4AddressCustomizerTest() {
         super(Address.class, Ipv4Builder.class);
     }
 
+    private static InstanceIdentifier<Address> getId() {
+        return IP4_IID.child(Address.class);
+    }
+
+    private static InstanceIdentifier<Address> getId(final Ipv4AddressNoZone ip) {
+        return IP4_IID.child(Address.class, new AddressKey(ip));
+    }
+
     @Override
     protected void setUp() throws Exception {
         interfaceContext = new NamingContext("generatedIfaceName", IFC_CTX_NAME);
@@ -109,7 +116,8 @@ public class SubInterfaceIpv4AddressCustomizerTest extends ListReaderCustomizerT
                 .child(Address.class, new AddressKey(new Ipv4AddressNoZone("192.168.2.1")));
 
         // to simulate complex key
-        cacheKeyFactory = new IdentifierCacheKeyFactory(ImmutableSet.of(SubInterface.class));
+        cacheKeyFactory = new TypeAwareIdentifierCacheKeyFactory(IpAddressDetailsReplyDump.class,
+                ImmutableSet.of(SubInterface.class));
 
         defineMapping(mappingContext, IF_NAME, IF_INDEX, IFC_CTX_NAME);
         defineMapping(mappingContext, SUB_IF_NAME, SUB_IF_INDEX, IFC_CTX_NAME);
@@ -121,14 +129,6 @@ public class SubInterfaceIpv4AddressCustomizerTest extends ListReaderCustomizerT
         return new SubInterfaceIpv4AddressCustomizer(api, interfaceContext);
     }
 
-    private static InstanceIdentifier<Address> getId() {
-        return IP4_IID.child(Address.class);
-    }
-
-    private static InstanceIdentifier<Address> getId(final Ipv4AddressNoZone ip) {
-        return IP4_IID.child(Address.class, new AddressKey(ip));
-    }
-
     @Test
     public void testRead() throws ReadFailedException {
         final AddressBuilder builder = mock(AddressBuilder.class);