@VisibleForTesting public static Set<String> getZones(Map<String, Configuration> configurations) { ImmutableSet.Builder<String> zones = ImmutableSet.builder(); configurations .values() .forEach(configuration -> zones.addAll(configuration.getZones().keySet())); return zones.build(); } }
private Set<Interface> resolve(String node, SpecifierContext ctxt) { Configuration config = ctxt.getConfigs().get(node); Set<String> interfaceNamesInMatchingZones = config.getZones().values().stream() .filter(z -> _pattern.matcher(z.getName()).matches()) .map(z -> z.getInterfaces()) .flatMap(Collection::stream) .collect(Collectors.toSet()); return config.getAllInterfaces().values().stream() .filter(i -> interfaceNamesInMatchingZones.contains(i.getName())) .collect(Collectors.toSet()); } }
@Override protected Zone featureValueOf(Configuration actual) { return actual.getZones().get(_name); } }
Zone zone = zoneEntry.getValue(); String zoneName = computeObjectName(vsysName, zone.getName()); _c.getZones().put(zoneName, toZone(zoneName, zone));
_c.getZones().put(zone.getName(), newZone); if (zone.getAddressBookType() == AddressBookType.INLINED) { Map<String, IpSpace> ipSpaces = toIpSpaces(zone.getName(), zone.getAddressBook());
abstractConf.setTacacsSourceInterface(conf.getTacacsSourceInterface()); abstractConf.setVendorFamily(conf.getVendorFamily()); abstractConf.setZones(conf.getZones()); abstractConf.setCommunityLists(conf.getCommunityLists()); abstractConf.setRoutingPolicies(conf.getRoutingPolicies());
_securityZones.forEach((name, securityZone) -> c.getZones().put(name, new Zone(name))); return; Zone zone = c.getZones().get(zoneName); if (zone == null) { return; (level, iface) -> { String zoneName = computeSecurityLevelZoneName(level); Zone zone = c.getZones().computeIfAbsent(zoneName, Zone::new); zone.setInterfaces( ImmutableSet.<String>builder()