@Test public void testComputeIpVrfOwners() { String node = "node"; String vrf1 = "vrf1"; String vrf2 = "vrf2"; Ip ip = Ip.parse("1.1.1.1"); Map<Ip, Map<String, Map<String, Set<String>>>> ipIfaceOwners = ImmutableMap.of( ip, ImmutableMap.of( node, ImmutableMap.of( vrf1, ImmutableSet.of("iface1", "iface2"), vrf2, ImmutableSet.of("iface3")))); Map<Ip, Map<String, Set<String>>> ipVrfOwners = computeIpVrfOwners(ipIfaceOwners); assertThat( ipVrfOwners, equalTo(ImmutableMap.of(ip, ImmutableMap.of(node, ImmutableSet.of(vrf1, vrf2))))); }
@VisibleForTesting static Map<Ip, Map<String, Set<String>>> computeIpVrfOwners( Map<Ip, Map<String, Map<String, Set<String>>>> ipVrfIfaceOwners) { return toImmutableMap( ipVrfIfaceOwners, Entry::getKey, ipEntry -> toImmutableMap( ipEntry.getValue(), Entry::getKey, nodeEntry -> ImmutableSet.copyOf(nodeEntry.getValue().keySet()))); }
IpOwners { @VisibleForTesting static Map<Ip, Map<String, Set<String>>> computeIpVrfOwners( Map<Ip, Map<String, Map<String, Set<String>>>> ipVrfIfaceOwners) { return toImmutableMap( ipVrfIfaceOwners, Entry::getKey, ipEntry -> toImmutableMap( ipEntry.getValue(), Entry::getKey, nodeEntry -> ImmutableSet.copyOf(nodeEntry.getValue().keySet()))); } }
IpOwners { @VisibleForTesting static Map<Ip, Map<String, Set<String>>> computeIpVrfOwners( Map<Ip, Map<String, Map<String, Set<String>>>> ipVrfIfaceOwners) { return toImmutableMap( ipVrfIfaceOwners, Entry::getKey, ipEntry -> toImmutableMap( ipEntry.getValue(), Entry::getKey, nodeEntry -> ImmutableSet.copyOf(nodeEntry.getValue().keySet()))); } IpOwners(Map<String, Configuration> configurations); }
IpOwners { @VisibleForTesting static Map<Ip, Map<String, Set<String>>> computeIpVrfOwners( Map<Ip, Map<String, Map<String, Set<String>>>> ipVrfIfaceOwners) { return toImmutableMap( ipVrfIfaceOwners, Entry::getKey, ipEntry -> toImmutableMap( ipEntry.getValue(), Entry::getKey, nodeEntry -> ImmutableSet.copyOf(nodeEntry.getValue().keySet()))); } IpOwners(Map<String, Configuration> configurations); static Map<String, Map<String, Set<Ip>>> computeInterfaceOwnedIps(
      Map<String, Configuration> configurations, boolean excludeInactive); static Map<Ip, Set<String>> computeIpNodeOwners(
      Map<String, Configuration> configurations, boolean excludeInactive); Map<Ip, Map<String, Set<String>>> getActiveDeviceOwnedIps(); Map<Ip, Map<String, Set<String>>> getAllDeviceOwnedIps(); Map<String, Map<String, IpSpace>> getAllInterfaceHostIps(); Map<String, Map<String, IpSpace>> getInterfaceOwnedIpSpaces(); Map<Ip, Map<String, Set<String>>> getIpVrfOwners(); Map<String, Map<String, Map<String, IpSpace>>> getVrfIfaceOwnedIpSpaces(); }
IpOwners { @VisibleForTesting static Map<Ip, Map<String, Set<String>>> computeIpVrfOwners( Map<Ip, Map<String, Map<String, Set<String>>>> ipVrfIfaceOwners) { return toImmutableMap( ipVrfIfaceOwners, Entry::getKey, ipEntry -> toImmutableMap( ipEntry.getValue(), Entry::getKey, nodeEntry -> ImmutableSet.copyOf(nodeEntry.getValue().keySet()))); } IpOwners(Map<String, Configuration> configurations); static Map<String, Map<String, Set<Ip>>> computeInterfaceOwnedIps(
      Map<String, Configuration> configurations, boolean excludeInactive); static Map<Ip, Set<String>> computeIpNodeOwners(
      Map<String, Configuration> configurations, boolean excludeInactive); Map<Ip, Map<String, Set<String>>> getActiveDeviceOwnedIps(); Map<Ip, Map<String, Set<String>>> getAllDeviceOwnedIps(); Map<String, Map<String, IpSpace>> getAllInterfaceHostIps(); Map<String, Map<String, IpSpace>> getInterfaceOwnedIpSpaces(); Map<Ip, Map<String, Set<String>>> getIpVrfOwners(); Map<String, Map<String, Map<String, IpSpace>>> getVrfIfaceOwnedIpSpaces();  }