import io.fd.hc2vpp.common.translate.util.Ipv4Translator;
import io.fd.hc2vpp.common.translate.util.NamingContext;
import io.fd.hc2vpp.l3.read.InterfaceChildNodeTest;
+import io.fd.hc2vpp.l3.utils.ip.read.IfaceDumpFilter;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
import io.fd.honeycomb.translate.util.read.cache.CacheKeyFactory;
detailIfaceTwoAddressOne.ip = ipv4AddressNoZoneToArray(new Ipv4AddressNoZone(new Ipv4Address("192.168.2.1")));
detailIfaceTwoAddressOne.prefixLength = 23;
- cache.put(cacheKeyFactory.createKey(ifaceOneAddressOneIdentifier), replyIfaceOne);
- cache.put(cacheKeyFactory.createKey(ifaceTwoAddressOneIdentifier), replyIfaceTwo);
+ cache.put(cacheKeyFactory.createKey(ifaceOneAddressOneIdentifier, new IfaceDumpFilter(IFACE_ID, false)),
+ replyIfaceOne);
+ cache.put(cacheKeyFactory.createKey(ifaceTwoAddressOneIdentifier, new IfaceDumpFilter(IFACE_2_ID, false)),
+ replyIfaceTwo);
}
private void fillCacheForFirstIfaceSecondEmpty() {
detailIfaceOneAddressOne.ip = ipv4AddressNoZoneToArray(new Ipv4AddressNoZone(new Ipv4Address("192.168.2.1")));
detailIfaceOneAddressOne.prefixLength = 22;
- cache.put(cacheKeyFactory.createKey(ifaceOneAddressOneIdentifier), replyIfaceOne);
- cache.put(cacheKeyFactory.createKey(ifaceTwoAddressOneIdentifier), new IpAddressDetailsReplyDump());
+ cache.put(cacheKeyFactory.createKey(ifaceOneAddressOneIdentifier, new IfaceDumpFilter(IFACE_ID, false)),
+ replyIfaceOne);
+ cache.put(cacheKeyFactory.createKey(ifaceTwoAddressOneIdentifier, new IfaceDumpFilter(IFACE_2_ID, false)),
+ new IpAddressDetailsReplyDump());
}
}
import io.fd.hc2vpp.common.translate.util.Ipv4Translator;
import io.fd.hc2vpp.common.translate.util.NamingContext;
import io.fd.hc2vpp.l3.read.ipv4.subinterface.SubInterfaceIpv4AddressCustomizer;
+import io.fd.hc2vpp.l3.utils.ip.read.IfaceDumpFilter;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
import io.fd.honeycomb.translate.util.read.cache.CacheKeyFactory;
detailIfaceTwoAddressOne.ip = ipv4AddressNoZoneToArray(new Ipv4AddressNoZone(new Ipv4Address("192.168.2.1")));
detailIfaceTwoAddressOne.prefixLength = 23;
- cache.put(cacheKeyFactory.createKey(ifaceOneAddressOneIdentifier), replyIfaceOne);
- cache.put(cacheKeyFactory.createKey(ifaceTwoAddressOneIdentifier), replyIfaceTwo);
+ cache.put(cacheKeyFactory.createKey(ifaceOneAddressOneIdentifier, new IfaceDumpFilter(SUB_IF_INDEX, false)),
+ replyIfaceOne);
+ cache.put(cacheKeyFactory.createKey(ifaceTwoAddressOneIdentifier, new IfaceDumpFilter(SUB_IF_2_INDEX, false)),
+ replyIfaceTwo);
}
private void fillCacheForFirstIfaceSecondEmpty() {
detailIfaceOneAddressOne.ip = ipv4AddressNoZoneToArray(new Ipv4AddressNoZone(new Ipv4Address("192.168.2.1")));
detailIfaceOneAddressOne.prefixLength = 22;
- cache.put(cacheKeyFactory.createKey(ifaceOneAddressOneIdentifier), replyIfaceOne);
- cache.put(cacheKeyFactory.createKey(ifaceTwoAddressOneIdentifier), new IpAddressDetailsReplyDump());
+ cache.put(cacheKeyFactory.createKey(ifaceOneAddressOneIdentifier, new IfaceDumpFilter(SUB_IF_INDEX, false)),
+ replyIfaceOne);
+ cache.put(cacheKeyFactory.createKey(ifaceTwoAddressOneIdentifier, new IfaceDumpFilter(SUB_IF_2_INDEX, false)),
+ new IpAddressDetailsReplyDump());
}
private IpAddressDetailsReplyDump dump() {
throws ReadFailedException {
final String ifcName = id.firstKeyOf(Interface.class).getName();
final int ifcIndex = interfaceContext.getIndex(ifcName, ctx.getMappingContext());
- // FIXME: only first dump will result in jvpp call, so either we improve
- // DumpCacheManager(HONEYCOMB-348) or we need to do it directly (probably without caching):
final Optional<Integer> ip4 = readTableIndex(id, ifcIndex, TABLE_IP4, ctx.getModificationCache());
if (ip4.isPresent()) {
builder.setIp4Table(classifyTableContext.getTableName(ip4.get(), ctx.getMappingContext()));